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 | |
[ $# -ne 1 ] && echo "Usage: $0 <block_device_name>" && exit | |
if [ ! -b $1 ]; then | |
echo "could not find block device $1" | |
exit | |
fi | |
duration=10 | |
echo "running blktrace for $duration seconds to collect data..." |
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 | |
use feature 'say'; | |
use Carp (carp,croak); | |
use IO::File; | |
sub getLines($$); | |
croak "Usage: file" unless @ARGV ==1; | |
my $file = shift; | |
my $fh = IO::File->new($file,'r'); | |
my $total=0; |
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 | |
use feature 'say'; | |
use Carp (carp,croak); | |
use IO::File; | |
sub del_lines($$); | |
croak "Usage: file" unless @ARGV ==1; | |
my $file = shift; | |
my $fh = IO::File->new($file,'r'); | |
my $fail = IO::File->new("$file.del_fail",'w'); |
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 | |
use feature 'say'; | |
use diagnostics; | |
use Carp qw/carp croak/; | |
use IO::File; | |
use File::Find; | |
use Data::Dumper; | |
sub get_class_func($); | |
sub get_files($); |
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 | |
if [ "$#" -lt 2 ] | |
then | |
echo "Scan keys in Redis matching a pattern using SCAN (safe version of KEYS)" | |
echo "Usage: $0 <host> [port] [database] [pattern]" | |
exit 1 | |
fi | |
host=${1:-} |
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
local ffi=require('ffi') | |
ffi.cdef [[ | |
struct hostent { | |
char *h_name; /* official name of host */ | |
char **h_aliases; /* alias list */ | |
int h_addrtype; /* host address type */ | |
int h_length; /* length of address */ | |
char **h_addr_list; /* list of addresses */ | |
}; | |
struct hostent *gethostbyname(const char *name); |