Skip to content

Instantly share code, notes, and snippets.

View s5unty's full-sized avatar

Sun Wuan s5unty

View GitHub Profile
@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)
# 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
@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