Skip to content

Instantly share code, notes, and snippets.

View willgarcia's full-sized avatar
🌴

William Garcia willgarcia

🌴
  • Brisbane, Australia
View GitHub Profile
@peterhost
peterhost / node_debian_init.sh
Created November 25, 2010 11:41
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@jehiah
jehiah / strange_bash_feature.sh
Created May 22, 2012 21:17
Weird (annoying) feature of bash
#!/bin/bash
COUNT=1
FILE=$0
# run this script with bash
# i bet you can't predict the outcome
function printsleep {
echo COUNT=$(( COUNT++ ))
echo printsleep >> $FILE
@c0wfunk
c0wfunk / git-multi-status.sh
Created September 7, 2012 13:47 — forked from aroberts/git-multi-status.sh
Script for checking git status of many git repositories
#!/bin/bash
# usage: $0 source_dir [source_dir] ...
# where source_dir args are directories containing git repositories
red="\033[00;31m"
green="\033[00;32m"
yellow="\033[00;33m"
blue="\033[00;34m"
purple="\033[00;35m"
#!/bin/bash
# How to install:
#
# $ sudo wget -O /usr/local/bin/jenkins-cli.jar http://your-jenkins/jnlpJars/jenkins-cli.jar
# $ sudo chmod +x !:3
#
# Put this script somewhere in your PATH and allow execution:
#
# $ sudo wget -O /usr/local/bin/jenkins https://gist.github.com/jubianchi/6434891/raw/jenkins.sh
@danharper
danharper / background.js
Last active June 29, 2024 19:32
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active April 5, 2022 10:30
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@v-thomp4
v-thomp4 / maintenance.html
Last active November 1, 2015 10:53 — forked from pitch-gist/gist:2999707
maintenance page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@HenningBrandt
HenningBrandt / ascii-art.zsh-theme
Last active April 16, 2016 05:23
Very simple prompt with: User, Git information, current working directory. Special feature is a random prompt character for each new session in the form of a short one line ASCII-Art
# Very simple prompt with:
# User, Git information, current working directory
# Special feature (because I love useless stuff) is a random prompt character for each new session
# in the form of a short one line ASCII-Art (Yeah! ASCII-Art)
#
# Some ASCII-Art might be NSFW, so be aware if you you use this prompt in public ;)
#
# Source of ASCII-Art: http://1lineart.kulaone.com
#
# Author: Henning Brandt
@hd-deman
hd-deman / gist:d856151147ab9c3c3564
Created February 21, 2015 21:56
Downgrade Boot2Docker and Docker from 1.5.0 to 1.4.1 on OS X
* brew tap homebrew/boneyard
* cd $( brew --prefix )
* brew versions docker
git_hash = $(brew versions docker | awk '$1 == "1.4.1" {print $4}')
* git checkout $git_hash Library/Formula/docker.rb
* brew unlink docker
* brew install docker
* brew switch docker 1.4.1
* docker --version
@Integralist
Integralist / vegeta load test.sh
Last active February 7, 2022 13:30
[Vegeta load test examples https://github.com/tsenart/vegeta] #go #golang #vegeta #examples #loadtest #benchmark #report
echo "GET http://google.com" | vegeta attack -duration=5s -rate=2 -cert=/path/to/certificate.pem | tee results.bin | vegeta report
# you don't have to pipe the data to `vegeta report`,
# you can instead run it as a separate command...
#
# echo "GET http://google.com" | vegeta attack -duration=5s | tee results.bin
# vegeta report results.bin
#
# in the vegeta results you might be confused by the `Status Codes` section:
#