Skip to content

Instantly share code, notes, and snippets.

@wynst
wynst / README.MD
Created February 25, 2010 11:19
A Thor Task to unwatch *all* Github watched repositories (excluding owned) and optionally export to delicious.

A Thor Task to unwatch all Github watched repositories (excluding owned) and optionally export to delicious.

Sorry Github, for I have sinned. I use the Watch feature as a bookmarker.

Install required gems:

gem install thor rest-client

Use it as such:

@jmfederico
jmfederico / run-xtrabackup.sh
Last active February 6, 2024 08:52
Script to create full/incremental backups with xtrabackup.
#!/bin/sh
TMPFILE="/tmp/xtrabackup-runner.$$.tmp"
USEROPTIONS="--user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --host=${MYSQL_HOST}"
BACKDIR=/srv/mysql-bak
BASEBACKDIR=$BACKDIR/base
INCRBACKDIR=$BACKDIR/incr
FULLBACKUPCYCLE=604800 # Create a new full backup every X seconds
KEEP=1 # Number of additional backups cycles a backup should kept for.
START=`date +%s`
@jboner
jboner / latency.txt
Last active May 2, 2024 09:45
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 1, 2024 03:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@nerdtalker
nerdtalker / EXIFmover.py
Last active April 8, 2017 14:34
EXIFmover - Moves Dropbox Camera uploaded Images into sensible directories
# Name: EXIFmover.py
# Author: Brian Klug (@nerdtalker / brian@brianklug.org)
# Purpose:
# Move Files into directory based on EXIF data make and model
# Designed to un-clusterfuck the Dropbox camera upload directory which is a mess of every
# JPEG and PNG ever if you use it like I do on a bunch of phones, and thus totally unwieldy
# and full of images sorted by date or else nothing sometimes, dropbox seems nondeterminstic
# Moves files into /[Image Make]+[Image Model]/ eg /Camera Uploads/LGE Nexus 4/
@louiszuckerman
louiszuckerman / gfid-resolver.sh
Last active November 29, 2023 10:01
Glusterfs GFID Resolver Turns a GFID into a real path in the brick
#!/bin/bash
if [[ "$#" < "2" || "$#" > "3" ]]; then
cat <<END
Glusterfs GFID resolver -- turns a GFID into a real file path
Usage: $0 <brick-path> <gfid> [-q]
<brick-path> : the path to your glusterfs brick (required)
@jagtesh
jagtesh / split_tunneling.md
Created May 7, 2013 09:06
Split Tunneling tutorial - with openconnect (tested, works with Cisco AnyConnect VPN) Source: http://lists.unix-ag.uni-kl.de/pipermail/vpnc-devel/2009-February/002990.html

Table of Contents

  1. DISCLAIMER 2. Status 3. Introduction 4. Security issues 5. DNS
@nkrumm
nkrumm / gist:7092165
Created October 21, 2013 22:42
Removing SGE hosts from a queue (why is this so hard?) credit: http://resbook.wordpress.com/2011/03/21/remove-execution-host-from-gridengine/
# first, you need to disable the host from queue to avoid any jobs to be allocated to this host
qmod -d all.q@thishost.com
# wait for jobs to be finished execution on this host, then kill the execution script
qconf -ke thishost.com
# remove it from the cluster, this opens an editor, just remove the lines referring to this host
qconf -mq all.q
# remove it from allhosts group, this also opens an editor, remove lines referring to this host
qconf -mhgrp @allhosts
# remove it from execution host list
qconf -de thishost
@hgomez
hgomez / download-java8.sh
Created March 19, 2014 20:39
wget to download Java 8
wget --continue --no-check-certificate -O jdk-8-linux-x64.tar.gz --header Cookie: oraclelicense=a http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.tar.gz
@treydock
treydock / job_submit.lua
Last active March 5, 2024 17:54
SLURM job_submit lua script
--[[
SLURM job submit filter for QOS
Some code and ideas pulled from https://github.com/edf-hpc/slurm-llnl-misc-plugins/blob/master/job_submit.lua
--]]
--########################################################################--
--