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 | |
# script command front end to add time stamp to the script | |
case $# in | |
0) PREFIX="";; | |
*) PREFIX="$1-";shift; | |
esac | |
exec script $PREFIX`date '+%Y-%m%d-%H%M%S'`.script $* |
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
# Display progress blip on console | |
def blip_reset(ratio1 = 100, ratio2 = nil) | |
@blip_count = 0 | |
@blip_ratio1 = ratio1 | |
@blip_ratio2 = ratio2 | |
if @blip_ratio2 == nil | |
@blip_ratio2 = ratio1 * ratio1 | |
end | |
end |
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
# Converting hexadecimal string (like: '001122deadbeaf') | |
# into binary string and vice-versa | |
def binary2hexstring(b) | |
b.unpack("H*")[0] | |
end | |
def hexstring2binary(h) | |
h.scan(/([0-9a-fA-F][0-9a-fA-F])/).collect{|v| v[0].hex.chr }.join |
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
# CentOS-Base.repo | |
# | |
# This file uses a new mirrorlist system developed by Lance Davis for CentOS. | |
# The mirror system uses the connecting IP address of the client and the | |
# update status of each mirror to pick mirrors that are updated to and | |
# geographically close to the client. You should use this for CentOS updates | |
# unless you are manually picking other mirrors. | |
# | |
# If the mirrorlist= does not work for you, as a fall back you can try the | |
# remarked out baseurl= line instead. |
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 | |
# Script to update all ports and clean old builds | |
# Uncomment following to make build process noisier | |
#VERBOSE=-v | |
(for i in "sync" "selfupdate" "clean --dist outdated" "-p upgrade outdated" "-u | |
uninstall" | |
do | |
echo echo \'"==> port $i"\' |
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 | |
# | |
# Open text editor Emacs with given file name. If no Emacs running, it launches | |
# automatically on MacOS X. | |
# | |
# save this file as whatever filename you like (I'm using 'e'), put in somehere | |
# in the path (I use ${HOME}/bin), make it executable (chmod +x e) then 'hash -r' or 'rehash' | |
# | |
if [ -x /usr/bin/open ]; then # may be MacOS | |
/usr/bin/open -a Emacs $* |
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 | |
# | |
# hack to turn-off Head Up Display of Input methods on MacOS X | |
# (see http://bit.ly/1G8mal for detail) | |
# You need to run only once. Possibly need to logoff/login or reboot. | |
# | |
sudo defaults write /System/Library/LaunchAgents/com.apple.tiswitcher Disabled -bool yes |
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
./apps/apps.c:double app_tminterval(int stop,int usertime) | |
./apps/apps.c: double ret=0; | |
./apps/apps.c:double app_tminterval(int stop,int usertime) | |
./apps/apps.c: double ret=0; | |
./apps/apps.c: else ret = (clock()-tmstart)/(double)CLOCKS_PER_SEC; | |
./apps/apps.c:double app_tminterval(int stop,int usertime) | |
./apps/apps.c: double ret=0; | |
./apps/apps.c: else ret = (now - tmstart)/(double)sysClkRateGet(); | |
./apps/apps.c:double app_tminterval(int stop,int usertime) | |
./apps/apps.c: double ret = 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
bench.h:extern const double CLOCK_TICKS_PER_SECOND; | |
bench.h:void BenchmarkAll(double t, double hertz); | |
bench.h:void BenchmarkAll2(double t, double hertz); | |
config.h:// VC60 workaround: can't cast unsigned __int64 to float or double | |
hrtimer.h: double ElapsedTimeAsDouble(); | |
hrtimer.h: double ConvertTo(TimerWord t, Unit unit); | |
network.h: double TimeToNextTransceive(); | |
network.h: typedef std::deque<std::pair<double, lword> > OpQueue; | |
network.h: double m_nextTransceiveTime; | |
network.h: double GetCurTimeAndCleanUp(); |
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 | |
# For FreeBSD 8.x. Place this file in /etc/periodic/daily and configure via periodic.conf | |
# | |
# If there is a global system configuration file, suck it in. | |
# | |
if [ -r /etc/defaults/periodic.conf ] | |
then | |
. /etc/defaults/periodic.conf | |
source_periodic_confs | |
fi |
OlderNewer