Linux

memx - Get process’ memory usage (Linux)

2024-05-30

I shared a simple piece of code for getting a process’ memory usage in Linux. It’s called memx. It’s Linux-specific only as it reads the proportional set size (PSS) data from either /proc/{pid}/smaps_rollup (if present) or /proc/{pid}/smaps file. I’ve used this piece of code many times at work. We use memory-mapped files extensively in some of our services and this is how we get more accurate results. Very useful in debugging OOMKilled events in k8s.

Golang · Linux · Memory · Process · Tech · Usage

1 minute

Setting alarm from commandline

2021-11-08

This is just a quick one. Although I use Gnome Clocks occassionally, most of the time I set an alarm via the commandline. OS is POP_OS!, using VLC: $ sleep 10m && \ cvlc ~/alarm.mp3 –play-and-exit && \ notify-send 'alarm done'

Alarm · Cmdline · Commandline · Gnome · Linux

1 minute

Connecting to Torguard VPN using Wireguard from Ubuntu

2020-03-25

As of this writing, Torguard’s desktop app still doesn’t support Wireguard out of the box. I’m using Ubuntu 19.10 for testing. If you haven’t installed Wireguard yet, you can refer to the installation instructions here. In my case, it was: $ sudo apt install wireguard Next, you need to login to your Torguard client area, go to Tools –> Enable Wireguard Access. Select a location (in my case, I chose Asia-Singapore2) then click ‘Enable Wireguard’.

Linux · Torguard · Ubuntu · Wireguard

1 minute