Skip to content

Instantly share code, notes, and snippets.

View grst's full-sized avatar

Gregor Sturm grst

View GitHub Profile
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 24, 2024 14:56
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 24, 2024 04:27
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
@bpeterso2000
bpeterso2000 / dir_walk_with_depth_control.py
Last active December 5, 2022 02:24
Recursively walk a directory to a specified depth
" Reference: http://stackoverflow.com/questions/7159607 "
import os
import sys
def listdir(path):
"""
recursively walk directory to specified depth
:param path: (str) path to list files from
@antoniy
antoniy / vpn-auto-reconnect.sh
Last active February 4, 2022 09:04
Auto reconnect to OpenVPN via NetworkManager
#!/bin/bash +x
# Source: http://www.gabsoftware.com/tips/automatically-reconnect-to-your-vpn-on-linux/
# Description:
# Make the script executable "chmod +x /path/to/the/script.sh
# Put the script in .profile or .bashrc so it can be run on user login:
# Example: echo "/path/to/the/script.sh start &" >> .bashrc
# The script can be bound to shortcut keys with these commands:
# /path/to/the/script.sh start # starts and monitors VPN connection
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active June 22, 2024 03:44
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@anler
anler / archlinux_setup_guide.md
Last active September 28, 2020 17:48
How to setup Archlinux

Archlinux setup guide

This guide is based on the official Archlinux [Installation Guide][1], [Beginners' Guide][2] and my personal experience.

Partition layout

SDD partitions fs size mountpoint
/dev/nvme0n1p1 FAT 512M -
/dev/nvme0n1p2 LUKS MAX -
@xkr47
xkr47 / xkr-clipboard.pl
Created October 6, 2015 11:45
rxvt-unicode: Enable Ctrl-Insert/Ctrl-Shift-c to copy to CLIPBOARD (as opposed to PRIMARY) selection. Pasting works by Meta-<middle button>
#! perl
# Store this file as /usr/lib/urxvt/perl/xkr-clipboard
#
# To enable, add to ~/.Xresources:
#
# URxvt.perl-ext-common: default,xkr-clipboard
# URxvt.iso14755: false
# URxvt.keysym.Shift-Control-C: perl:clipboard:copy
# URxvt.keysym.Control-Insert: perl:clipboard:copy
@slowkow
slowkow / rpkm_versus_tpm.R
Created December 8, 2015 16:14
Comparison of RPKM (reads per kilobase per million) and TPM (transcripts per million).
# RPKM versus TPM
#
# RPKM and TPM are both normalized for library size and gene length.
#
# RPKM is not comparable across different samples.
#
# For more details, see: http://blog.nextgenetics.net/?e=51
rpkm <- function(counts, lengths) {
rate <- counts / lengths