This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# | |
# Usage: | |
# $ cd <xfs_brick>; strace -c python2 /tmp/timecreatefile.py | |
import os | |
import timeit | |
filename = 'foo' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set logging file <BACKTRACE_FILE> | |
set logging on | |
set pagination off | |
thread apply all bt full |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _LARGEFILE64_SOURCE | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <pthread.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <sys/types.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################################################## | |
# This bash script will encypt backups using an unmodified version of | |
# Cryptsetup. | |
# | |
# Usage: | |
# | |
# $ dd if=/dev/zero of=/DS02/test/<backup_file> bs=1M count=<count> | |
# | |
# $ encrypt_stress {iteration} {size} {loopdevice} {backup_file} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BRICK=/path/to/brick | |
for i in $(grep 'split-brain' /var/log/glusterfs/glustershd.log | awk {'print $11'} | sort | uniq); do | |
GFID=$(echo $i | cut -f2 -d: | cut -f1 -d'>') | |
INODE=$(ls -i ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID} | awk {'print $1'}) | |
FILES=$(find ${BRICK} -inum ${INODE}) | |
echo ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID} | |
echo ${FILES} | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <dirent.h> | |
#define _FILE_OFFSET_BITS 64 | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"path/filepath" | |
"os" | |
"flag" | |
"fmt" | |
) | |
type fileattr struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"path/filepath" | |
"os" | |
"flag" | |
"fmt" | |
) | |
type fileattr struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
list_large_files_checksum () | |
{ | |
local DIR=$1; | |
large_files="" | |
large_directories="" | |
# Get top ten culprit files | |
for i in $(du --exclude=".glusterfs" -akx $DIR | sort -nr | head -10 | awk {'print $2'}); do | |
if [ -f $i ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Borrowed from - http://search.cpan.org/~mlehmann/JSON-XS-3.01/bin/json_xs | |
# Modified for internal use in GlusterFS | |
use strict; | |
use Encode; | |
use JSON::XS; | |
my $opt_from = "json"; | |
my $opt_to = "null"; |