Skip to content

Instantly share code, notes, and snippets.

View s5unty's full-sized avatar

Sun Wuan s5unty

View GitHub Profile
@fwenzel
fwenzel / cleanup-maildir.py
Created January 19, 2010 12:13
A script for cleaning up mails in Maildir folders
#!/usr/bin/python -tt
"""
USAGE
cleanup-maildir [OPTION].. COMMAND FOLDERNAME..
DESCRIPTION
Cleans up old messages in FOLDERNAME; the exact action taken
depends on COMMAND. (See next section.)
Note that FOLDERNAME is a name such as 'Drafts', and the
# cat /proc/cpuinfo | grep "^processor" | wc -l
16
# cat /proc/cpuinfo | grep "^model name" | head -1
model name : Intel(R) Xeon(R) CPU E5520 @ 2.27GHz
# openssl speed md5
Doing md5 for 3s on 16 size blocks: 3787525 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: 3016201 md5's in 3.00s
Doing md5 for 3s on 256 size blocks: 1856180 md5's in 3.00s
@louiszuckerman
louiszuckerman / gfid-resolver.sh
Last active November 29, 2023 10:01
Glusterfs GFID Resolver Turns a GFID into a real path in the brick
#!/bin/bash
if [[ "$#" < "2" || "$#" > "3" ]]; then
cat <<END
Glusterfs GFID resolver -- turns a GFID into a real file path
Usage: $0 <brick-path> <gfid> [-q]
<brick-path> : the path to your glusterfs brick (required)
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
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
#!/bin/bash
#
#this script contributed by Matthias Meyer
#note that if your $Topdir seems to be wrong (because it is empty), the script will ask you
#the new location.
#
#10/2009 JJK: Modified by Jeffrey J. Kosowsky
# add --nightly
# check if user eguals root or backuppc
#11/2009 MMT: Modified by Matthias Meyer
@blueyed
blueyed / _tmux_pane_words.zsh
Last active May 26, 2023 07:39
ZSH configuration to complete words from tmux pane(s)
# Complete words from tmux pane(s) {{{1
# Source: http://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html
# Gist: https://gist.github.com/blueyed/6856354
_tmux_pane_words() {
local expl
local -a w
if [[ -z "$TMUX_PANE" ]]; then
_message "not running inside tmux!"
return 1
fi
@rxaviers
rxaviers / gist:7360908
Last active May 5, 2024 06:01
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@andrewlkho
andrewlkho / gist:7373190
Last active March 25, 2024 03:37
How to use authentication subkeys in gpg for SSH public key authentication

GPG subkeys marked with the "authenticate" capability can be used for public key authentication with SSH. This is done using gpg-agent which, using the --enable-ssh-support option, can implement the agent protocol used by SSH.

Requirements

A working gpg2 setup is required. It may be possible to use gpg 1.4 but with gpg-agent compiled from gpg2. If you are using OS X 10.9 (Mavericks) then you may find the instructions [here][1] useful.

@xkou
xkou / gist:8572872
Created January 23, 2014 04:33
install tengine with luagit
# git clone https://github.com/simpl/ngx_devel_kit.git
cd tengine-2.0.0/
# tell nginx's build system where to find LuaJIT 2.0:
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0/
# Here we assume Nginx is to be installed under /opt/nginx/.
@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>