Skip to content

Instantly share code, notes, and snippets.

@Soft
Soft / .vimrc
Created April 8, 2010 08:25
My .vimrc file
" Soft's .vimrc
" Useful plugins: indent-object, NERD_tree, NERD_commenter, delimitMate,
" snipMate, surround, Command-T, EasyMotion
" Nice colorschemes: Herald, Neverland, Mustang, Molokai
set nocompatible
if has("gui_win32")
source $VIMRUNTIME/mswin.vim
behave mswin
@issackelly
issackelly / gist:928783
Created April 19, 2011 16:48
Django Template {{ block.super }} example
# Template: A.html
<html>
<head></head>
<body>
{% block hello %}
HELLO
{% endblock %}
</body>
</html>
@soplakanets
soplakanets / password.js
Created May 19, 2011 13:20
Password hashing for node.js
var crypto = require('crypto');
var SaltLength = 9;
function createHash(password) {
var salt = generateSalt(SaltLength);
var hash = md5(password + salt);
return salt + hash;
}
@yosemitebandit
yosemitebandit / ibm_queue.py
Created August 17, 2011 23:28
IBM's python threading example with Queues
#!/usr/bin/python
# -*- coding: utf-8 -*-
import Queue
import threading
import urllib2
import time
hosts = ['http://yahoo.com', 'http://google.com', 'http://amazon.com',
'http://ibm.com', 'http://apple.com']
@fabrizioc1
fabrizioc1 / akamai_debug_headers.txt
Last active May 24, 2023 08:23
Akamai debug headers
Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no
@jhorstmann
jhorstmann / gist:1579903
Created January 8, 2012 22:15
How to modify android-x86 asus_laptop image to add rtl8192se wireless lan driver

The "intellibook" netbook contains a rtl8192se pci network chip that is not currently included in the android-x86 builds. I could not get a complete self-build image to work so I decided to add the neccessary drivers to the existing release from 20120101. This has the added benefit that the installation contains the google apps, which are not included in the source download. The image can be downloaded from http://www.android-x86.org/releases/build-20120101 (android-x86-4.0-asus_laptop-20120101.iso).

Extract the iso image and the contained squashfs image and mount the contained filesystem image as a loopback device.

$ bsdtar -C android-image -xf android-x86-4.0-asus_laptop-20120101.iso
$ cd android-image
$ unsquashfs system.sfs
$ sudo mkdir /mnt/iso
$ sudo mount ./squashfs-root/system.img /mnt/iso  -o loop
@robspassky
robspassky / inetd_www.bash
Created March 2, 2012 15:59
bash shell script to serve an http request via inetd
#!/bin/bash
#
# Shell script usable as web "server"
# Code mostly copied from web, my contribution was to add the sanitation.
#
###
### PARSE THE REQUEST
###
@blaix
blaix / settings.py
Created April 3, 2012 19:32
Stubbing django settings with Mock
SOME_SETTING = 'some value'
LoadModule perl_module modules/mod_perl.so
<Perl>
warn "Loaded :)";
package MyApache2::PrintEnv1;
use strict;
use Apache2::RequestRec (); # for $r->content_type
use Apache2::RequestIO (); # for print
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 2, 2024 13:33
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname