[Photo by Paul IJsendoorn from Pexels](https://www.pexels.com/photo/antelope-canyon-33041/)

Moving from Linux to MacOS – first steps

Few years ago I moved from Linux desktop to MacOS for my business, day to day work. There were 2 main reasons for that: Corporations don’t like Linux - they can’t manage it, they can’t support it, so they blocked it with “Security policy”, ISO20001, or other nonsense. Actually they’re partially right but in different place - many business collaboration applications don’t work well on LInux (or they don’t work at all) Skype for Business - there’s open source alternative but to get full support you have to pay for additional codecs (as far as I remember) - it’s not working stable even in paid version Outlook and calendar support - I love Thunderbird and I use it for years, but calendar invitations didn’t work nice (honestly, they didn’t work nice even between different Outlook versions…) Corporate VPN apps - Christ, I always was able to get it working eventually, but… why bother I’m older, maybe lazier, maybe smarter - I don’t like to spend my time resolving problems that don’t give me any value....

2020-01-04 · 8 min · timor

How to stole ssh session when you’re root

It happen to me all the time that one of developers notifies me about some kind of problem that I can’t confirm from my account. Sometimes it was because of bad ssh keys configuration, other times file permissions, mostly such stuff. It’s sometimes convenient to “enter into someone’s shoes” to see what’s going on there. If you’re root on machine you may do that like this: su developer - Easy one but that’s not enough for all cases....

2016-04-27 · 1 min · timor

pip - uninstall package with dependencies

Virtualenvs in python are cheap but from time to time you will install something with pip on your system and when time comes removing all this crap could be difficult. I found this bash snippet that will uninstall package with all dependencies: for dep in $(pip show python-neutronclient | grep Requires | sed 's/Requires: //g; s/,//g') ; do sudo pip uninstall -y $dep ; done pip uninstall -y python-neutronclient Source: http://stackoverflow....

2016-04-26 · 1 min · timor

Use bastion host with Ansible

When you deploy your application in cloud you don’t need and don’t want your hosts exposed via SSH to the world. Malware scans whole network for easy SSH access and when find something will try some brute force attacks, overloading such machines. It’s easier to have one exposed, but secured host, that doesn’t host anything and is used as proxy/gateway to access our infrastructure- it’s called bastion host  external link ....

2016-04-22 · 3 min · timor

List octal file permissions in bash

Sometimes it’s easier to use octal file permissions but they’re not so easy to list. I caught myself few times that I didn’t remember how to list them - so this is a reason for that note. stat -c "%a %n" * 755 bin 755 games 755 include Yes, it’s that easy 😃 And here also with human readable attributes: stat -c '%A %a %n' * drwxr-xr-x 755 bin drwxr-xr-x 755 games drwxr-xr-x 755 include

2016-02-24 · 1 min · timor

Automatically build after file change

I’m playing a lot with Docker lately. Building images, and then rebuilding, and then building again… It’s pretty boring. To automate this task a little I used inotify to build automatically after I changed any file. This trick could be used in many different situations. You will need inotify-tools package: sudo apt-get install -y inotify-tools Then run something like this: while inotifywait -e modify -r .; do docker-compose build; done This commands will rebuild my Docker images after any file change in current directory....

2016-02-23 · 1 min · timor

Install WordPress from command-line

I never tried it before but today I needed to install WordPress… From command line only. And there is a way to do this with wp-cli  external link . WP-CLI installation First some requirements (as root): apt-get install php5-cli php5-mysql mysql-client curl And now installation of wp-cli (as root too): curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar chmod +x wp-cli.phar mv wp-cli.phar /usr/local/bin/wp Check if it’s working: $ wp --version WP-CLI 0.22.0 WordPress installation Now you should switch to user of your web application, ex....

2016-02-15 · 1 min · timor

Nagios - downtime on host/service from command line with curl

Sometimes deployment process or other havy task may cause some Nagios checks to rise below normal levels and bother admin. If this is expected and you want to add downtime on host/service during this task you may use this script: #!/bin/bash function die { echo $1; exit 1; } if [[ $# -eq 0 ]] ; then die "Give hostname and time in minutes as parameter!" fi if [[ $# -eq 1 ]] ; then MINUTES=15 else MINUTES=$2 fi HOST=$1 NAGURL=http://nagios....

2016-01-11 · 2 min · timor

Changing default php.ini file for PHP-CLI on CentOS

On Debian in default installation you have different configuration files for PHP in Apache, FPM, CLI, etc. But on CentOS you have only one php.ini for all of them. In case I have, I need to have different configuration file for scripts running in CLI mode (more memory, etc). I could run it like this: php -c /etc/php-cli.ini script.php But this a little burdensome. So I do it like this:...

2014-05-08 · 1 min · timor

Command to change root password

Everybody knows passwd command but it’s useless when you need to change ex. root password from command line without waiting for input. In such case oneliner below could help: echo "root:new_password" | chpasswd

2014-05-08 · 1 min · timor