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
VERSION=1.21.12 | |
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
## 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
## bash: keep longer history | |
sed -i 's/^HISTSIZE=1000$/HISTSIZE=10000/' ~/.bashrc | |
sed -i 's/^HISTFILESIZE=2000$/HISTFILESIZE=20000/' ~/.bashrc | |
## Enable search through history with PgUp/PgDn | |
cat > ~/.inputrc << 'EOF' | |
$include /etc/inputrc | |
# alternate mappings for "page up" and "page down" to search the history | |
"\e[5~": history-search-backward |
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
sudo apt install libsecret-1-dev | |
dest_bin="$HOME/bin/git-credential-libsecret" | |
# Compile git-credential-libsecret | |
cd "$(mktemp -d)" | |
cp /usr/share/doc/git/contrib/credential/libsecret/* . | |
make | |
# Install git-credential-libsecret |
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 | |
# This script installs libraries needed to run Savage XR on Ubuntu 18.04 Desktop x86_64 | |
# NOTE: To run Savage XR successfully you also need to do the following | |
# | |
# Run the script to install the required libraries: | |
# wget https://gist.githubusercontent.com/giner/deda63984b3e45cced7af1d3dcd792ea/raw/install_libs_for_savage-xr.sh | |
# chmod +x ./install_libs_for_savage-xr.sh | |
# sudo ./install_libs_for_savage-xr.sh |
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
# Call an arbitrary function from a shared C library | |
# | |
# Usage example: | |
# require './extlib' | |
# | |
# ExtLib.init('libc.so.6', 'char* gnu_get_libc_version()'); | |
# puts ExtLib.gnu_get_libc_version() | |
# | |
# OUTPUT: 2.27 |
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
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 |
OlderNewer