Skip to content

Instantly share code, notes, and snippets.

# ~/.zshrc
####################################
umask 077
export ZSH=/usr/share/oh-my-zsh
ZDOTDIR=${ZDOTDIR:-${HOME}}
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=200000
export TERM="xterm-256color"
-- 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
#!/bin/bash
mpv --ytdl https://www.youtube.com/watch\?v\=514ktGaf3Kk
# 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"
#!/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
@0rbadvent
0rbadvent / capture.py
Created July 17, 2018 05:47 — forked from scuerda/capture.py
Capture full screen image of webpage
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',
#!/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
+--------------------------------------------------------------------+
| |
| SELECT * |
| FROM A |
| [INNER] JOIN B ON A."FOO" = B."BAR" [AND ...]; |
| |
+--------------------------------------------------------------------+
| |
| SELECT * |
| FROM A |
@0rbadvent
0rbadvent / create-git-repo-from-subdirectory.sh
Created July 9, 2018 02:02 — forked from exalted/create-git-repo-from-subdirectory.sh
Given a subdirectory extract separate repo out of an existing one
# 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
@0rbadvent
0rbadvent / install-arch-linux-on-btrfs-subvolume-inside-luks
Created May 31, 2018 01:04 — forked from ansulev/install-arch-linux-on-btrfs-subvolume-inside-luks
Install Arch Linux with full encrypted btrfs subvolume inside luks
# 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