Homebrew - uninstall formula with dependencies

I use brew extensively on MacOS. It’s just as convenient as many Linux package managers. What I don’t like, it leaves dependencies after removal of formula. There’s simple way to clean it up by running one command 1. Uninstall with dependencies brew uninstall FORMULA brew autoremove Info In my case running brew autoremove actually removed few packages I really wanted to have. Check the output carefully! https://stackoverflow.com/questions/7323261/uninstall-remove-a-homebrew-package-including-all-its-dependencies  external link  ↩︎

2021-11-05 · 1 min · timor

How to remove geo-localization/EXIF data from photos

I wanted to share publicly some photos, but I performed them with navigation enabled so they contained accurate localization of my house. I wanted to remove EXIF data GPS tags, my phone type and other irrelevant stuff. Tip There’s a way that requires less effort. Check how to automate this process with pre-commit hooks  external link . TL;DR You will need imagemagick installed (use apt/yum/dnf of whatever you have there):...

2021-03-05 · 1 min · timor
[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 snippet1 that will uninstall package with all dependencies: Recursive pip uninstall for dep in $(pip show python-neutronclient | grep Requires | sed 's/Requires: //g; s/,//g') ; do pip uninstall -y $dep ; done pip uninstall -y python-neutronclient Depending how you installed it, you might need to use sudo....

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 heavy task may cause some Nagios checks to rise below normal levels and bother admin1. 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