Skip to content

Instantly share code, notes, and snippets.

View blueyed's full-sized avatar
💭
❤️ not eating nor abusing animals 🍀

Daniel Hahler blueyed

💭
❤️ not eating nor abusing animals 🍀
View GitHub Profile
@chekunkov
chekunkov / pythonstartup.py
Last active January 19, 2017 00:25
PYTHONSTARTUP file example with custom displayhook
#!/usr/bin/env python
import sys
import pprint
def displayhook_pprint(o):
"""Display hook powered by pprint.
https://www.python.org/dev/peps/pep-0217/
@coderofsalvation
coderofsalvation / export_process
Last active February 22, 2022 15:38
updates an environment variable of a running process
# updates an environment variable of a running process (needs sudo)
# example: sudo export_pid <variable=value> <pid>
export_process(){
script=/tmp/.gdb.$2
echo -e "attach $2\ncall putenv (\"$1\")\ndetach\n" > $script
gdb -q -batch -x $script &>/dev/null
rm $script
}
@tarruda
tarruda / gtk3-pyenv.sh
Created January 9, 2015 06:38
Install pygtk3 in pyenv
#!/bin/bash
# script for pyenv installation of pygtk3 in ubuntu 12.04
# Adapted from https://gist.github.com/mehcode/6172694
system_package_installed() {
if ! dpkg -l | grep -q $1; then
sudo apt-get install $1
fi
}
@brianclements
brianclements / Commit Formatting.md
Last active April 28, 2024 11:35
Angular Commit Format Reference Sheet

Commit Message Format

This specification is inspired by and supersedes the [AngularJS commit message format][commit-message-format].

We have very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history.

Each commit message consists of a header, a body, and a footer.

" quick replace occurences
let g:should_inject_replace_occurences = 0
function! MoveToNext()
if g:should_inject_replace_occurences
call feedkeys("n")
call repeat#set("\<Plug>ReplaceOccurences")
endif
let g:should_inject_replace_occurences = 0
endfunction
@chmouel
chmouel / pan.zsh
Last active June 4, 2017 10:16
PAN: a zsh tool to switch easily with completion the tox virtualenvs and tests (demo: http://i.imgur.com/kJsJTjj.gif)
# Author: Chmouel Bodujnah <chmouel@chmouel.com>
#
# Pan a zsh tool to complete virtualenv tox targets and tests launched via
# testtools
#
# Demo: http://i.imgur.com/kJsJTjj.gif
#
# When you use zsh just source the file directly and when you are inside a
# project which has been pre-built with tox targets you can start do:
# pan <TAB>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import pcap #requires the python-libpcap module
def libpcap_net_data(cap_file, net_iface, filter_expr=None):
"""A decorator that can be used to sniff network data for the duration of a function call
if there is heavy traffic on the network interface the captured data will contain spurious packets
not related to the function call
# bash/zsh git prompt support
# # -*- encoding: utf-8 -*-
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
@bitjockey42
bitjockey42 / mopidy.md
Created April 20, 2014 16:39
An installation and setup guide for mopidy on Arch Linux.

Mopidy on Arch Linux

mopidy

Installation

Install from the AUR.

@soarez
soarez / ca.md
Last active May 3, 2024 00:04
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.