What: A list of not-now useful links
Why: Limited memory 😉
How: –
Tools
Vagrant
Virtual Box
Resizing virtual box disk space, the easy way
GParted live image
Install guest additions in Ubuntu
sudo apt-get install virtualbox-guest-dkms
Java
https://developers.redhat.com/blog/2017/03/14/java-inside-docker/
Ember
https://medium.com/@ruslanzavacky/ember-cli-fingerprinting-and-dynamic-assets-797a298d8dc6
Docker
https://developers.redhat.com/blog/2017/03/14/java-inside-docker/
Sound recording
http://www.upubuntu.com/2013/05/how-to-record-your-voice-from.html
Machine learning
Programming
Ternary numbers
Python 3 program to convert a decimal number to ternary (base 3)
Data
General
Conversion
Linux
Go back to older kernel after update
Add a second hard drive (also working for vms)
Ubuntu not starting to graphical mode, flickering
Hang at boot on old machines
See https://www.youtube.com/watch?v=ZZBTSUbzT0g.
Add acpi=force in /etc/default/grub in line GRUB_CMDLINE_LINUX_DEFAULT and apply settings:
sudo update-grub
Ubuntu
If you would like to use a usb serial connection (for example to connect an ESP32), make sure the linux-modules-extra is installed (which is not the case in default cloud versions of Ubuntu). You can install it via:
sudo apt install linux-modules-extra-$(uname -r)
See also: https://askubuntu.com/a/1129260.
Windows
Links to user folders
1. Copy folder to new location
2.
mklink /J "absolute path to old location" "absolute path to new location"
Show symbolic links
dir /AL /S "folder"
See also: https://superuser.com/a/496155
VCS
Git
Beautiful log
git config alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
Use it like:
git lg --all
Development
Python https server
Creating self-signed SSL certificates with OpenSSL
Serial console
https://www.cyberciti.biz/hardware/5-linux-unix-commands-for-connecting-to-the-serial-console/
Client – Server
Get server certificate
See: https://superuser.com/a/641396.
openssl s_client -showcerts -connect server.edu:443 /dev/null|openssl x509 -outform PEM >mycertfile.pem
Systemd
https://wiki.ubuntuusers.de/Howto/systemd_Service_Unit_Beispiel/
https://www.freedesktop.org/software/systemd/man/systemd.service.html
Activate caching for client side on apache2
Enable apache module:
1 2 | a2enmod headers
sudo systemctl apache2 restart |
Create .htaccess file in the specific directory (adjust max-age to the number of seconds you want the resource to be cached):
<IfModule mod_headers.c>
<FilesMatch "\.(gif|ico|jpeg|jpe|png|css|js)$">
Header set Cache-Control "max-age=86400, public"
</FilesMatch>
</IfModule>
Set different port in apache2
See: https://stackoverflow.com/a/26064554.
Images
Identify image format
1 | identify -format "%wx%h %C" |
For format options see: ImageMagick.
Resize image
1 | convert -resize x\> |
IoT
Raspberry and Ubuntu
Install Ubuntu on Raspberry
https://ubuntu.com/download/raspberry-pi
Getting audio to work over hdmi
Add the following line to /boot/firmware/usercfg.txt and reboot:
1 | dtparam=audio=on |
Increase gpu memory
Add the following line to /boot/firmware/usercfg.txt and reboot:
gpu_mem=128