Setting up timezone in FreeBSD

This one is fairly simple. All of thee zone info files are located in /usr/share/zoneinfo/, divided by region. I’m in Croatia so setting up time to be the same as in Zagreb is done by sym-linking appropriate zone file to /etc/localtime: ln -sf /usr/share/zoneinfo/Europe/Zagreb /etc/localtime As I use jails on FreeBSD, to avoid setting this up on every single jail, I have flavor within ezjail defined which has default settings that I usually have on all jails....

June 25, 2017 · 1 min · Ivan Tomica

Using Ansible with FreeBSD

Using Ansible with FreeBSD as a managed node might not be straight forward as using some Linux distribution as, by default, FreeBSD doesn’t have Python interpreter installed which is needed for remote command execution in Ansible. To bootstrap the FreeBSD host you first need to install python and needed dependencies with raw module: ansible YOURHOST -m raw -a "pkg install -y python py27-simplejson" This will provide you with Python interpreter, but since it is installed from package/ports it will be installed in /usr/local/bin/python while Ansible expects it to be in /usr/bin/python....

June 20, 2017 · 1 min · Ivan Tomica

GNU Screen tips – Managing regions

Although I use tmux primarily for my “multiplexing needs” I hop into screen from time to time as well. Below are few tips for managing regions inside of GNU screen. Your basic screen window probably looks somewhat like: Ignoring hardstatus settings you basically have one session and one window inside of that session. To split that window in half by vertical axis you can use following combination: Ctrl+a | You should now get something like:...

June 15, 2017 · 2 min · Ivan Tomica

Installing OTP for pass (password-store) on OpenSUSE

I’ve been using password-store utility for saving my passwords in GPG encrypted files. Since I’m also using 2 factor authentication I’ve opted in to use pass-otp as a convenience. As this extension is not in the official OpenSUSE repositories you will need to install it manually. If you’re reading this I guess you already have password-store program installed. If so, you can proceed installing pass-otp extension right away. To do that, use:...

June 7, 2017 · 1 min · Ivan Tomica

Using KDE Wallet Manager and kwallet-query

I’ve been using mutt for reading my emails for some time now. It is simple, fast, configurable, and yeah, did I mentioned it is a command line email client? Anyhow, only thing I have been fighting with was on how to securely store password without putting it to .muttrc file (which is plain text file). When I used to use GNOME I have used Seahorse while on the command line I’ve used secret-tool for fetching the password....

June 4, 2017 · 2 min · Ivan Tomica

Install SVN PHP module from PECL on EasyApache 4

Basically, something is broken while attempting to install SVN module for PHP via “Modules installer” option. To manually install extension follow these steps: Download the SVN PECL package: wget pecl.php.net/get/svn-1.0.3.tgz Extract the package: tar xzf svn-1.0.3.tgz Run phpize for appropriate PHP version: /opt/cpanel/ea-php56/root/usr/bin/phpize Configure with appropriate PHP configuration: ./configure –with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config Edit the Makefile to add following CFLAGS: CFLAGS = -g -O2 -std=c99 Compile and install extension: make make install Create configuration for SVN extension: vi /opt/cpanel/ea-php56/root/etc/php....

May 23, 2017 · 1 min · Ivan Tomica

SSH configuration

This should be a short article mentioning few options I generally change in sshd_config and recommend that you change them too. Change port number I usually change port number to something random to avoid millions upon millions of failed SSH connection generated by various bots on the interwebz in my server logs: Port 10102 Turn off password authentication PermitRootLogin without-password PasswordAuthentication no What additional tweaks do you make to your sshd_config file in order to secure SSH?...

May 3, 2017 · 1 min · Ivan Tomica

How to enlarge (resize) partition and expand LVM pool on top of it

Day or two ago I encountered a customer that had their server partitioned in a way that there was around 250GB of non-allocated space on disk. There were two partitions (sda1 and sda2) that were set up as /boot and LVM pool containing / mount point respectively. Naturally I’ve replicated that setup locally and simulated how to expand partition and LVM pool on top of it. All without loosing and data OFC....

April 28, 2017 · 2 min · Ivan Tomica

Disable screen rotation button on Fedora Workstation

Annoyed by that auto-rotation icon on your Fedora desktop when using GNOME? See that area painted red? To disable that icon on your laptop you need to disable iio-sensor-proxy.service: sudo systemctl stop iio-sensor-proxy.service sudo systemctl mask iio-sensor-proxy.service

April 21, 2017 · 1 min · Ivan Tomica

Enable GeoIP on PHP 7.0 on FreeBSD

Since pecl extension is compiled against PHP 5.6 in official FreeBSD repositories you’ll need to manually compile this PECL extension to have it included in PHP 7.0. Luckily for you process is really simple. Install autoconf so PHP can detect variables: pkg install autoconf Download latest PECL extension version from PHP’s website: fetch https://pecl.php.net/get/geoip-1.1.1.tgz Extract and configure it: tar -xzvf geoip-1.1.1.tgz cd geoip-1.1.1/ ./configure Finally, compile and install: make make install To have it loaded by your PHP-FPM (assuming you’re using it) include it in your php....

April 5, 2017 · 1 min · Ivan Tomica