bash

Use a variable counter in a bash one-liner

Posted on

I had 70 different domain names that I need to add in a ssl cnf file for creating a certificate request. The 70 different domain names was in a text file, one per line: domainname1.something.com domainname2.somehing.com … In order to create the alternative names list, I used this bash oneliner: teller=1; for i in cat […]

zsh

Pimp my shell!

Posted on

Got a tip from my colleague JB! Want to refresh your terminal? Is it spring and time to freshen things up? Look at: http://ohmyz.sh/ Easy to install on Redhat: yum -y install zsh sh -c “$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)” Result in my Putty in Windows 7:

Linux

Clear the cache on Redhat 5/6/7

Posted on

On Redhat 5 and 6 we could empty the ldap cache with this command: nscd -i group and nscd -i netgroup But in Redhat 7 this doesn’t work. Instead one have to run this command: sss_cache -E here is more about sss_cache from Redhat: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sssd-cache

bash

Cron every last Friday of month

Posted on

We wanted to run a script every last Friday of the month. The script was set to remind people about certain issues. Friday is a nice day to be reminded of things, right? Anyway, by putting this in the /etc/crontab file, one can achieve the request: 59 11 * * 5 username [ $(date +”\%m”) […]

bash

Downgrade to previous version: yum

Posted on

Sometime yum update just breaks everything. We experienced this, and had to go backup to previous versions. In RHEL6 and RHEL7 you can run this command:

which will give you a list of transactions ID’s. Now you just need to figure out how far you want to go back in the history, and do […]

Virtual server

Missing

Posted on

I had a Ubuntu version 16 running in a virtualbox, and wanted copy text from host to the virtual machine. But it didn’t work. It turns out you need to install the Guest Additions CD image. There is an option from the Devices -> Insert guest additions CD image, but I got then this error […]

Wordpress

Changing your theme

Posted on

Sometimes you just want to make smaller changes to your theme, it might be a logo that should be different, or a background color. Some themes doesn’t allow you to do this under Appearance – Customize, only in their PRO version. You could do it by altering the themes files, but if you are runnuing […]