This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# NOTE: This change won't persist if package xkb-data is reinstaled or updated | |
sudo sed -i '/key <I208>/s/\bXF86AudioPlay\b/XF86AudioMicMute/' /usr/share/X11/xkb/symbols/inet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to test | |
// | |
// Update uriPrefix, keystoreFile, keystorePassword, truststoreFile, truststorePassword with your values and run: | |
// curl -L -O https://repo1.maven.org/maven2/io/github/openfeign/feign-core/11.6/feign-core-11.6.jar | |
// java -cp feign-core-11.6.jar HelloFeignmTLS.java | |
// Feign | |
import feign.Feign; | |
import feign.RequestLine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Notes: | |
# - option javax.net.ssl.trustStore replaces default java truststore | |
# i.e. TLS connections other than mTLS won't be possible unless | |
# the new truststore contains Common CA certificates | |
# - The custom CA certificate from truststore.pkcs12 will be used by | |
# all TLS connections initiated from the app. Make sure you can | |
# fully trust this CA in your specific case. | |
# - Generation of the keystores is not a part of this snippet and can | |
# be easily found on other resources | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S java --source 11 | |
class HelloWorld { | |
public static void main(String[] args) { | |
System.out.println("Hello, World!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// curl -L -O https://repo1.maven.org/maven2/io/github/openfeign/feign-core/11.6/feign-core-11.6.jar | |
// java -cp feign-core-11.6.jar HelloFeign.java | |
import feign.Feign; | |
import feign.RequestLine; | |
public class MyFeignClient { | |
private static final String uriPrefix = "https://github.com"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
def cache(func): | |
def wrapper(*args, **kwargs): | |
if hasattr(func, "cache"): | |
return func.cache | |
func.cache = func(*args, **kwargs) | |
return func.cache | |
return wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# drawio.xml is taken from Draw.io debian package | |
cat > ~/.local/share/mime/packages/drawio.xml << 'EOF' | |
<?xml version="1.0" encoding="utf-8"?> | |
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> | |
<mime-type type="application/vnd.jgraph.mxfile"> | |
<glob pattern="*.drawio"/> | |
<comment>draw.io Diagram</comment> | |
<icon name="x-office-document" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Inspired by https://www.meixler-tech.com/web-browser-based-file-encryption-decryption.html | |
set -eu | |
openssl_enc_opts=() | |
file_no_ext=$(basename "$@" .enc) | |
[[ $# != 1 ]] && { echo "Usage: $(basename $0) FILE_NAME.enc"; exit 1; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible_version="2.9.*" | |
sudo apt-add-repository universe | |
sudo apt install -y python3-pip python3-venv | |
[[ -d "$HOME/bin" ]] || { mkdir "$HOME/bin"; source $HOME/.profile; } | |
python3 -m venv ~/ansible | |
~/ansible/bin/pip3 install wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make ibus-mozc remember the last used mode (e.g. hiragana) and not switch back to Alphabet on restart | |
# See https://github.com/google/mozc/issues/381 | |
cd $(mktemp -d) | |
apt source ibus-mozc | |
cd mozc-*/ | |
patch src/unix/ibus/property_handler.cc << 'EOF' | |
--- src/unix/ibus/property_handler.cc.orig 2020-10-28 17:21:18.000849932 +0900 | |
+++ src/unix/ibus/property_handler.cc 2020-10-28 17:21:34.172696046 +0900 | |
@@ -80,7 +80,7 @@ |
NewerOlder