玄箱いろいろ
トップ > 玄箱いろいろ
玄箱でPeerCast
こちらのページへ。
なにか
adjtick.sh
#!/bin/bash
precision_freq=24391128
dec_freq=`/bin/dmesg | /bin/sed -n "s/^decrementer frequency = \([0-9][0-9.]*\).*/\1/p"`
/sbin/adjtimex `/usr/bin/awk < /dev/null 'END {x*=10000000000;y=int(x/p);printf("-t %d -f %d\n", y, (x/p - y)*6553600);}' \
p=$precision_freq x=$dec_freq`
fanctl.sh
#!/bin/sh
#これを超えるとファン稼動
TEMPLIMIT=41
#おまけ:ログ書き出し
OUTPUT=/var/hddtemp/`date +%Y%m%d`
TEMP=`/usr/local/sbin/hddtemp -n /dev/hda`
date >> $OUTPUT
echo $TEMP C >> $OUTPUT
if [ "$TEMP" -le $TEMPLIMIT ]
then
/bin/echo -n '\\\\' > /dev/ttyS1
else
/bin/echo -n ']]]]' > /dev/ttyS1
fi
exit 0
timeron.sh
#!/bin/sh
onhour=6
onminute=30
waitminute=5
echo 'Before: '`cat /etc/melco/timer_sleep`
offhour=`date +%k`
offminute=`expr \`date +%M\` + ${waitminute}`
if [ ${offminute} -ge 60 ] ; then
offminute=`expr ${offminute} - 60`
offhour=`expr ${offhour} + 1`
if [ ${offhour} = 24 ] ; then
offhour=0
fi
fi
echo on\<\>`printf %02d ${offhour}`:`printf %02d ${offminute}`\<\>`printf %02d ${onhour}`:`printf %02d ${onminute}`\
> /etc/melco/timer_sleep
echo ' After: '`cat /etc/melco/timer_sleep`
timeroff.sh
#!/bin/sh
echo 'Before: '`cat /etc/melco/timer_sleep`
sed 's/on/off/g' /etc/melco/timer_sleep > /etc/melco/timer_sleep~
mv -f /etc/melco/timer_sleep~ /etc/melco/timer_sleep > /dev/null
echo ' After: '`cat /etc/melco/timer_sleep`
.bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ls='ls -F --color=auto'
alias eng='LANG=C LANGUAGE=C LC_ALL=C'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
PS1='\s-\v\$ '
export PS1
.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
ENV=$HOME/.bashrc
USERNAME="administrator"
export USERNAME ENV PATH
mesg n
なにか その2