Linux command line tools

Few-liners which I’d like to store somewhere

May 29, 2022  |  🏷️linux

Locale in Linux

Making this page since I’ve set up too many computers recently and I forget quickly

January 30, 2022  |  🏷️locale

ESXI Over SSH Cheatsheet

Recently, I had to do some stuff on an ESXI-machine from a Linux machine. However the ESXI-version was so old that you needed the vSphere Client to modify it, and I never really got that working. Luckily you can do quite much through ssh. So I thought I’d write down the commands I still remember. ## Write this to get all available commands vim-cmd ## Virtual Machine commands vim-cmd vmsvc ## Show VMs with some stats vim-cmd vmsvc/getallvms ## Show power status of VM vim-cmd vmsvc/power....

March 12, 2021  |  🏷️esxi

Connecting to Meraki VPN with Ubuntu 20.04

I had some issues getting the Meraki VPN to work with Ubuntu, which uses L2TP over IPsec. There is an official guide, but it just says that it doesn’t work properly with xl2tp. I figured I might a well document how I got it working. Install L2TP Wasn’t installed on my computer, so probably the same for yours. If you don’t run gnome, you can remove the -gnome at the end....

July 31, 2020  |  🏷️vpn

Configuring swap for dummies

A cheatsheet for modifying swap on a linux machine Cheatsheet # See attached swaps sudo swapon --show # Create/Attach/Resize swap sudo swapoff /swap.img sudo fallocate -l 8G /swap.img sudo chmod 600 /swap.img sudo mkswap /swap.img sudo swapon /swap.img # Quick and dirty add swap to fstab echo '/swap.img none swap sw 0 0' | sudo tee -a /etc/fstab Swappiness # See swappiness cat /proc/sys/vm/swappiness # Set swappiness=1 sudo sysctl vm.swappiness=1 # Before you tee, you should grep for it instead....

The quest for high quality sound on a Lenovo Yoga C940

Introduction I recently bought a new laptop, a Lenovo C940, and installed Ubuntu 20.04 on it. Everything works grand on it, except for the audio. When using Windows, the sound quality was great, however when in Linux, the sound is really tinny and can be harsh to listen to. It doesn’t matter if I use the speakers or the headphone-jack, both sound the same. The strange thing is that when I connect my bluetooth headphones (and use bluetooth A2DP), the sound is absolutely perfect....

Turn off caps-lock without the key

I usually don’t have a keyboard key mapped to caps, since I have my caps mapped to escape instead. However, from time to time it still gets activated. So to save me googling-time, this is the easiest way to turn it off: Alternative 1 xmodmap -e "clear Lock" Alternative 2 #! /usr/bin/env python from ctypes import * import subprocess class Display(Structure): """ opaque struct """ X11 = cdll.LoadLibrary("libX11.so.6") X11.XOpenDisplay.restype = POINTER(Display) display = X11....

Audio sounds crap on bluetooth headphones on Linux

So maybe sounds like crap is an overstatement, but compared to what it sounds like on windows / macos / my phone it’s not even a comparison. Apparently this is is caused by the pulseaudio-profile being set wrong. You can check available profiles by connecting to the bluetooth headphones and running pacmd list: profiles: headset_head_unit: Headset Head Unit (HSP/HFP) (priority 20, available: unknown) a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 10, available: no) off: Off (priority 0, available: yes) When trying to set the profile, pacmd will refused (related to the available: no):...

Configure static eth0 in /etc/network/interfaces

Description: The first step is to establish basic network connectivity for your router/gateway. This will allow you to connect to the installation server on the distribution network, from which you can install the routing software needed in later steps. Your router needs three network interfaces: the loopback interface (lo; which is used for network connections within the gateway) the interface connected to the distribution network (eth1) the interface connected to your network (eth0)....

Configure static wlan0 in /etc/network/interfaces

Get wpa-psk by running wpa_passphrase MyNetwork MyPassphrase. /etc/network/interfaces should be chmod 0600 if you put the wpa-psk there source /etc/network/interfaces.d/* # The loopback network interface auto lo wlan0 iface lo inet loopback iface wlan0 inet dhcp wpa-ssid MyNetwork wpa-psk a2d024861ef90117c47083c9252d1e9c107c7cc6ab938cd08349c9192d444d2f