This file contains hidden or 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
# ~/.zshrc | |
#################################### | |
umask 077 | |
export ZSH=/usr/share/oh-my-zsh | |
ZDOTDIR=${ZDOTDIR:-${HOME}} | |
HISTFILE=~/.zsh_history | |
HISTSIZE=10000 | |
SAVEHIST=200000 | |
export TERM="xterm-256color" |
This file contains hidden or 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
-- default keybinding: b | |
-- add the following to your input.conf to change the default keybinding: | |
-- keyname script_binding auto_load_subs | |
local utils = require 'mp.utils' | |
function display_error() | |
mp.msg.warn("Subtitle download failed: ") | |
mp.osd_message("Subtitle download failed") | |
end |
This file contains hidden or 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 | |
mpv --ytdl https://www.youtube.com/watch\?v\=514ktGaf3Kk |
This file contains hidden or 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
# GRUB boot loader configuration | |
GRUB_DEFAULT=0 | |
GRUB_TIMEOUT=5 | |
GRUB_DISTRIBUTOR='ArcoLinux' | |
GRUB_CMDLINE_LINUX_DEFAULT="amd_iommu=on iommu=pt ipv6.disable=1 amdgpu.si_support=1 radeon.si_support=0 amdgpu.cik_support=1 radeon.cik_support=0 amdgpu.dc=1 amdgpu.lockup_timeout=6000 amdgpu.audio=1 sysrq_always_enabled=1 nosplash noquiet resume=UUID=b8416339-9f43-49f8-9b54-9cd653957b13" | |
GRUB_CMDLINE_LINUX="" | |
# Preload both GPT and MBR modules so that they are not missed | |
GRUB_PRELOAD_MODULES="part_gpt part_msdos" |
This file contains hidden or 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 | |
sudo ufw reset | |
sudo iptables -F | |
sudo iptables -X | |
sudo ufw default deny incoming | |
sudo ufw default deny outgoing | |
sudo ufw allow out on tun0 from any to any | |
sudo ufw allow out on enp3s0 to 192.168.1.0/24 | |
sudo ufw allow in on enp3s0 from 192.168.1.0/24 | |
sudo ufw allow out on enp3s0 to 10.0.0.0/8 |
This file contains hidden or 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
from selenium import webdriver | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
def setup_phantom_browser(): | |
user_agent = ( | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36") | |
dcap = dict(DesiredCapabilities.PHANTOMJS) | |
dcap["phantomjs.page.settings.userAgent"] = user_agent | |
browser = webdriver.PhantomJS(executable_path='/usr/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs', |
This file contains hidden or 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 | |
#GPG=gpg | |
# or | |
GPG=gpg2 | |
# Create test keys in `original_gnupg_test_home` folder | |
mkdir original_gnupg_test_home 2>/dev/null | |
cd original_gnupg_test_home |
This file contains hidden or 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
+--------------------------------------------------------------------+ | |
| | | |
| SELECT * | | |
| FROM A | | |
| [INNER] JOIN B ON A."FOO" = B."BAR" [AND ...]; | | |
| | | |
+--------------------------------------------------------------------+ | |
| | | |
| SELECT * | | |
| FROM A | |
This file contains hidden or 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
# Simple | |
git filter-branch --prune-empty --subdirectory-filter foobar/ --tag-name-filter cat -- --all | |
# Complex | |
# (Ref.: http://stackoverflow.com/a/17867910/11895, | |
# http://stackoverflow.com/a/19957874/11895) | |
git filter-branch -f --prune-empty --index-filter \ | |
'git rm --cached --ignore-unmatch -r -q -- . ; \ | |
git reset -q $GIT_COMMIT -- .gitignore README.md foo/ bar/' \ | |
-- --all |
This file contains hidden or 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
# Install Arch Linux with full encrypted btrfs subvolume inside luks | |
# filename: install-arch-linux-on-btrfs-subvolume-inside-luks.txt | |
# The official guide: https://wiki.archlinux.org/index.php/Installation_Guide | |
# Download the archiso image from https://www.archlinux.org/download/ | |
# Copy to a usb-drive | |
dd bs=16M if=archlinux.img of=/dev/sdX status=progress && sync # on linux | |
# Boot from the usb. | |
# Set spanish keymap |
NewerOlder