Skip to content

Instantly share code, notes, and snippets.

@SHaTRO
SHaTRO / git-forked-to
Last active July 14, 2021 07:23
BASH script to change "original" upstream clone to newly forked repo
#!/bin/bash
## If you cloned a repository, then forked it and want to change your clone to point to your fork...
## Usage:
## git-forked-to <NEW ORIGIN URL> [<BRANCH>]
##
## <NEW ORIGIN URL> should be your new forked repo URL
## <BRANCH> defaults to "master"
##
## For example: git-forked-to git@github.com:SHaTRO/conveyance.git
@akorn
akorn / rsync_parallel.sh
Last active January 26, 2024 08:18 — forked from rcoup/rsync_parallel.sh
This script can transfer large directory structures with parallel rsync workers. Example command line: `rsync_parallel . -- -aHSAX --exclude '*13' . /tmp/2/.`
#!/bin/zsh
#
# Copyright (c) 2014, 2020 by Dr. András Korn. Implements the basic idea of a similar script by Robert Coup (2013).
# License: GPLv3
function usage() {
echo 'Usage:
rsync_parallel [--parallel=N] <args to find(1) to generate list of stuff to transfer> -- <args to rsync>
@caruccio
caruccio / bash-path-vars
Last active December 28, 2023 22:47
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts
@agaviria
agaviria / Ledger_3_commands.dat
Created August 10, 2012 20:03
Collection of ledger-cli commands
# comments example for .dat or .ledger files
@smallexample
; This is a single line comment,
# and this,
% and this,
| and this,
* and this.
# If you have a deeply nested tree of accounts,
# it may be convenient to define an alias, for example:
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@solisoft
solisoft / ovhfact.rb
Created January 20, 2012 09:25
OVH Invoices
#!/usr/bin/ruby
# Require:
# - linux or Mac
# - ruby 1.8.7
# - Gem soap4r
# - curl
#
# Usage :
# ruby ovhfact.rb 2011
#