use on your .htaccess file
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]
Linux Other
- one way
pidof vim
- other way
pregp -u root vim
- to kill the program
pkill [pid]
Linux
if [ $? -ne 0 ]; then
echo "The command was not successful.";
#do the needful / exit
fi;
Linux
# Define shell function
check_process() {
echo "Checking if process $1 exists..."
[ "$1" = "" ] && return 0
PROCESS_NUM=$(ps -ef | grep "$1" | grep -v "grep" | wc -l)
if [ $PROCESS_NUM -ge 1 ];
then
return 1
else
return 0
fi
}
Linux
pip install -upgrade youtube-dl
youtube-dl -i --yes-playlist --playlist-start 1 --write-thumbnail --write-auto-sub --sub-format srt --format mp4 -o "%(playlist_index)s-%(title)s.%(ext)s"
Linux
#!/bin/sh
counter=1
root=mypict
resolution=400x300
for i in `ls -1 $1/*.jpg`; do
echo "Now working on $i"
convert -resize $resolution $i ${root}_${counter}.jpg
counter=`expr $counter + 1`
done
Linux