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
# Use git branch -D to remove branches even if they are not fully merged | |
git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d |
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
def file_exists?(path) | |
capture(:ls, path) | |
true | |
rescue SSHKit::Command::Failed | |
false | |
end | |
def state_page | |
stage = fetch(:stage) | |
parts = stage.to_s.split('_') |
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
def foo(a, *b, **c) | |
[a, b, c] | |
end | |
> foo 10 | |
=> [10, [], {}] | |
> foo 10, 20, 30 | |
=> [10, [20, 30], {}] | |
> foo 10, 20, 30, d: 40, e: 50 | |
=> [10, [20, 30], {:d=>40, :e=>50}] |
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
set username [lindex $argv 0]; | |
set password [lindex $argv 1]; | |
send_user "$username $password" |
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
# Example file is `.env` | |
# Remove the file from the disk | |
# Add the file path to .gitignore | |
echo ".env" >> .gitignore | |
# Permanently remove it from the git history | |
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD | |
# Force push | |
git push --force |
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
### TUNE for indexing vs. searching | |
# Increase index buffer size | |
indices.memory.index_buffer_size: 20% | |
# Index refresh interval | |
# Don't refresh/write so often | |
curl -XPUT 'http://il-prod-es01:9200/_all/_settings?preserve_existing=true' \ | |
-H 'Content-Type: application/json; charset=utf-8' \ | |
-d '{ |
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
# Prevent minimize on loss of focus | |
export $SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 | |
# Prevent random crashes, edit game preferences | |
taskset --cpu-list 0-7 %command% |
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
# NOTE: This will fix zorin-appearance not switching themes after suspend/resume | |
# but it will also kill all the currently running apps. | |
sudo systemctl restart gdm.service |
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
# NOTE: replace enp4s0 with whatever interface you want or use 'all' instead | |
# Temporarily for a single IF | |
echo 2 > /proc/sys/net/ipv6/conf/enp4s0/use_tempaddr | |
# Temporarily for a ALL IFs | |
echo 2 > /proc/sys/net/ipv6/conf/all/use_tempaddr | |
# Permanently | |
# Add net.ipv6.conf.all.use_tempaddr=2 |
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
# ykinfo -s - shows permission problem | |
# in /etc/udev/rules.d/70-u2f.rules | |
# Add... | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0683", MODE="0666" | |
# Reload udev | |
sudo udevadm control --reload-rules && sudo udevadm trigger |