ubuntu 7.10
sudo im-switch -z en_US -s InputMethodName
ubuntu 8.04
im-switch -z en_US -s InputMethodName
sudo im-switch -z en_US -s InputMethodName
im-switch -z en_US -s InputMethodName
sudo apt-get install xmame-sdl
xmame.SDL gamename
xmame.SDL *.zip
apt-get install streamtuner xmms
wget http://linuxdesktop.cn/downloads/gsopcast/gsopcast_0.3.1-1_i386.deb
sudo dpkg -i gsopcast_0.3.1-1_i386.deb # -i is equal to --install
sudo apt-get install mldonkey-server
# run silently in background
# mlnet &> /dev/null &
mlnet
# if run mldonkey as root, the config files would be in /var/lib/mldonkey/
vi /home/user/.mldonkey/downloads.ini
.
.
allowed_ips = [
"127.0.0.1/0";] # mask 0 allows any ip
.
.
gui_port = 4001
http_port = 4080
telnet_port = 4000
.
.
max_hard_upload_rate = 10 # global speed limiting, KB/s
max_hard_download_rate = 0 # global speed limiting, KB/s
max_hard_upload_rate_2 = 5 # for bandwidth toggle
max_hard_download_rate_2 = 20 # for bandwidth toggle
.
.
useradd admin password
telnet ip 4000
tar -zxvf xrdp-0.4.0.tar.gz
make
sudo make install
sudo /usr/local/xrdp/xrdp_control.sh start
sudo apt-get install inadyn
sudo vi /etc/inadyn.conf
--username username
--password password
--update_period 60000
--alias myhost.dyndns.org
--background
sudo crontab -e
@reboot /usr/sbin/inadyn
ssh -D port user@host
nmap ip
mysql> create database ulog;
..
plugin="/usr/lib/ulogd/ulogd_MYSQL.so" #uncomment it for use
..
[MYSQL]
table="ulog"
pass=""
user="root"
db="ulog"
host="localhost"
..
wget http://software.inl.fr/releases/Nulog/nulog-1.2.14.tar.gz
tar zxvf nulog-1.2.14.tar.gz
cd nulog-1.2.14
make install
# the two commands are totally same
cat /root/nulog-1.2.14/scripts/ulogd.mysqldump | mysql -u root -p ulog
mysql -u root -p ulog < /root/nulog-1.2.14/scripts/ulogd.mysqldump
..
if (!isset($lang))
$lang="en";
..
# database Host
$db_host="localhost";
# database name
$db_ulog="ulog";
# database user
$db_user="root";
# database password
$db_pwd="";
..
Alias /nulog/ "/usr/share/edenwall-web/nulog/" # path
..
# Authentification
# Create file /path/to/some/file with htpasswd
AuthType Basic
AuthName "Nulog access"
AuthUserFile /var/www/apache.passwd
Require user username
<Directory "/usr/share/phpmyadmin">
Order Deny,Allow
# Deny from all
Allow from all # If you want to connect it from anywhere
</Directory>
..
..
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'RANDOMTEXT'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
# -C enable compression
# -N don't start a shell/command (SSH-2 only)
# -v show verbose messages
# -ssh force use of SSH protocol
# -L [listen-IP:]listen-port:host:port
# Forward local port to remote address
plink.exe -C -N -v -ssh -L local_port:remote_ip:remote_port -l ssh_username ssh_server_ip
[global]
workgroup =
netbios name = # computer name
server string = Samba Server # description of this computer
security = user
hosts allow = 192.168.1. # restrict access
load printers = yes
cups options = raw
log file = /var/log/samba/%m.log # %m = netbios name of clients
max log size = 50
dns proxy = no
[homes]
comment = Home Directories # description
browseable = no # is in the browse list
writable = yes
valid users = %S # %S = replace the text within []
[printers]
comment = All Printers
path = /usr/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
[tmp]
comment = Temporary file space
path = /tmp
read only = no
public = yes # is seen or not by anyone
[sample]
path = /home/sample
public = no
valid users = @users # @ = group
write list =
<?xml version='1.0'?>
<antinatconfig>
<!-- Any interface -->
<interface value='0.0.0.0'/>
<!-- Port to listen on -->
<port value='1080'/>
<!-- Allow users to be authenticated against UNIX usernames -->
<allowlocalusers/>
<!-- Time in seconds to listen for outside incoming connections when
applications request a BIND operation before timeout -->
<maxbindwait value='60'/>
<!-- demonstration user account -->
<!-- <user user='testuser' password='testpass'/> -->
<!-- What logs should we keep? -->
<log>
<addrdaylog value='/var/log/antinat/day_addr.log'/>
<userdaylog value='/var/log/antinat/day_user.log'/>
<connlog value='/var/log/antinat/connection.log'/>
</log>
<!-- What security methods do we offer clients? -->
<authchoice source_addrtype='ipv4'>
<select mechanism='chap'/>
<select mechanism='cleartext'/>
</authchoice>
<!-- Which connections should we accept or reject? -->
<filter>
<filter source_addrtype='ipv4' dest_addrtype='ipv4'>
<filter user='root'>
<reject/>
</filter>
<filter version='4'>
<reject/>
</filter>
</filter>
<accept/>
</filter>
</antinatconfig>
#-p, --parents, make parent directories as needed
mkdir -p /var/cache/ddclient
rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# smartmontools
# -a, -all: Prints all SMART information about the disk
/usr/sbin/smartctl -a /dev/<device>
# hdparm - get/set hard disk parameters
/sbin/hdparm /dev/<device>
..
CLAMPMSS=no
..
echo "1" > /proc/sys/net/ipv4/ip_forward
sudo vi /etc/sysctl.conf
--
..
net.ipv4.ip_forward=1
..
sudo sysctl -p # load sysctl settings
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_conntrack_irc
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.1.0/24 -j MASQUERADE
./configure --prefix=/usr --enable-webserver --enable-amulecmd --enable-amule-daemon --enable-cas --enable-wxcas --enable-alc --enable-alcc
make # It takes much long time
make install
yum install rar unrar
at 23:00 2005-09-15
at> /usr/local/bin/alarm
at> ..
at> # multiple commands can be executed at same time
at> ..
at> <EOT> # pressing CTRL + D means save and exit
atq #lists the user's pending jobs
cd /var/spool/moblock/cache/dl/
wget http://www.bluetack.co.uk/config/level1.gz
# stop service first
/sbin/service moblock stop
#after updating /etc/moblock/lists or whitelist
/etc/cron.daily/moblock reload
#start MoBlock
/sbin/service moblock start
FooBar, inc:192.0.34.164-192.0.34.168
^FooBar, inc:192\.0\.34\.164-192\.0\.34\.168$
./configure
make
make install
make
make install
# find various blocklist from
# http://www.bluetack.co.uk/forums/index.php?act=dscriptca&CODE=viewcat&cat_id=4
http://www.bluetack.co.uk/config/level1.gz
#!/bin/sh
#
# moblock This shellscript takes care of starting and stopping moblock.
#
# chkconfig: 345 30 70
# description: MoBlock is a application that enables you to block internet \
# traffic based on large lists of ip address ranges in order to \
# protect your privacy.
# processname: moblock
#
ACTIVATE_CHAINS=1
MODE="nfq"
WHITE_TCP_IN=""
WHITE_UDP_IN=""
WHITE_TCP_OUT="21 22 80 110 443"
WHITE_UDP_OUT="123"
WHITE_TCP_FORWARD=""
WHITE_UDP_FORWARD=""
PIDF="/var/run/moblock.pid"
LIST="/etc/moblock/guarding.p2p"
PRG="moblock"
LOG="/var/log/$PRG"
BIN="/usr/bin/$PRG"
CMD="$BIN -p $LIST $LOG >/dev/null &"
# Source function library.
. /etc/rc.d/init.d/functions
fail () {
failure "$2"
echo
[ -n "$1" ] && echo "$1"
}
iptables_init () {
if [ $MODE == "ipq" ]; then
modprobe ip_queue
TARGET="QUEUE"
elif [ $MODE == "nfq" ]; then
modprobe ipt_NFQUEUE
TARGET="NFQUEUE"
fi;
modprobe ipt_state
iptables -N MOBLOCK_IN
iptables -N MOBLOCK_OUT
iptables -N MOBLOCK_FW
if [ $ACTIVATE_CHAINS -eq 1 ]; then
iptables -I INPUT -p all -m state --state NEW -j MOBLOCK_IN
iptables -I OUTPUT -p all -m state --state NEW -j MOBLOCK_OUT
iptables -I FORWARD -p all -m state --state NEW -j MOBLOCK_FW
fi;
iptables -I MOBLOCK_IN -p all -j $TARGET
iptables -I MOBLOCK_OUT -p all -j $TARGET
iptables -I MOBLOCK_FW -p all -j $TARGET
for PORT in $WHITE_TCP_OUT; do
iptables -I MOBLOCK_OUT -p tcp --dport $PORT -j ACCEPT
done
for PORT in $WHITE_UDP_OUT; do
iptables -I MOBLOCK_OUT -p udp --dport $PORT -j ACCEPT
done
for PORT in $WHITE_TCP_IN; do
iptables -I MOBLOCK_IN -p tcp --dport $PORT -j ACCEPT
done
for PORT in $WHITE_UDP_IN; do
iptables -I MOBLOCK_IN -p udp --dport $PORT -j ACCEPT
done
for PORT in $WHITE_TCP_FORWARD; do
iptables -I MOBLOCK_FW -p tcp --dport $PORT -j ACCEPT
done
for PORT in $WHITE_UDP_FORWARD; do
iptables -I MOBLOCK_FW -p udp --dport $PORT -j ACCEPT
done
# Loopback traffic fix
iptables -I INPUT -p all -i lo -j ACCEPT
iptables -I OUTPUT -p all -o lo -j ACCEPT
}
iptables_reset () {
if [ $ACTIVATE_CHAINS -eq 1 ]; then
iptables -D INPUT -p all -m state --state NEW -j MOBLOCK_IN
iptables -D OUTPUT -p all -m state --state NEW -j MOBLOCK_OUT
iptables -D FORWARD -p all -m state --state NEW -j MOBLOCK_FW
fi;
iptables -D INPUT -p all -i lo -j ACCEPT
iptables -D OUTPUT -p all -o lo -j ACCEPT
iptables -F MOBLOCK_IN
iptables -X MOBLOCK_IN
iptables -F MOBLOCK_OUT
iptables -X MOBLOCK_OUT
iptables -F MOBLOCK_FW
iptables -X MOBLOCK_FW
}
start () {
echo -n $"Starting MoBlock: "
if ! [ -x $BIN ]; then
fail "Can't execute $BIN" "$PRG startup"
return 1
fi;
if ! [ -f $LIST ]; then
fail "Can't find $LIST" "$PRG startup"
return 1
fi;
if [ -f $PIDF ]; then
PID=`cat $PIDF`
if ps -p $PID >/dev/null; then
fail "$PIDF exists and $PRG is running." "$PRG startup"
return 1
fi;
fi;
iptables_init
daemon "$CMD"
RETVAL=$?
echo
return $RETVAL
}
stop () {
echo -n $"Stopping MoBlock: "
killproc -p "$PIDF" "$PRG"
RETVAL=$?
echo
if ! pidof "$PRG"; then
iptables_reset 2>/dev/null 1>&2
fi;
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
if [ -f $PIDF ]; then
kill -HUP `cat $PIDF`
RETVAL=$?
fi
;;
restart)
stop
start
RETVAL=$?
;;
condrestart)
# restart only if already running
if [ -f $PIDF ]; then
stop
start
RETVAL=$?
fi
;;
status)
status $PRG
RETVAL=$?
;;
top)
if [ -f $PIDF ]; then
a=""
for i in `pidof $PRG`; do
a="$a -p $i"
done
top $a
fi
;;
*)
echo $"Usage: $0 {start|stop|reload|restart|condrestart|status|top}"
exit 1
esac
exit $RETVAL
#!/bin/bash
LURLS="/etc/moblock/lists"
WLIST="/etc/moblock/whitelist"
LIST="/etc/moblock/guarding.p2p"
CACHE="/var/spool/moblock/cache"
FMD5=".md5sum"
DLDIR="dl"
RELOADCMD="/sbin/service moblock reload"
acat () {
while read -r -d $'\0' fn; do
if [ "$(head -c 2 "$fn")" = $'\x1f\x8b' ]; then
gunzip -c "$fn"
elif [ "$(head -c 4 "$fn")" = $'\x50\x4b\x03\x04' ]; then
unzip -p "$fn"
else
cat "$fn"
fi
done
}
download () {
MD5SUM=`md5sum "$LURLS" | cut -c -32`
if [ -f "./$FMD5" ]; then
if [ `cat "$FMD5"` != $MD5SUM ]; then
# The list source file has changed.
# Clean the dl directory.
rm "./$DLDIR"/*
fi;
elif [ `ls -A . | wc -l` -gt 0 ]; then
# There's no md5 file, but the directory is not empty.
# Something's wrong, bail out.
echo "$(pwd) is not empty." >/dev/stderr
exit 1
fi;
echo $MD5SUM >"./$FMD5"
wget -nv -N -t 3 -w 1 -T 120 -P "./$DLDIR" -i "$LURLS"
}
reload () {
find "./$DLDIR" -type f -print0 | acat | dos2unix | nice uniq | \
(nice grep -a -v -f "$WLIST" 2>/dev/null || cat) >"$LIST"
$RELOADCMD
}
if ! [ -f "$LURLS" ]; then
echo "Can't find $LURLS" >/dev/stderr
exit 1
fi;
mkdir -p "$CACHE"
pushd "$CACHE" >/dev/null || exit 1
case "$1" in
reload | nodownload)
reload
;;
'' | download)
download
reload
;;
*)
echo $"Usage: $0 [reload]"
exit 1
esac
popd >/dev/null
/etc/cron.daily/moblock
/sbin/chkconfig --add moblock
/sbin/iptables -I RH-Firewall-1-INPUT -p tcp --dport 4662 -j ACCEPT
/sbin/iptables -I RH-Firewall-1-INPUT -p udp --dport 4665 -j ACCEPT
/sbin/iptables -I RH-Firewall-1-INPUT -p udp --dport 4672 -j ACCEPT
/sbin/service iptables save
/etc/init.d/iptables restart
use=web # via web
login= # default login
password= # default password
##
## dyndns.org dynamic addresses
##
## (supports variables: wildcard,mx,backupmx)
##
server=members.dyndns.org, \
protocol=dyndns2 \
yours.dyndns.org
# dom = Day of Month
# dow = Day of Week
# m h dom mon dow command
42 07 * * 1-5 /usr/local/bin/alarm
# run xterm to execute mplayer in another window
# with the parameter, display 0 you can quit playing easily,
# the parameter -loop 0 means repeat forever.
/usr/bin/xterm -display :0 -bg black -fg white \
-e /usr/local/mplayer -loop 0 filename.mp3
/usr/bin/mplayer -loop 0 filename.mp3
pkill mplayer
# Build the binary rpm
rpmbuild -bb msttcorefonts-2.0-1.spec
# Install the newly built rpm (you will need to be root):
rpm -ivh $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
# Reload the X font server
/sbin/service xfs reload
/usr/share/fonts: failed to write cache
/usr/share/fonts/encodings/large: failed to write cache
/usr/X11/share/fonts: failed to write cache
/usr/X11/share/fonts/encodings/large: failed to write
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- conf.d/myfont.conf -->
<fontconfig>
<dir>/usr/share/fonts</dir>
<dir>/usr/share/fonts/local</dir>
<dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
<!--加入點陣字體路徑-->
<dir>/usr/X11R6/lib/X11/fonts</dir>
<!--所有字型預設樣式-->
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign">
<bool>false</bool>
</edit>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
</match>
<!--打開中文粗體-->
<match target="font">
<test name="family" compare="contains">
<string>Song</string>
<string>Sun</string>
<string>Kai</string>
<string>Ming</string>
</test>
<test compare="more_eq" target="pattern" name="weight">
<int>180</int>
</test>
<edit mode="assign" name="embolden">
<bool>true</bool>
</edit>
</match>
<!-- 關閉小字AA -->
<match target="font">
<test name="pixelsize" compare="less">
<double>12</double>
</test>
<edit name="antialias" mode="assign">
<bool>false</bool>
</edit>
</match>
<!-- 關閉宋體、明體小字AA -->
<match target="font">
<test name="family" compare="contains">
<string>Song</string>
<string>Sun</string>
<string>Ming</string>
</test>
<test name="pixelsize" compare="less_eq">
<double>20</double>
</test>
<edit name="antialias" mode="assign">
<bool>false</bool>
</edit>
</match>
<!-- 解決中文字體英文間距過寬 -->
<match target="font">
<test target="pattern" name="lang" compare="contains">
<string>zh-tw</string>
<string>zh-cn</string>
<string>ja</string>
<string>ko</string>
</test>
<edit name="spacing">
<const>proportional</const>
</edit>
<edit name="globaladvance">
<bool>false</bool>
</edit>
</match>
<!--設定中文最小字號-->
<match target="font" >
<test name="family" compare="contains">
<string>Song</string>
<string>Sun</string>
<string>Kai</string>
<string>Ming</string>
</test>
<test name="pixelsize" compare="more_eq">
<double>8</double>
</test>
<test name="pixelsize" compare="less_eq">
<double>12</double>
</test>
<edit name="pixelsize" compare="eq">
<double>12</double>
</edit>
</match>
<!--適應中文用戶的用字習慣-->
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
<family>Bitstream Vera Serif</family>
<family>Times New Roman</family>
<family>Times</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>Kochi Mincho</family>
<family>UnBatang</family>
<family>Baekmuk Batang</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
<family>Bitstream Vera Sans</family>
<family>Lucida Grande</family>
<family>Helvetica</family>
<family>Arial</family>
<family>Verdana</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>Kochi Gothic</family>
<family>UnDotum</family>
<family>Baekmuk Dotum</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Bitstream Vera Sans Mono</family>
<family>Andale Mono</family>
<family>Courier New</family>
<family>Courier</family>
<family>AR PL New Sung Mono</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>Kochi Gothic</family>
<family>Baekmuk Dotum</family>
</prefer>
</alias>
<alias>
<family>新細明體</family>
<prefer>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
</prefer>
</alias>
<alias>
<family>標楷體</family>
<prefer>
<family>AR PL New Kai</family>
<family>AR PL KaitiM Big5</family>
<family>AR PL KaitiM GB</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
</fontconfig>
root# installpkg gcin-1.3.3-i686-1.tgz
amule: error while loading shared libraries: libbfd-2.17.50.0.15.20070418.so: cannot open shared object file: No such file or directory
--
ln -s libbfd-2.17.50.0.16.20070511.so libbfd-2.17.50.0.15.20070418.so