draft

salt

VIEW ALL KEYS

salt-key --list-all

ACCEPT A SPECIFIC KEY

salt-key --accept=<key>

ACCEPT ALL KEYS

salt-key --accept-all

salt '*' test.ping
salt '*' cmd.run 'ls -l /etc'
salt '*' disk.usage
salt '*' pkg.install cowsay
salt '*' network.interfaces

Targets can be based on Salt minion system information using the Grains system:

salt -G 'os:Ubuntu' test.ping

Targets can be filtered by regular expression:
salt -E 'minion[0-9]' test.ping

Installing Request Tracker

adduser rt
 
su - rt
 
wget ..../rt-4.2.2.tar.gz
 
tar xf rt-4.2.2.tar.gz
 
curl -L <a href="http://cpanmin.us" title="http://cpanmin.us">http://cpanmin.us</a> | perl - App::cpanminus
 
~/perl5/bin/cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
 
cd rt-4.2.2
 
 
./configure --prefix=$HOME --with-my-user-group
 
RT_FIX_DEPS_CMD='cpanm %s' make fixdeps
 
make install
 
adduser www-data rt

Object storage

OpenStack Swift
CEPH RadosGW
elliptics
HDFS

Snippet

The fact that regex doesn't support inverse matching is not entirely true. You can mimic this behavior by using negative look-arounds:

^((?!hede).)*$
The regex above will match any string, or line without a line break, not containing the (sub) string 'hede'. As mentioned, this is not something regex is "good" at (or should do), but still, it is possible.

HA

Snippet

iptables -t mangle -A tcout -p tcp --dport 7790 -j TOS --set-tos Minimize-Delay
iptables -t mangle -A tcout -p tcp --sport 7790 -j TOS --set-tos Minimize-Delay

iopfstat.pl

#!/usr/bin/perl

# strace -etrace=write,pwrite -f -p 6125 2>&1 | head -n 100000 | perl iopfstat.pl | grep /var/lib/mysql/

while(<>) {
chomp;
if(/\[pid\s*(\d+)\] p?write\((\d+), .* = (\d+)/) {
my $pid = $1;
my $fd = $2;
my $size = $3;
my $file = `ls -l /proc/$pid/fd/$fd`;
$file =~ s/^.*\-\>\s*//;
chomp $file;
$STAT{$file}=0 if not exists $STAT{$file};
$STAT{$file}+=$size;
# printf "$file\n";
}
}

#exit;

my @keys = sort { $STAT{$a} <=> $STAT{$b} } keys %STAT;

foreach my $key ( @keys ) {

Perf tests

iperf
fio
iozone3
sysbench
unixbench