Skip to content

Instantly share code, notes, and snippets.

View avargas's full-sized avatar

Angelo Vargas avargas

View GitHub Profile
#Just pure awesomeness!
bind '"\e[A"':history-search-backward
bind '"\e[B"':history-search-forward
bind Space:magic-space
# Misc -------------------------------------------------------------
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups:erasedups
@djacobs
djacobs / automatedBuildAndUploadToTestflight.sh
Created April 18, 2012 04:20 — forked from amattn/automatedBuildAndUploadToTestflight.sh
Automated Xcode build and upload to TestFlight.
#!/bin/sh
# Current as working as of 2012/4/17
# Xcode 4.3.2
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX"
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace"
CONFIG="AdHoc"
SCHEME="XXXXXXXX"
@Angles
Angles / HISTIGNORE-info.txt
Created August 6, 2012 11:03
HISTIGNORE what's the deal
###
####### HISTIGNORE #######
###
# examples from interwebs, noob dot file notes
#export HISTIGNORE='pwd:exit:fg:bg:top:clear'
# (if try to erasedups do not ignore things want 2 pune but on OSX it no workie)
# ignore things that start with a space, and ignore the exit command
#HISTIGNORE='[ \t]*:exit'
# some slashdot dudes says
#export HISTIGNORE="&:ls:[bf]g:exit:pwd:clear:mount:umount:[ \t]*"
@rcoup
rcoup / rsync_parallel.sh
Created April 10, 2013 21:52
Parallel-ise an rsync transfer when you want multiple concurrent transfers happening,
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes:
@jayjanssen
jayjanssen / gist:5697813
Created June 3, 2013 12:33
Testing multicast with iperf
this is a sample of output:
root@percona-db-2:~# iperf -s -u -B 226.94.1.1 -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 226.94.1.1
Joining multicast group 226.94.1.1
Receiving 1470 byte datagrams
UDP buffer size: 122 KByte (default)
------------------------------------------------------------
@whot
whot / _xinput
Created December 2, 2013 01:27
zsh completion for xinput
#compdef xinput
# ZSH completion for `xinput`
# Copyright © 2013 Red Hat, Inc.
# Author: Peter Hutterer
# License: http://opensource.org/licenses/MIT
_xinput()
{
@wernight
wernight / inotifyexec.py
Last active June 27, 2023 22:47
inotifywait helper that executes a command on file change (for Linux, put it in ~/bin/)
#!/usr/bin/env python
"""Use inotify to watch a directory and execute a command on file change.
Watch for any file change below current directory (using inotify via pyinotify)
and execute the given command on file change.
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done`
has many issues which are fixed by this tools:
* If your editor creates a backup before writing the file, it'll trigger multiple times.
* If your directory structure is deep, it'll have to reinitialize inotify after each change.
#!/bin/bash
# Estimate time to slave replication recovery using an accumulated average
time_interval=60
samples=0
delay_moving_average=0
delay="$(mysql -e 'SHOW SLAVE STATUS\G' | awk '/Seconds_Behind_Master:/ {print $2}')"
echo "Initial replication delay: ${delay} seconds. Polling recovery rate every ${time_interval} seconds."
@mottalrd
mottalrd / gist:7ddfd45d14bc7433dec2
Last active March 29, 2022 07:38
Evan Miller source code for sample size from my blog post http://www.alfredo.motta.name/ab-testing-from-scratch/
function num_subjects(alpha, power_level, p, delta) {
var t_alpha2 = ppnd(1.0-alpha/2);
var t_beta = ppnd(power_level);
var sd1 = Math.sqrt(2 * p * (1.0 - p));
var sd2 = Math.sqrt(p * (1.0 - p) + (p + delta) * (1.0 - p - delta));
return (t_alpha2 * sd1 + t_beta * sd2) * (t_alpha2 * sd1 + t_beta * sd2) / (delta * delta);
}
@ncallister
ncallister / dev-setup.md
Last active June 27, 2024 00:03
Ubuntu Dev Setup

Development Setup for Ubuntu

The following documents is basically notes on tools, repos, etc. to use for development in Ubuntu. It is devided into sections so that it can be used in pieces, it doesn't need to be followed like a script.

Notes

This is likely to end up out-of-date. Things to watch out for:

  • Package archives change, are abandoned or are superseded. Most of the packages archives will need to be checked before they are used.
  • Package names change over time, this is less likely than package archives and I have tried to use generic names for packages wherever possible.