Skip to content

Instantly share code, notes, and snippets.

View gawbul's full-sized avatar

Steve Moss gawbul

View GitHub Profile
@netj
netj / memusg
Last active January 29, 2024 15:04
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@arikfr
arikfr / .monitrc
Created December 13, 2010 14:35
Setting Monit to work with Gmail as mail server
set mailserver smtp.gmail.com port 587 username "user@domain.com" password "password" using tlsv1 with timeout 30 seconds
@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
@drewbuschhorn
drewbuschhorn / plos_sunburnt_demo.py
Created July 12, 2011 03:06
PLOS API code for use with SunBurnt
#Sample PLOS api code for use with python Solr library Sunburnt
#( https://github.com/tow/sunburnt )
#!Note! requires sunburnt's external libraries: httplib2,lxml
#https://groups.google.com/d/topic/plos-api-developers/zv591sFz6TM/discussion
import sunburnt,urllib2
class PlosInterface(sunburnt.SolrInterface):
def __init__(self,api_key):
plos_url = "http://api.plos.org/search"
#either
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@chapmanb
chapmanb / galaxy-init-example
Created December 5, 2011 19:29
Example Galaxy start script for CentOS: edit and put in /etc/init.d/galaxy
#!/bin/bash
#--- config
SERVICE_NAME=galaxy
RUN_AS=galaxy
RUN_IN=/your/galaxy/directory
#--- main actions

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@socketwiz
socketwiz / vim.markdown
Last active October 13, 2021 14:15
Vim cheat sheet

motions

motion description
h Count characters left
l Count characters right
^ To the first character of the line
$ To the last character of the line
f<char> To the counth character occurrence to the right. F<char> to the counth character occurrence to the left
t<char> To 1 character just before the counth character occurrence to the right
@odrobnik
odrobnik / gist:2669542
Created May 12, 2012 22:43
Dropquest 2012 - Answer 1 Solution as C Program
int test(int a, int b, int c, int d, int e)
{
if ((a*b) != 24) return 0;
if (d != (b/2)) return 0;
if ((a+c)!=(d+e)) return 0;
if ((a+b+c+d+e) != 26) return 0;
// count occurences of digits
int counts[10] = {0,0,0,0,0,0,0,0,0,0};
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a