Archives

You are currently viewing archive for 06 September 2007
Category: Linux tips
Posted by: hajime osako
Category: Linux tips
Posted by: hajime osako
FreeNX - Community Ubuntu Documentation
$ gksudo gedit /etc/apt/sources.list
deb http://free.linux.hp.com/~brett/seveas/freenx feisty-seveas freenx
deb-src http://free.linux.hp.com/~brett/seveas/freenx feisty-seveas freenx
$ wget http://free.linux.hp.com/~brett/seveas/freenx/seveas.gpg -O- | sudo apt-key add -
$ sudo apt-get update
$ sudo aptitude install freenx
$ sudo nxserver --adduser username
$ sudo nxserver --passwd username
$ sudo nxserver --restart
Category: Linux tips
Posted by: hajime osako
Category: Linux tips
Posted by: hajime osako

cat /var/log/messages | less <<< all the system message
cat /var/log/boot.log | less <<< boot log
dmesg -n 1 <<< all panic message at boot time by rc.sysinit
/proc システムの状態
procinfo /procのサマリー表示
vmstat 秒数 メモリやディスクの利用状況
last ログインしたユーザの履歴
w 現在ログインしているユーザ
lastlog show login info by user
top プロセスの監視
ps aux 実行中のプログラム eg. ps aux | grep service
ps axo user,pid,ppid,tty,start,time,command | grep agent | grep -v grep
ps -ef 実行中のプログラム
ps f -a hierarchical view of the parent-child relationships
ps -l shows more detailed information
pstree
uptime CPUの負荷をチェック
netstat -an 通信の調査
lsof オープンファイルの確認
lsof -i -n オープンポートとプロセスの対応を確認
lsof -i:22 -n 指定した番号のポートをオープンしているプロセスの確認
lsof -u(ログイン名orID) ログイン名 or ユーザーIDを指定
find / -type f \( -perm -u+s -o -perm -g+s \) -ls 不審なファイルのチェック
find / -type f -perm -04000 -ls 不審なファイル(SUID)のチェック
find / -perm +6000 -exec ls -l {} \; SUID or SGID
du カレントフォルダ内の使用量
(eg. du -ha /home | grep '^[0-9]\{3,\}M': find more than 100MB in home)
df ディスクの状態
(eg. df -i: check inode usage, df -l: check local filesystems only)
hdparm -ft /dev/sda1 sda1にベンチマークテスト
dumpe2fs -h Show the file system parameters
fsck デバイス(HDD)のチェック(使用前にはumountが必須、設定を変更するには tune2fs)
-A: All file system
-C: Progress bars
-N: Dry run
-V: Verbose output
-a Noninteractive
makebootdisk [kernel version] <<< uname -r
fdisk -l <<< To see /dev info
pnpdump <<< viwe isa p&p
file <<< determin file type
# file tree*.rpm <<< check RPM’s architecture
# file /etc/* | grep empty <<< find all the empty file
# uname -a Linuxのバージョンチェック
# cat /proc/version
Category: Linux tips
Posted by: hajime osako
Linux check memory usage
$ top
$ vmstat
$ free -m -t
Category: Linux tips
Posted by: hajime osako
How to mount a remote ssh filesystem using sshfs Ubuntu Blog

$ sshfs -o transform_symlinks example.com:/stuff /media/home-pc
$ fusermount -u /media/home-pc