Bash script template

Thu 20 April 2017 by admin

Writing bash scripts is a daily basis for sysops/devops teams. Some parts of each written script stay the same like being verbose for easy debugging, so it's good to have some templates. One of them helps us to deal with logs, which are written to log file and when something goes wrong also the failed step is written to standard output i.e. could be easily catch up with cron to send email alert. https://gist.github.com/witalisoft/80da279e061c96d1e09dd3bd4e6fb907


Videos Worth Sharing

Fri 09 December 2016 by admin

Videos is one of the easiest way to develop my skills. On the web there is a lot of news collectors, but I couldn't find a comprehensive list of videos in selected areas. So why not start a list of videos worth sharing...

https://github.com/witalisoft/videosworhsharing

read more

Doing Ops with human principles

Sat 25 June 2016 by admin

Really good manifest of human centric Ops:

http://www.humanops.com/

read more

Misc Tips

Sat 25 June 2016 by admin

Tips from different categories:

  • how to get mount point from current working directory
# while true; do findmnt . && break; cd ../;  done
  • get all exit codes from pipeline
# true | false |true
# echo ${PIPESTATUS[*]}
1 0 1
  • get list of packages to upgrade
# apt-show-versions -u
  • get reverse package dependencies (installed)
# apt-cache rdepends --installed ...
read more

Command buffering control

Thu 31 December 2015 by admin

Debugging output from hping3 using grep via pipes doesn't show any result. It's because hping3 output is buffered, to make things working as you expect use tool called stdbuf from coreutils package in ubuntu and:

# stdbuf -oL hping3 -S -p 80 blog.witalis.net | grep <lookfor>

it means ...

read more

Distributed Docker Stats

Mon 21 December 2015 by admin

Initial commit for project that helps to make: docker stats command more distributed:

https://github.com/witalisoft/dds

read more

Journald - log rate limiting

Tue 03 November 2015 by admin

It seems to be an easy task, make available logging from haproxy to syslog. Configuration on haproxy side was pretty easy, log file start growing, but from time to time there were some pauses. Rsyslog was the first victim, I dig into limiting configuration area, but default limits doesn't ...

read more

InfoMarquee

Sat 10 October 2015 by admin

After one year break I'm back. This time with new ideas more concentrating on dev side of sysadmin. The first new project called infomarquee published on github. Project brings user defined alerts in TV news station style. First iteration consist of two headlines with user defined alerts with duration ...

read more

How domains are being resolved ?

Thu 23 October 2014 by admin

Not so far ago I was doing some cleanup work with static entries in /etc/hosts. I was wondering how many of these static entries are being actively used. To figure out I started digging, but without much luck. Tools like strace, ltrace doesnt give me a clear look which ...

read more

How safely change ip address on remote host ?

Sun 05 October 2014 by admin

Routine task change ip address on remote host without cut off. There are a lot of possibilites i.e. from reboot with new ip address to some fancy stuff with cron job. But there is a one method to make it clear and elegant.

Simply set:

echo 1 > /proc/sys ...
read more