Skip to content

Instantly share code, notes, and snippets.

@ecerulm
ecerulm / diffmerge-diff.sh
Created August 5, 2010 15:46
Cygwin Git: wrappers for diffmerge and winmerge
#!/bin/sh
# Use SourceGear DiffMerge as mergetool for git in cygwin.
# git config --global mergetool.diffmerge.cmd "diffmergetool.sh \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
# git config --global mergetool.diffmerge.trustExitCode false
# git difftool -t diffmerge branch1..branch2
# Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf
library=githelperfunctions.sh
@sebclaeys
sebclaeys / non_blocking_read.py
Created September 21, 2011 13:56
Python non-blocking read with subprocess.Popen
import fcntl
import os
from subprocess import *
def non_block_read(output):
fd = output.fileno()
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
try:
return output.read()
@forresty
forresty / rwget.sh
Created October 16, 2011 15:44
rwget: wget through ssh tunnel
#!/usr/bin/env sh
# TODO: replace your-hostname-here.com and path_to_your_rwget_folder
if [ $# -lt 1 ] ; then
echo "usage: rwget URL"
exit 1
fi
filename=`ssh your-hostname-here.com URL=$1 'bash -s' << 'ENDSSH'
cd path_to_your_rwget_folder
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@fosskers
fosskers / gist:3787785
Created September 26, 2012 12:39
Arch Packages

Arch Packages

and what you should know about them

The Arch Way states:

Arch Linux targets and accommodates competent GNU/Linux users by
giving them complete control and *responsibility* over the system.

Part of this comes from package choice. Users either install from

@ngi
ngi / install-fonts.bash
Created November 23, 2012 20:01
Bash script for installing fonts on ubuntu
#!/bin/bash
# Credit to http://ubuntuforums.org/member.php?u=126210
# This script helps to install fonts
#
# Set your default font storage directory here
##DEFAULT_DIR="$HOME/fonts"
DEFAULT_DIR=`pwd`
# Set the default font installation directory here
DEFAULT_DEST="/usr/share/fonts/truetype/font-install"
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 25, 2024 10:55
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@ajvargo
ajvargo / input_example.el
Created January 20, 2013 03:56
An example of getting user input for an Elisp function with a default value divined from context.
(defun input-example (text)
"Gets user input and prints it back. Defaults to word at point"
(interactive
(list
(read-string
(format "Text (%s): " (word-at-point)) ; prompt. It's nice to show the default value
nil ; initial input. This value is prefilled in the mini-buffer. Available but considered deprecated.
nil ; history list if you have a specific one for this
(word-at-point) ; Whatever this evaluates to will be the default value
)))
@jacob-ogre
jacob-ogre / jacob-ogre_ST2.sublime-keymap
Created June 26, 2013 17:56
Sublime Text: Custom keybindings, mostly Vintage (Vim)
[
// Working in some additional Vim or Vim-like bindings; using 'g' as <leader>
// because it's homerow and unused for most commands:
{ "keys": ["g", "t"], "command": "next_view", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g", "r"], "command": "prev_view", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g", "n"], "command": "focus_side_bar", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g", "w"], "command": "focus_group", "args": { "group": 0 } },
{ "keys": ["g", "m"], "command": "find_under_expand", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["g", "s"], "command": "sftp_browse_server", "context": [{"key": "setting.command_mode"}] },
@rcmdnk
rcmdnk / vim_ime.ahk
Last active February 19, 2020 02:10
Automatic IME off for Vim by AutoHotkey. IME.ahk is needed to be placed in the same directory with this setting script (http://www6.atwiki.jp/eamat/pages/17.html).
; Auto execute section is the region before any return/hotkey
; For Terminal/Vim
GroupAdd Terminal, ahk_class PuTTY
GroupAdd Terminal, ahk_class mintty ; cygwin
GroupAdd TerminalVim, ahk_group Terminal
GroupAdd TerminalVim, ahk_class Vim
; Include IME.hak
; http://www6.atwiki.jp/eamat/pages/17.html