Category: Bash / Terminal / Scripts

16.05.2017

Mac OS X Using Homebrew (yes, I am opinionated) you can install the following tools with the following packages: brew install proctools # to install pgrep, pkill, etc. brew install pstree # to be able to use pstree brew install […]

16.05.2017

CentOS7 yum install psmisc # install pstree [root@centos user]# pstree systemd─┬─NetworkManager─┬─dhclient         │                └─2*[{NetworkManager}]         ├─agetty         ├─auditd───{auditd}         ├─chronyd   […]

14.05.2017

ps -eo size,pid,user,command –sort -size | awk ‚{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }’| head -10    1243.09 Mb /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –plugin-dir=/usr/lib/mysql/plugin –user=mysql […]

05.05.2017

fallocate -l 1G 1GBybe.testfile; # with fallocate dd if=/dev/urandom of=1GBybe.testfile bs=64M count=16 iflag=fullblock; # generate 1GByte test file that contains random data https://www.cyberciti.biz/faq/howto-create-lage-files-with-dd-command/ https://superuser.com/questions/470949/how-do-i-create-a-1gb-random-file-in-linux

03.05.2017

tested and works accross the following systems: uname -a Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) i686 GNU/Linux uname -a Linux centos 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux uname -a Linux suse […]

03.05.2017

setterm -blength 0; # turns off nerve wrecking "BELL" echo ’setterm -blength 0; # turns off nerve wrecking "BELL"‘ >> /etc/bash.bashrc; # make the changes permanent/survive boot and for all users this does not work for X11 terminals such as […]

26.04.2017

based on preparation of: dwaves.de/2017/04/26/linux-bash-searching-and-colorful-highlighting-of-text-patterns-in-files-with-grep-regular-expressions/ wc -w; # basically starting wc in "interactive" mode, quit with Ctrg+Z joe is very hungry today 5 wc -w < termine; # word count, count the words in that file 10 cat artikel.txt termine […]

26.04.2017

probably the most useless of all command combinations… but for whatever reason… like you don’t have an editor that can only write but not read files: it will just keep overwriting the file… cat << EOF > editor_for_poor.txt; # starts […]

Linux Bash searching and colorful highlighting of text patterns in files with grep regular expressions
26.04.2017

Sorry! article has moved to: http://dwaves.de/2015/06/12/linux-bash-find-search-file-content-text-string-output-file-list-iterate-over-file-list-colorful-mark-search-term-lines/ the system appologizes for your inconveniance and the waste of electricity, bandwith and (cpu but also brain) time… if you have the evil javascript enabled… you will be redirected immediately. otherwise please click the […]

linux vi search replace within line number range command history credits
25.04.2017

vi testfile.txt; # open some file with this content Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test Test,Test,Test,Test,Test,Test,Test,Test,Test,Test,Test i :1,5s/T/t/g # 1 = start at line 1 # 5 = stop at line 5 # s = search […]

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 /scripts/un7zip.sh; # create a new bash script file # insert this: #!/bin/bash cd $1; for arc in *.7z do    7z x -y "$arc" done :wq # write and quit vim […]

10.02.2017

„autobench – Automates the benchmarking of web servers using httperf. autobench is used to to automate web server benchmarking. It runs httperf against the specified host or hosts, ramping up the number of requested connections, and logging the results in […]

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 ./————— – […]