Category: Bash / Terminal / Scripts

24.04.2017

every once and a while you would like to save some disk space… by re-encoding your *.jpg and *.mp4 from your mobile phone… you can do this with this pretty nice windows program (shiiit) http://www.any-video-converter.com/products/for_video_free/ linux alternatives: https://askubuntu.com/questions/264215/which-is-best-audio-video-converter-on-linux anyway it’s […]

23.04.2017

apt-get update; apt-get install p7zip-full; # install software vim ./un7zip.sh; # create a new bash script file # insert this: #!/bin/bash for arc in *.7z do    7z x -y "$arc" done :wq # write and quit vim chmod u+x […]

10.02.2017

This is a basic but yet very powerful way to stress-test your site. WordPress, Blogspot but also TYPO3 without HipHop and PHP7 (check out this benchmark) seem to be quiet good targets for this attack. I basically managed to bring […]

31.01.2017

Hardware Assembly: (i think 512MByte should be enough, 1GByte probably pretty good) Software Installation: including squid-proxy and web advertisement-filtering in the next part: OpenVPN 🙂 Thanks man! Amazing tutorials! by https://internetz.me Related Links: https://www.howtoforge.com/pfsense-squid-squidguard-traffic-shaping-tutorial http://www.shallalist.de/Downloads/shallalist.tar.gz

31.01.2017

ip address add 192.168.100.200/24 dev eth0 will add ip 192.168.100.200 to your eth0 / LAN, in case you need to access more subnets than the default DHCP-subnet. please also checkout this amazingly cool youtube video tutorial on how to build […]

12.10.2016

from recording a webradio i had a load of those files, which were kind of tricky to delete. The trick is to use find instead of rm. find -name "*————— – —————*"; #dry run ./————— – ————— (20).aac ./————— – […]

27.08.2016

you can either use wget to download the webpage or use Firefox Ctrl+S (Save As) wget http://domain.com/website.html; # download webpage # become root sudo bash; # or su; apt-get update; apt-get install lynx; lynx -dump "website.html" | awk ‚/http/{print $2}’| […]

03.08.2016

sudo bash; # become root #create directories mkdir -p /backup/mysql # backup every database manually separately mysqldump -u root DATABASE_NAME > /backup/DATABASE_NAME.sql; # backup every database separately automatically (easier to restore) for db in $(mysql -u root -e ’show databases‘ […]

02.08.2016

apt-cache showpkg evolution-common Package: evolution-common Versions: 3.12.9~git20141130.241663-1 (/var/lib/apt/lists/ftp.uni-erlangen.de_debian_dists_jessie_main_binary-i386_Packages) (/var/lib/dpkg/status) Description Language: File: /var/lib/apt/lists/ftp.uni-erlangen.de_debian_dists_jessie_main_binary-i386_Packages MD5: 63a9c80d6efb5e50b74aae7ebcc8bf5c Description Language: en File: /var/lib/apt/lists/ftp.uni-erlangen.de_debian_dists_jessie_main_i18n_Translation-en MD5: 63a9c80d6efb5e50b74aae7ebcc8bf5c Reverse Depends: gnome-panel,evolution-common 3.4.3 evolution,evolution-common 2.91 evolution,evolution-common 3.12.9~git20141130.241663-1 almanah,evolution-common 3.6.0 Dependencies: 3.12.9~git20141130.241663-1 – dconf-gsettings-backend (16 (null)) gsettings-backend (0 […]

21.08.2015

UNTESTED! backup.sh #!/bin/bash PROJECT=domain.com DBUSR=UserNameThatIsAllowedToUseMYSQLDUMP DBNAME=NameOfDatabaseOfProject echo "========= backup database – you will have to provide the password manually" mysqldump -u "$DBUSR" -p "$DBNAME" > /var/www/vhosts/"$PROJECT"/httpdocs/"$DBNAME".sql gzip /var/www/vhosts/"$PROJECT"/httpdocs/"$DBNAME".sql; echo "============== backing up "$PROJECT tar fcvvvz /var/www/vhosts/"$PROJECT"/backups/"$PROJECT"_files_backup_$(date +%Y-%m-%d-%M).tar.gz /var/www/vhosts/"$PROJECT"/httpdocs # remove […]

12.06.2015

this kind of content-search might take a while, because it searches EVERY file. # qnap (busybox) tested/approved su; # become root cd /; # go to root directory # start search in all files find . -type f | xargs […]