Skip to content

Instantly share code, notes, and snippets.

Phi|eas |ebada norpol

  • Berlin, Germany
Block or report user

Report or block norpol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@norpol
norpol / camerastream.py
Created Sep 26, 2018 — forked from snim2/camerastream.py
Display the output of a webcam using Python and Pygame
View camerastream.py
import pygame
import pygame.camera
from pygame.locals import *
DEVICE = '/dev/video0'
SIZE = (640, 480)
FILENAME = 'capture.png'
def camstream():
pygame.init()
@norpol
norpol / debug_requests.py
Created Aug 21, 2018 — forked from Daenyth/debug_requests.py
Enable debug logging for python requests
View debug_requests.py
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 / zsh-chpwd-store-pwd-plugin.zsh
Last active Jun 14, 2018
Share current pwd across multiple shells
View zsh-chpwd-store-pwd-plugin.zsh
# 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 / pyhelp.sh
Created May 22, 2018
Easy snippet to print a python help-page
View pyhelp.sh
#!/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)"
View gist:d35fe2079e7b86a2cdb32583659af898
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 / LICENSE
Last active Apr 6, 2018
openssh via. tor on debian
View LICENSE
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:
@norpol
norpol / firefox-temp
Created Apr 4, 2018
Launches a temprorary firefox session
View firefox-temp
#!/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 / README.md
Created Mar 17, 2018
ASCII Art thread
View README.md

ASCII ART TIME

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

Please no porn.

@norpol
norpol / README.md
Last active Aug 31, 2018
Debbuging Linux Kernel Crash
View README.md

Debugging Linux Kernel Crash

Error description:

Almost everytime I'm uploading a bigger file (65MB in this case) via. my browser (Firefox, build provided by mozilla.org as .tar.gz), my system crashes. Issue especially happens when I'm doing different things at the same time. (Watching a video, reading email + uploading a file). System is using an SSD, bug also appears if the file is served from /tmp, though.

-,- -,-
OS Debian Testing (Release Buster / 10)
Kernel Linux 4.14.0-3-amd64 #1 SMP Debian 4.14.17-1 (2018-02-14) x86_64 GNU/Linux, Linux 4.18.5-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 24 12:48:58 UTC 2018 x86_64 GNU/Linux
@norpol
norpol / clip_do
Last active Feb 3, 2018
Common clipboard helpers
View clip_do
#!/bin/sh -eu
param="${1:-help}"
# this 'implements' a echo "${param}" | head -1
# in order to avoid passing a multiline string to:
# - command -V -- "${param}"
# - eval "${param}"
# leading in possible executing of ${param}
param="${param%%
*}"
current="$(xclip -o -sel clip)"
You can’t perform that action at this time.