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
# timeout() | |
# fork from http://d.hatena.ne.jp/hcr/20050803/1123025377 | |
# 2010-04-29 | |
timeout() | |
{ | |
count_timeout=$1 | |
shift 1; | |
echo exec \'$@\' | |
$@ & |
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
tell application "iTunes" | |
play | |
repeat | |
next track | |
set l to duration of current track | |
repeat 16 times | |
set p to random number from (l - 1) | |
set r to random number from 1 to 4 | |
set d to 2 ^ (4 - r) / 10 | |
repeat 2 ^ r times |
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
while :; do clear; uptime; echo; /usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /; if [ $? -eq 0 ]; then echo -e "\e[0;32m[OK]\e[0m"; elif [ $? -eq 1 ]; then echo -e "\e[0;33m[WARNING]\e[0m"; elif [ $? -eq 2 ]; then echo -e "\e[0;31m[CRITICAL]\e[0m"; fi; sleep 1; 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
#!/usr/bin/env ruby | |
require 'optparse' | |
bar_string = "|" | |
bar_max = 30 | |
max = 0 | |
$es_s=["\033[34m","\033[36m","\033[32m","\033[33m","\033[35m","\033[31m"] | |
$es_b="\033[30m" |
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
pattern=/https:\/\/([^\/]+)\/(.+)\/extinfo.cgi\?type=2&host=([^&]+)&service=(.+)$/ | |
$(".extinfo").keypress(function(event) { | |
if ( event.which == 97 ) { | |
url_from = location.href; | |
if ( url_from.match(pattern)){ | |
url_to = url_from.replace(pattern,"https://$1/$2/cmd.cgi?cmd_typ=34&host=$3&service=$4"); | |
location.href = url_to; | |
} | |
} |
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
void setup(){ | |
// iroiro | |
} | |
void draw(){ | |
// arekore | |
saveFrame("out-####.gif"); | |
} |
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
Shell 1 | |
======= | |
# ./logger.sh | |
Shell 2 | |
======= | |
# tailf log | awk -f add_timestamp.awk |
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
alias thunderbird-sound-off='cp -p ~/Music/silent.wav ~/Music/thunderbird_notify.wav' | |
alias thunderbird-sound-on='cp -p ~/Music/win95.wav ~/Music/thunderbird_notify.wav' |
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 | |
SND_ON="/Users/me/Music/win95.wav" | |
SND_OFF="/Users/me/Music/silent.wav" | |
SND_ALIAS="/Users/me/Music/thunderbird_notify.wav" | |
HASH_ON=$(md5 -q ${SND_ON}) | |
HASH_OFF=$(md5 -q ${SND_OFF}) | |
HASH_ALIAS=$(md5 -q ${SND_ALIAS}) |
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 | |
BORDER="# -------- TEMPORARY_HOSTS --------" | |
L=$(( $(fgrep -n "${BORDER}" /etc/hosts | cut -d: -f1) + 1 )) | |
sudo sed -i.$(date +%F-%H-%M-%S) "${L},\$s/^\([^#]\)/#\1/g" /etc/hosts | |
cat /etc/hosts |
OlderNewer