Salt Cheatsheet

# List hosts sudo salt-key --list-all # Add host sudo salt-key -a hello-hostname # Apply one/several hosts sudo salt 'hello-hostname' state.apply sudo salt 'hello-*' state.apply sudo salt 'hello-hostname' test.ping sudo salt '*' state.apply users ## När något gick fel och man missade att lessa loggen sudo salt-run jobs.list_jobs sudo salt-run jobs.lookup_jid $jobid | less

March 5, 2019  |  🏷️Salt

Open port in fedora

Open port for a given zone sudo firewall-cmd --zone=FedoraServer --add-port=8080/tcp

OpenSSL / Certificate management

Working with certificates in Java This post contains a mix of java and certificate info. Note that you should definitely use the p12 format in Java. Using other types, like p8, usually end up causing issues in the end. One easy way is by creating a custom trust manager The easiest way of doing this is: (See this link for a code example on stackoverflow Create a custom trust manager with your special certs Create a trust manager with the default certs Create a custom trust manager, which takes the custom and the default trust manager and try them both Another way of doing it would be adding the certificate manually to the cacerts file....

Docker: Start terminal in Docker without limited size

Sometimes when you exec into a docker container normally, the size of the containers terminal will be much smaller than your real screen, making it not work properly. To solve this you need to set COLUMNS and LINES in the containers env: sudo docker exec -e COLUMNS="$(tput cols)" -e LINES="$(tput lines)" -it docker-container bash

December 14, 2018  |  🏷️Docker

Merging git repositories to a monorepository

BFG-clean repository If you’ve had the bad habit of checking in binary data, this is your chance to clean it up. If so, then run these lines. Tweak the bfg command to your taste. cd git-repo # Optional. Will likely make you able to remove more files. You might want to remove remotes as well. git tag -d $(git tag -l) cd .. java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 5M --delete-files "*.{class, jar, png, svg, ico, zip}" git-repo cd git-repo git reflog expire --expire=now --all && git gc --prune=now --aggressive Move the repository to a subfolder Replace subfolder below with the real subfolder name...

November 8, 2018  |  🏷️Git 🏷️Bfg

Alternatives for a Grand Seiko

The Grand Seiko Snowflake One of my ideal watches to have would look be like a Grand Seiko Snowflake. The sweeping movement of Seiko’s Spring Drive, the snow-esque dial, dauphine hands, and the blued seconds hand look amazing to me. But since it will never be worth it for me to spend 50k SEK on a watch, I will have to find a cheaper alternative. Luckily, there are a lot of quite similar watches available....

Wristwatch and stuff

Accessories Watches I am interested in Maen Hudson ~5k SEK Seiko SARX045 39.5x11.3mm x 48mm 6R15 / 100m WR / Sapphire / 20mm lugs / solid end-links ~5500 SEK Baltic MR01 ~6700 SEK Maen Skymaster 12k SEK Oris Divers Sixty-Five 01 733 7707 4354-07 8 20 18 40mm SW300? / 100 WR / Sapphire / 20mm lugs / solid end-link ~25k SEK MSRP ~17k SEK chrono24 Tag Heuer Carrera Calibre 17 CV2110 - White CV2111 - Black CV2113 - Black Silver Ring ~20-30k SEK chrono24 Tudor Black Bay 58 39mm ~37k SEK MSRP

Firefox on linux with a dark theme has black input fields

If you are using firefox on linux with a dark theme, unstyled input fields will have black background and white text. Sometimes just white text on white background. According to this bug report it has been this way for the last 17 years. To fix it, pop by about:config and add a new key-value (String): "widget.content.gtk-theme-override": "Adwaita:light". After restarting firefox, things will be as they should be.

Allowing access to programs in SELinux through modules

This page just describes how I have found out you can do to make stuff work in SELinux when they don’t. I feel there may be a better way to update SELinux in an organized manner. If you know how, don’t hesitate to send me an email at olle at iix dot se. Anyhow, here is my way of making stuff work at the moment. Locate the problem In this example....

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):...