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 | |
#METHOD=netperf | |
METHOD=nuttcp | |
HOST=ref1 | |
HOSTIP="192.168.0.2" | |
TARGETUSER=root | |
TARGET=target |
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/sh | |
# Two examples for batch conversion of RRD to XML (done on the host the RRD were created on) | |
# Convert from XML back to RRD on the new host/arch | |
for f in *.rrd; do rrdtool dump ${f} > ${f}.xml; done | |
for f in *.xml; do rrdtool restore ${f} `echo ${f} | cut -f1 -d .`.rrd; done | |
find /tmp/data -type f -iname '*.rrd' -print0|while IFS= read -r -d '' f; do rrdtool dump ${f} > ${f}.xml; done | |
find /tmp/data -type f -iname '*.xml' -print0|while IFS= read -r -d '' f; do rrdtool restore ${f} `echo ${f} | cut -f1 -d .`.rrd -f; done |
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
#See busy $10 Linode vm vs this $5 spare DO - https://gist.github.com/fwaggle/0ca82bc8454813550fc21b0200e58d9a | |
% sudo diskinfo -ctv /dev/gpt/rootfs | |
/dev/gpt/rootfs | |
512 # sectorsize | |
21474836480 # mediasize in bytes (20G) | |
41943040 # mediasize in sectors | |
0 # stripesize | |
1073759744 # stripeoffset | |
41610 # Cylinders according to firmware. | |
16 # Heads according to firmware. |
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
# ipsec.conf - strongSwan IPsec configuration file | |
config setup | |
# uniqueids=yes | |
# charondebug="cfg 2, lib 1, dmn 1, ike 5, net 1, knl 1" | |
conn %default | |
keyexchange=ikev2 | |
dpdaction=clear |
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
#BadTCP | |
tcp.analysis.flags && ! tcp.analysis.window_update | |
#TCP header length is less than 28 and has the SYN flag enabled | |
(tcp.hdr_len < 28) && (tcp.flags.syn == 1) | |
#TCP stream time delta < 1s and packet does not have the RST/FIN flag set and no HTTP GET [&& (http.request.method != "GET")] | |
#Plot I/O chart vs tcp.time_delta | |
(tcp.time_delta > 1) && (tcp.flags.reset == 0) && (tcp.flags.fin == 0) | |
(tcp.time_delta > .5) && (tcp.flags.reset == 0) && (tcp.flags.fin == 0) |
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/sh | |
# Check disk usage periodically via cron and free space up if $full - Stry | |
# send email to $admin | |
#ADMIN="[email protected]" | |
# set alert level in percentage | |
ALERT=95 | |
# List directories we can safely smoke |
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 | |
# Wrapper for cron to check and start TF2 server from $SCRIPT if need be | |
# cron is setup as: | |
# @reboot /home/tf2server/tf2d.sh start &> /dev/null | |
# */5 * * * * /home/tf2server/crontf2d.sh &> /dev/null | |
# | |
if ! /usr/bin/pgrep srcds ; then /home/tf2server/tf2d.sh start; fi |
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
# Script to delete files older than one hour - run from cron | |
# Wednesday, November 07, 2007 | |
#!/bin/bash | |
find /path/to/dir -cmin +60 -type f -maxdepth 1 -exec rm {} \; |
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 | |
find / -type f -ignore_readdir_race -size +20M -exec ls -lh {} \; | awk '{ print $8 ": " $5 }' | |
On fbsd and bash: | |
sudo find / -type f -ignore_readdir_race -size +20M -exec ls -lh {} \; | awk '{ print $5 ": " $9 " - " $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
#1 | |
cacls d:\cygwin /T /e /g Administrators:f | |
rmdir /S d:\cygwin | |
#2 | |
takeown /f "d:\cygwin" /r /d Y | |
icacls "d:\cygwin" /T /Q /C /reset |
OlderNewer