Skip to content

Instantly share code, notes, and snippets.

View IuryAlves's full-sized avatar

Iury Alves de Souza IuryAlves

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@borismus
borismus / gist:1032746
Created June 18, 2011 02:46
Convert a base64 string into a binary Uint8 Array
var BASE64_MARKER = ';base64,';
function convertDataURIToBinary(dataURI) {
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {
@dfox
dfox / route53-user-policy.json
Created January 25, 2012 16:45
An IAM policy for Amazon AWS to allow limited access to Route 53
{
"Statement":[
{
"Action":[
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect":"Allow",
"Resource":[
@SegFaultAX
SegFaultAX / gist:2847710
Created June 1, 2012 00:56
Erlang sorting algorithms
-module(sortlib).
-export([qsort/1, bsort/1, ssort/1, isort/1, msort/2,
msort_lte/1, msort_gte/1]).
-export([test_sort/0, test_sort/1, shuffle/1, split/1, merge/3]).
-import(lists, [reverse/1]).
%% Various sorting algorithms implemented in Erlang
@turicas
turicas / virtualenv_execute.py
Created June 8, 2012 19:23
Execute Python code in a virtualenv, return its stdout and stderr
#!/usr/bin/env python
# coding: utf-8
import os
import shlex
from subprocess import Popen, PIPE
def execute_in_virtualenv(virtualenv_name, commands):
'''Execute Python code in a virtualenv, return its stdout and stderr.'''
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active March 31, 2024 18:45 — 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.
@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:

@misterbrownlee
misterbrownlee / jenkins-notes.md
Created September 12, 2012 18:10
Jenkins setup

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@gmhawash
gmhawash / gist:4043232
Created November 9, 2012 01:54
Reset jenkins password
0. SSH to server
1. Edit /opt/bitnami/apps/jenkins/jenkins_home/config.xml
2. set userSecurity to false: <userSecurity>false</userSecurity>
3. delete
<authorizationStrategy> and <securityRealm>
4. /etc/init.d/bitnami restart
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer