top-image

Archives for Linux

pgp encrypt and decrypt automaticlly by shell
#!/bin/bash GNUPGHOME='/storage/apps/passphrase/.gnupg/' export GNUPGHOME PASSPHRASE=/storage/apps/passphrase/johnmen INPUT=$2 OUTPUT=$3 function decrypt(){ gpg --batch --passphrase-fd 3 --output $OUTPUT --decrypt $INPUT 3< $PASSPHRASE if ; then echo OK exit 0 else echo ERROR exit 1 fi } function encrypt(){ ...more»
Use lftp to mirror a site via FTP
Save below code as a shell file and add execute permission then just run it. Also you can add it to crontab as a service to run it on a time pattern you specified. chmod +x mirrorftp.sh ./mirrorftp.sh #!/bin/bash echo "script start at " `date "+%Y-%m-%d %H:%M:%S"` lftp -u username,password -e "mirror -c --parallel=10 --delete / /root/path/to/local/ftp/folder" ftp.ftpserver.com > /var/log/autosync.log 2>&1 ...more»
OpenCMS PRO 7.5.2
OpenCms from Alkacon Software is a professional, easy to use website content management system.
Batch convert dos2unix
find . -name '*.java' -exec dos2unix -k -q {} \; sed -i 's/foo/foo_bar/g' *.java sed -i 's#foo#foo_bar#g' `grep foo -rl .` sudo echo 'xx' > ~/test.list not work resolve echo 'deb blah blah # blah blah' | sudo tee -a ~/test.list sudo sh -c "echo >> somefile" ...more»
bottom-img

Powered by Yahoo! Answers