Skip to content

Instantly share code, notes, and snippets.

View aledbf's full-sized avatar

Manuel Alejandro de Brito Fontes aledbf

View GitHub Profile
@headius
headius / gist:1234935
Created September 22, 2011 14:38
OS X 'pickjdk' command with single-command selection and updated JDK location
#!/bin/bash
#
# Provides a function that allows you to choose a JDK. Just set the environment
# variable JDKS_ROOT to the directory containing multiple versions of the JDK
# and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned
# up and set appropriately.
_macosx()
{
if [ $(uname -s) = Darwin ]; then
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@madrobby
madrobby / gist:5489174
Created April 30, 2013 14:43
Install Phantom.js on Ubuntu 10.04 and tweak for better rendering quality.
sudo apt-get update
sudo apt-get install libfreetype6 libfreetype6-dev libfontconfig
# /etc/apt/sources.list should contain these:
# deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
# deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
sudo echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
@kgorman
kgorman / gist:5775530
Created June 13, 2013 17:19
balance_check
var balance_check = function(n) {
if ( n ) {
var output = db.chunks.aggregate([
{ $group : { _id : { "_id":"$ns", "shard":"$shard" }, chunks : { $sum : 1 } }},
{ $match : { "_id._id" : n } },
{ $sort : { "chunks" : 1 } }
]);
@konklone
konklone / ssl.rules
Last active August 8, 2023 08:39
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@philips
philips / gist:7310435
Last active March 17, 2017 21:03
Setting up swap on coreos

Setup a swap file in the stateful partition

Run these commands as root to create a 512 megabyte swap.

fallocate -l 512m /media/state/512MiB.swap
chmod 600 /media/state/512MiB.swap
mkswap /media/state/512MiB.swap
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Awesomium.Core;
namespace AwesomiumNewTest
{

build

Clone and build Node for analysis:

$ git clone https://github.com/joyent/node.git
$ cd node
$ export GYP_DEFINES="v8_enable_disassembler=1"
$ ./configure
$ make -j4
@mindreframer
mindreframer / docker-clear-orphaned-volumes.py
Created December 4, 2013 13:51
volumes clearing script for docker, a copy from https://github.com/dotcloud/docker/issues/197 with some fixes
#!/usr/bin/python
import json
import os
import shutil
import subprocess
import re
dockerdir = '/var/lib/docker'
volumesdir = os.path.join(dockerdir, 'volumes')