Crontab jobs for all US federal holidays

May 7, 2016

Ever wonder how to run crontab jobs for all US federal holidays? Below is how:

1 0 1 1 * /bin/echo “New Year’s Day”
1 0 15,16,17,18,19,20,21 1 1 /bin/echo “Martin Luther King’s Day”
1 0 15,16,17,18,19,20,21 2 1 /bin/echo “President’s Day”
1 0 25,26,27,28,29,30,31 5 1 /bin/echo “Memorial Day”
1 0 4 7 * /bin/echo “Independance Day”
1 0 1,2,3,4,5,6,7 9 1 /bin/echo “Labor Day”
1 0 8,9,10,11,12,13,14 10 1 /bin/echo “Columbus Day”
1 0 11 11 * /bin/echo “Veterans Day”
1 0 22,23,24,25,26,27,28 11 4 /bin/echo “Thanksgiving”
1 0 25 12 * /bin/echo “Christmas”


GoPro HJC FG-17 chin mount

May 2, 2016


How to mute ringer on iPhone

February 22, 2016

Finally Apple started to support their own keyboard the way it suits me, meaning pressing “enter” sends an imessaage/sms. Took them several years.

Anyway, when I was playing with the keyboard I found out when I press “mute”, it mutes the phone completely without pressing the side (mute) switch, but when I tried to do that from the phone, took me about forever to find a way. So below is my way.

I assigned “mute” to my assistive touch (which is under settings/general/accessibility/assistive touch/custom top level menu) and assigned “assistive touch” to my “accessibility shortcut” (which is under settings/geneal/accessbility at the very bottom).

Right now when I press my home button three times, brings “assistive touch” menu and once pressed I’m getting software button which mutes or unmutes my ringer/volume. Pressing the home button three times again, allows me to remove the “assistive touch” software button, so it doesn’t bother me.

Why do I do it that way? Variety of reasons from a broken side mute button to my case, which literally is the case… it is outter box heavy duty, and every time i need to mute the phone have to dig and open the side with my nails or a key, which is a pain and the case becomes loose after a while doing that.

So I hope you like my solution and use it from time to time. I didn’t find anything clear on google, so I wrote it down in order to help to someone like me.

Thank you.


Cisco switch/router time setup to PST/PDT string

May 12, 2014

I am just tired when every time I have to type these two lines below in order to setup the clock on whatever switch/router I have to. So just copy and paste in config mode and you are done.


clock timezone PST -8
clock summer-time PDT recurring 2 Sun Mar 2:00 1 Sun Nov 2:00


Snorby: Debug the mailing feature and creating cron job

November 4, 2013

Do not run the following commands unless you really need to:

cd /path/to/snorby

bundle exec rails c production
Snorby::Jobs::DailyCacheJob.new(true).perform (this command is invalid for version 2.6.2)

I tried a few things. From the shell of my CentOS 6.4 everything works fine but can’t make it automatically to send me reports, so I didn’t bother to go ahead with the source but just added that simple file (named snorby_report.cron) in /etc/cron.daily:

cd /path/to/snorby
RAILS_ENV=production /usr/bin/rails r ‘Snorby::Jobs::SensorCacheJob.new(true).perform’


Installing Snort on CentOS 6.4

November 2, 2013

My guide is simple. Just the commands you need to run. Please, read before copy and paste. It requires clean minimal installation of CentOS 6.4 and Internet connectivity:

yum install wget
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-6-8.noarch.rpm

vi /etc/yum.repo.d/remi.repo



yum install autoconf automake bison flex gcc glibc libdnet libdnet-devel libpcap libpcap-devel make mlocate pcre-devel rpm-build zlib zlib zlib-devel

wget snort and daq source rpms from snort.org

rpmbuild –rebuild daq-2.0.1-1.src.rpm
yum localinstall rpmbuild/RPMS/x86_64/daq-2.0.1-1.x86_64.rpm
rpmbuild –rebuild snort-
yum localinstall rpmbuild/RPMS/x86_64/snort-

yum install mysql-server
chkconfig –add mysqld
chkconfig mysqld on
service mysqld start


checking for all runnung barnyard2 proceesses

November 2, 2013

I am running “snort” with two sensors. Occasionally one of my “barnyard2” processes is dying and if I am not checking the processes on the shell, there is no way I’ll know that. So I wrote a single line perl script and put it in a cron job to be run every five minutes. If there are not two barnyard2 processes running, I’m getting an e-mail. Is that simple.


if(`ps -aef |grep barnyard2 |grep -v grep |wc -l`!=2) {`mail -s BY2DOWN me\@email.edu</dev/null`;};


Of course, the whole procedure could be automated, I mean if the script detects the issue, could restart my init.d script controlling barnyard2 (in my case it controls snortd and barnyard2 at the same time) but wth will I do that… Just login and start the process is enough in my case.

So, just decided to share. Put #!/bin/perl on the top of the line above, make it chmod +x or 755, the cron should be */5 * * * * /full/path/by2.check, or something like that. That line should be enough for beginners if any.