Java Regex Cheatsheet
Escaping strings in regex replace s.replaceFirst(Pattern.quote("text to replace"), Matcher.quoteReplacement("replacement text"));
Escaping strings in regex replace s.replaceFirst(Pattern.quote("text to replace"), Matcher.quoteReplacement("replacement text"));
# 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
Open port for a given zone sudo firewall-cmd --zone=FedoraServer --add-port=8080/tcp
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....
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
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...
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....
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
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.
This page is compiled from my experiences of researching the bare minimum to make stuff work. Since SELinux is made to be secure, this approach might create security vulnerabilities if you don’t know what you are doing. Resources Introduction to SELinux (GitHub blog) Locate the problem In this example. My nginx installation is unable to access a file called test.txt. This is the journal log: Sep 22 20:01:32 hermes.iix.se audit[23928]: AVC avc: denied { read } for pid=23928 comm="nginx" name="test....