Skip to content

Instantly share code, notes, and snippets.

@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
@0rbadvent
0rbadvent / rpi-arch-linux-to-sdcard.sh
Created April 21, 2018 08:21 — forked from pklaus/rpi-arch-linux-to-sdcard.sh
for the Raspberry Pi 1, Zero, Zero W : Arch Linux ARM to SD Card Script; See https://gist.github.com/pklaus/9dd4a7bf040788cda501 for RPi 2
#!/bin/bash
# <http://archlinuxarm.org/platforms/armv6/raspberry-pi>
echo -e "\n\nArch Linux ARM for Raspberry Pi to SD Card"
echo -e "(Not meant for the Raspberry Pi 2 - "
echo -e " check https://gist.github.com/pklaus/9dd4a7bf040788cda501 instead.)\n\n"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=1
DEVPATH=hwmon0=devices/platform/it87.656
DEVNAME=hwmon0=it8721
FCTEMPS=hwmon0/device/pwm2=hwmon0/device/temp1_input hwmon0/device/pwm3=hwmon0/device/temp2_input
FCFANS=hwmon0/device/pwm2=hwmon0/device/fan1_input hwmon0/device/pwm3=hwmon0/device/fan2_input
MINTEMP=hwmon0/device/pwm2=40 hwmon0/device/pwm3=40
MAXTEMP=hwmon0/device/pwm2=100 hwmon0/device/pwm3=85
MINSTART=hwmon0/device/pwm2=81 hwmon0/device/pwm3=100
MINSTOP=hwmon0/device/pwm2=80 hwmon0/device/pwm3=90
@0rbadvent
0rbadvent / Grub_Powerup.md
Created April 3, 2018 16:13 — forked from L2Gui/Grub_Powerup.md
Grub Init Tune: Mario Bros. Mushroom Powerup

Grub Init Tune - Mario Bros. Mushroom Powerup

This Grub Init Tune will make your computer sound like a Super Mushroom every time you turn it on! This only works for the Grub bootloader - this generally means you need to have Linux (or other Grub-based OS) installed.

Here's the code, which goes in your /etc/default/grub file:

GRUB_INIT_TUNE="1750 523 1 392 1 523 1 659 1 784 1 1047 1 784 1 415 1 523 1 622 1 831 1 622 1 831 1 1046 1 1244 1 1661 1 1244 1 466 1 587 1 698 1 932 1 1195 1 1397 1 1865 1 1397 1"

Installation Instructions

@0rbadvent
0rbadvent / sshd.conf
Created March 22, 2018 11:16 — forked from atErik/sshd.conf
A comparatively stronger & safer & secured sshd_config for SSH Server
# Created by atErik, tErik.
# Copyright 2011-2015 atErik.
# a4t4erik AT out4look dot co4m, a4t4erik0 AT 4gmail dot co4m
# (Remove all prev & above "4").
# Released under GPL (GNU Public License).
#
#
# 1st created & used on 2011.
# Improved and changed, when necessary.
# 1st released to public under GPL on March 6th, 2015.
@0rbadvent
0rbadvent / xorg.conf
Created February 25, 2018 21:56 — forked from tpruvot/xorg.conf
Fake plugged monitor to allow coolbits on maxwell and pascal cards
# To allow nvidia powermizer settings, we need to define dummy monitors for each card
# Edit the PCI BusId for each cards (lspci | grep VGA)
# Also, you need to dump an EDID file from your monitor
# Here is my dell.edid (2560x1440)
# it's stored in text, hexdump -C format, not binary:
# 00 ff ff ff ff ff ff 00 10 ac 7e 40 4c 54 41 41
# 15 17 01 03 80 3c 22 78 ea 4b b5 a7 56 4b a3 25
# 0a 50 54 a5 4b 00 81 00 b3 00 d1 00 71 4f a9 40
# 81 80 d1 c0 01 01 56 5e 00 a0 a0 a0 29 50 30 20