Skip to content

Instantly share code, notes, and snippets.

View make-github-pseudonymous-again's full-sized avatar

Notas Hellout make-github-pseudonymous-again

  • Joined on Sep 24, 2012
View GitHub Profile
@DavidGriffith
DavidGriffith / eps2svg.sh
Created March 6, 2013 07:35
EPS to SVG vector command line image converter
#!/bin/sh
# eps2svg: EPS to SVG vector command line image converter
# David Griffith <davidgriffith@acm.org>
# Created March 30, 2009 and released into the public domain
# The programs pstoedit and skencil are required.
EXT="svg"
USAGE="usage: eps2svg [-v] input.eps [output.svg]\n -v verbose mode"
@usami
usami / pocket_download.sh
Created March 16, 2013 01:38
Download all entries in your Pocket (http://getpocket.com).
#!/bin/sh
# before running this script, run the following command
# wget --save-cookies cookies.txt --post-data 'feed_id=****ID****&password=****PASS****' http://getpocket.com/login_process/
i=1
while [ $i -le 60 ]
do
wget --load-cookies cookies.txt -p http://getpocket.com/unread/$i
(( i++ ))
@serra
serra / README.md
Last active June 12, 2023 15:35 — forked from joelverhagen/README.md

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@nicolashery
nicolashery / example.js
Last active May 28, 2024 16:53
Combine a pipe of multiple Node.js streams into one stream
var util = require('util')
, Transform = require('stream').Transform
, StreamCombiner = require('./streamcombiner');
var chunks1 = [];
var stream1 = new Transform();
var soFar = '';
stream1._transform = function(chunk, encoding, done) {
chunks1.push(chunk.toString());
var pieces = (soFar + chunk).split('\n');
@evilpacket
evilpacket / letter_freq.json
Created July 11, 2013 07:17
English letter frequencies in json format
{
"a": 8.167,
"b": 1.492,
"c": 2.782,
"d": 4.253,
"e": 12.702,
"f": 2.228,
"g": 2.015,
"h": 6.094,
"i": 6.966,
@mwhite
mwhite / git-aliases.md
Last active May 31, 2024 23:55
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@adityamukho
adityamukho / nginx-jail.sh
Last active April 29, 2021 03:25
Setup a CHROOT jail at `/srv/http` for a public Nginx server on Arch Linux.
#!/bin/bash
pacman -S nginx
export JAIL=/srv/http
# Create Necessary Devices
mkdir $JAIL/dev
mknod -m 0666 $JAIL/dev/null c 1 3
mknod -m 0666 $JAIL/dev/random c 1 8
mknod -m 0444 $JAIL/dev/urandom c 1 9
@prwhite
prwhite / Makefile
Last active May 31, 2024 20:56
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@flandr
flandr / urllib2_tls.py
Created October 16, 2014 15:22
Forcing TLS in Python's urllib2
# Python 2.6's urllib2 does not allow you to select the TLS dialect,
# and by default uses a SSLv23 compatibility negotiation implementation.
# Besides being vulnerable to POODLE, the OSX implementation doesn't
# work correctly, failing to connect to servers that respond only to
# TLS1.0+. These classes help set up TLS support for urllib2.
class TLS1Connection(httplib.HTTPSConnection):
"""Like HTTPSConnection but more specific"""
def __init__(self, host, **kwargs):
httplib.HTTPSConnection.__init__(self, host, **kwargs)
@ambroisemaupate
ambroisemaupate / security.conf
Last active May 23, 2024 05:32
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx