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
# Usage: | |
# source lib_y2j.sh | |
# cat some.yml | y2j | |
# cat some.yml | ys2j | |
# y2j some.yml | |
# ys2j some.yml | |
# Reading a single YAML document | |
y2j () { ruby -r yaml -r json -e 'puts JSON.pretty_generate(YAML.load(ARGF))' -- "$@"; } |
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
## VIM: Unbound copy/paste buffer (default is 50 lines or 10 Kbyte) | |
echo "set viminfo='100,h" >> ~/.vimrc | |
## VIM: Increase max tabs limit (useful with `vim -p`, default is 10) | |
echo "set tabpagemax=100" >> ~/.vimrc | |
## VIM: Remember more commands and search patterns in history (default is 50) | |
echo "set history=1000" >> ~/.vimrc | |
## VIM: Highlight trailing witespaces |
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
VERSION=1.21.0 | |
PLATFORM=$(uname -s | tr [:upper:] [:lower:]) # linux / darwin | |
SRC_URL="https://dl.google.com/go/go$VERSION.$PLATFORM-amd64.tar.gz" | |
DST_TGZ="/tmp/go.tgz" | |
# Download | |
if which curl >/dev/null; then curl "$SRC_URL" -o "$DST_TGZ"; else wget "$SRC_URL" -O "$DST_TGZ"; fi | |
# Extract |
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
# 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 @@ |
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
## Move window buttons to the left (mimic Unity) | |
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,maximize,minimize:' | |
## Show date, week day, week number | |
gsettings set org.gnome.desktop.interface clock-show-weekday true | |
gsettings set org.gnome.desktop.calendar show-weekdate true | |
## Assign '<Ctrl><Shift>d' to detach a tab in gnome-terminal | |
GSETTINGS_SCHEMA=org.gnome.Terminal.Legacy.Keybindings | |
GSETTINGS_PATH=/org/gnome/terminal/legacy/keybindings/ |
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 |
NewerOlder