This file contains 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 | |
# Get current swap usage for all running processes | |
# Erik Ljungstrom 27/05/2011 | |
# Modified by Mikko Rantalainen 2012-08-09 | |
# Pipe the output to "sort -nk3" to get sorted output | |
SUM=0 | |
OVERALL=0 | |
for DIR in `find /proc/ -maxdepth 1 -type d -regex "^/proc/[0-9]+"` | |
do | |
PID=`echo $DIR | cut -d / -f 3` |
This file contains 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
sz=50G | |
sysbench --test=fileio --file-total-size=$sz --file-num=64 prepare | |
sysbench --test=fileio --file-total-size=$sz --file-test-mode=rndwr --max-time=180000 --max-requests=0 --num-threads=8 --rand-init=on --file-num=64 --file-io-mode=async --file-extra-flags=direct --file-fsync-freq=0 --file-block-size=16384 --report-interval=10 run |
This file contains 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/perl | |
# Copyright (c) 2010, Jeremy Cole <[email protected]> | |
# Modified (c) 2014, Ivan Prisyazhniy <[email protected]> | |
# - top [num] - mode to print numa map distribution from mem top | |
# This program is free software; you can redistribute it and/or modify it | |
# under the terms of either: the GNU General Public License as published | |
# by the Free Software Foundation; or the Artistic License. | |
# |
This file contains 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 | |
# The MIT License (MIT) | |
# Copyright (c) 2014 Ivan Prisyazhniy <[email protected]> | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains 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 | |
# The MIT License (MIT) | |
# Copyright (c) 2014 Ivan Prisyazhniy <[email protected]> | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains 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
# The current release is Beautiful Soup 4.3.2 (October 2, 2013). | |
# You can install it with pip install beautifulsoup4 or easy_install beautifulsoup4. | |
# It's also available as the python-beautifulsoup4 package in recent versions of Debian, Ubuntu, and Fedora . | |
from bs4 import BeautifulSoup as bs | |
import fileinput | |
import sys | |
for line in fileinput.input(sys.argv[1]): | |
print bs(line).prettify() |
This file contains 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
#[allow(unused_imports)] | |
use std::io; | |
use std::path::Path; | |
use std::fs::File; | |
type IoResult<T> = std::io::Result<T>; | |
extern crate tempdir; | |
extern crate rustc_serialize; | |
extern crate docopt; |
This file contains 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 | |
NAME="service" | |
LIMIT="8000" | |
DELETELIMIT="500" | |
# Packing | |
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) && cd $DIR | |
FILES=`ls -A1Lct ${NAME}.* | grep -v '.sh$' | grep -v '.zip$' | grep -v '.gz$'` | |
TYPES=`echo "$FILES" | grep -E '.[A-Z]+$' | wc -l` |
This file contains 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 | |
. /etc/environment | |
PUBLIC_IPV4=`cat /etc/network/interfaces | grep -A 2 'iface eth0' | head -n +2 | tail -n 1 | awk '{print $2}'` | |
PRIVATE_IPV4=`cat /etc/network/interfaces | grep -A 2 'iface eth1' | head -n +2 | tail -n 1 | awk '{print $2}'` | |
SERVERS=(DATACENTER1 DATACENTER2 DATACENTER3) | |
for SERVER in "${SERVERS[@]}"; do | |
curl http://${PRIVATE_IPV4}:8500/v1/agent/join/${SERVER}.mysupercompany.com:8302?wan=1 |
This file contains 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 | |
# 25 0 * * * /root/redis.backup.sh | |
PRIVATE_IPV4=`cat /etc/network/interfaces | grep -A 2 'iface eth1' | head -n +2 | tail -n 1 | awk '{print $2}'` | |
# 1. Dump RDB | |
(printf "select 2\r\nsave\r\n" | nc ${PRIVATE_IPV4} 6379) || exit 1 | |
# 2. Copy dump | |
SRCPATH="/var/lib/redis/6379" |
OlderNewer