Hide other users processes on Linux

By default proc is mounted in a way that allows inspection of other users processes by any account on the system. This can be a security risk if attacker gets hold of one of the accounts on the machine as it can freely inspect processes and gather information that it perhaps shouldn’t have. In order to restrict access we can add hidepid mount option to /etc/fstab: proc /proc proc defaults,hidepid=2 0 0 To re-mount current /proc you can use:...

April 22, 2018 · 1 min · Ivan Tomica

Using File Descriptors to calculate progress in Linux

ProcFS in Linux has many useful information about process and its status. In this particular case I’ll show you how to determine progress while copying the file with cp. Same principle can be used for many other situations as well; like importing MySQL dump or whatever you comes up on your mind :-) So in this situation I am copying the ~98GB file to another directory: cp -a /input/archive.tar.gz /output/ First, let’s find PID of this process....

April 21, 2018 · 2 min · Ivan Tomica

Synergy 2 on Ubuntu Linux

Ever since Symless (company behind Synergy product) has published “cloud based Synergy 2 service” I had nothing but problems and headaches with it. The major issue that I have had was that it simply wouldn’t pass the mouse/keyboard control to other configured screen. THIS IS THE SOLE PURPOSE FOR THIS PIECE OF SOFTWARE BTW!. Anyhow, after I stopped whining and decided to look into issue I’ve found that bot laptop and desktop were “Unable to open display :0:0”....

February 10, 2018 · 1 min · Ivan Tomica

Vim Cheatsheet

Some of the shortcuts I find useful in Vim, but sometimes I fail to remember some of them :-) Navigation gj and gk - move down and up by virtual lines gg - beginning of the file G - end of file 25G - 25th line w - beginning of the next word W - beginning of the next word, delimited by space e - end of the word b - beginning of the word B - beginning of the word, delimited by space % - matching parentheses 0 - beginning of the line (^ also works) $ - end of line Insertion...

February 4, 2018 · 1 min · Ivan Tomica

Replacing a broken drive on FreeBSD ZFS

These days, one of the drives on one of my machines started developing bad habits of reallocating blocks which is an early sign that drive might go bad. To prevent such misfortune I decided to replace it with a new one. Once the old drive was yanked out and new one was put into the machine (there are other ways, but I was forced to do it this way) it was only left to partition the new drive and add it to appropriate places....

December 19, 2017 · 4 min · Ivan Tomica

Moving /home to another ZFS dataset

When I set up ZFS on my main rig I was kind of doing it “fast as possible” and haven’t paid attention to much details. Recently, I wanted to customize my setup a bit so here’s how I migrated my /home to another ZFS dataset. Setup was as follows: There is ZFS pool called storage composed of two mirrored vdevs One vdev is 2x2TB drives while the other one is 2TB drive and 1,5TB drive....

November 20, 2017 · 2 min · Ivan Tomica

Installing Mastodon on FreeBSD

Here’s the link to the excellent guide on how to install Mastodon instance on FreeBSD. If you’re doing it in FreeBSD Jail you may find use for “Installing PostgreSQL in FreeBSD jail” article.

October 9, 2017 · 1 min · Ivan Tomica

Fix delete key in CSH or TCSH

CSH is the default shell for root user on FreeBSD system. Basic usage is pretty much the same as any other shell like bash, zsh, fish or whatever. Until you try to execute some bash specific for loops, or attempt to use Delete key. Whaaaat? - Yes, apparently delete doesn’t give the correct character in csh and just prints ~. I don’t know if that’s xterm (or xterm compatible) terminal thing or just a csh thing but it doesn’t matter....

October 6, 2017 · 1 min · Ivan Tomica

GNOME Shell freezes on log out

So I’ve been battling with this issue for quite some time now. Every time I try to log out of Gnome Shell it simply freezes for anywhere between 10 and 30 seconds or so. This has been grinding my gears and finally I’ve stumbled upon this reddit post. And you know what? Turns out they are right! Removing Caffeine extension immediately resolves this issue.

September 29, 2017 · 1 min · Ivan Tomica

Installing POP!_OS GTK theme on Fedora

Install sassc which is a dependency for building assets: sudo dnf install sassc Clone GIT repository: git clone https://github.com/system76/pop-gtk-theme.git Switch directory and build the themes: cd pop-gtk-theme make make assets Finally, install the themes: sudo make install You need root privileges for that as themes get installed to /usr/share/themes directory.

September 1, 2017 · 1 min · Ivan Tomica