Linux command line tools
Few-liners which I’d like to store somewhere
Few-liners which I’d like to store somewhere
How to install a snipping tool with shortcut on Linux
Making this page since I’ve set up too many computers recently and I forget quickly
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....
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....
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....
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....
Issue I recently installed Ubuntu minimal on a new computer, and noticed that sometimes Youtube-videos didn’t work. All “old” videos seemed to work, but newly uploaded videos usually claimed that my browser did not support HTML5. Basically, I could have a video in one tab which did work flawlessly, and a video in another tab which claimed I did not have HTML5 support in my browser. The error message was the something like the following:...
Nice things you can do with cURL # Resolve a hostname with a given ip curl http://iix.se --resolve iix.se:80:206.189.18.126 # Run many queries in a loop (either for looping or load testing) curl 'http://localhost:8080/oauth/login?[1-10]' -d '{ "username": "[email protected]", "password": "secret" }' -vvv -H "Content-Type: application/json" # Light load testing an endpoint (Z=parallell, -s/-o removes output, -w sets new output) curl -Z -so /dev/null -w "%{time_total} %{http_code}\n" 'https://acme.system.com/api/endpoint?[1-20]'
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....