Skip to content

Instantly share code, notes, and snippets.

View adamramadhan's full-sized avatar
Sparkles

Adam Ramadhan adamramadhan

Sparkles
View GitHub Profile
@paularmstrong
paularmstrong / gist:1196150
Created September 5, 2011 23:20
CSS3 Attribute Selectors Are Awesome
a[href*="twitter.com"],
a[href*="github.com"],
a[href*="dribbble.com"],
a[href*="linkedin.com"] {
background-image: url(images/icons.png);
background-position: 2px 2px;
background-repeat: no-repeat;
padding-left: 20px;
}
a[href*="github.com"] { background-position: 2px -23px; }
@wilsonpage
wilsonpage / reqUrl.js
Created November 25, 2011 14:38
A function I made that wraps the node http.request function to make it a little more friendly. In my case I am using it for API route testing.
// module dependencies
var http = require('http'),
url = require('url');
/**
* UrlReq - Wraps the http.request function making it nice for unit testing APIs.
*
* @param {string} reqUrl The required url in any form
* @param {object} options An options object (this is optional)
@dillera
dillera / graphite-centos6-install.txt
Created January 18, 2012 17:59
Install Graphite 0.9.9 and Statsd on Centos 6
# FOR CENTOS 6
# Andrew Diller Jan 2012
# Get EPEL Repo installed
rpm --httpproxy proxy --httpport 3128 --import https://fedoraproject.org/static/0608B895.txt
rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
vi /etc/yum.repos.d/epel.repo

NOTE: This documentation has been put here because I couldn't find it anywhere else. I am not associated with Crunchbase in any way. I cannot help you with your Crunchbase API problems. If you need help try here: https://groups.google.com/forum/#!forum/crunchbase-api

CrunchBase API v1 Documentation

Overview

The CrunchBase API provides JSON representations of the data found on CrunchBase. The API currently supports three actions: "show", "search", and "list", which are each described below.

@hrldcpr
hrldcpr / tree.md
Last active June 19, 2025 08:17
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@baudehlo
baudehlo / save_attach.js
Created June 18, 2012 18:17
Haraka Plugin to save attachments to disk
var fs = require('fs');
// Bind to receiving of data
exports.hook_data = function( next, connection, params ) {
var haraka = this,
uid = connection.transaction.uuid;
connection.transaction.notes.attachments = {};
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 15, 2025 15:49 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@ichernev
ichernev / lruqueue.js
Created August 5, 2012 22:15
Node.js zmq guide examples
// Least-recently used (LRU) queue device in Node.js
var startClientsAndWorkersNowait = true
, terminate = 'skip'; // 'immediately', 'later', 'skip'
var numberOfClients = 10
, numberOfWorkers = 3;
var zmq = require('zmq')
, frontend = zmq.socket('router')
@sivel
sivel / better-ssh-authorized-keys-management.md
Last active April 10, 2025 03:40
Better SSH Authorized Keys Management

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server: