2013年4月5日星期五

Windows Run Command

Via: Run... Command / Windows / Computer Productivity
記錄一下常用的Run命令:
  • cmd
  • taskmgr
  • appwiz.cpl
  • compmgmt.msc
  • osk
  • regedit
  • control
    • netconnections
    • printers
  • intl.cpl

2013年2月25日星期一

Ubuntu LiveCD boot to ram

實驗完發現原來不是改這個檔案的,暫時按F6。
以後再看
++++++

這裏看到
原來修改boot/grub/grub.cfg入面linux那一行
給kernel傳一個參數:toram
比如改成這樣:
...
menuentry "Try Ubuntu without installing" {
 set gfxpayload=keep
 linux /casper/vmlinuz.efi.signed  file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash toram --
 initrd /casper/initrd.lz
}
...
就可以把root加載到內存,然後執行甚麼都會超級快~
應該開機以後把USB拔下也依然能繼續跑的

ToKyo-JuPiTer: Gentoo mount internal disk without root

上篇講到mount internal disk的權限其實是polkit控制的 但是Gentoo預設是需要root權限 如果直接修改action的xml每次升級都會變回來 而真正的設定檔案其實是在/etc/polkit-1/rules.dGentoo wiki便有寫 加入檔案/etc/polkit-1/rules.d/10-udisks.rules:
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.udisks.filesystem-mount-system-internal" &&
        subject.user == "username") {
        return "yes";
    }
});
這樣便可 也可以直接修改admin group為wheel 加入檔案/etc/polkit-1/rules.d/10-admin.rules:
polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});


PS Gentoo改版以後界面變漂亮了~ 終於不再是那個超簡陋的、看上去很不專業的wiki


++++++
原來是wiki少了一個括號,直接return yes則不用輸入密碼。
admin group應該是需要輸入密碼確認的。

2013年1月24日星期四

MacPorts sync失敗

一直都覺得MacPorts sync太慢總時失敗,可能是rsync比較容易timeout的原因
找到官方文檔,原來可以用Tarball下載每天自動打包的Port Tree
配置方法超容易,修改$prefix/etc/macports/sources.conf
#rsync://rsync.macports.org/release/ports/ [default]
http://www.macports.org/files/ports.tar.gz [default]
把原本的rsync一行改成透過http下載的tarball
由於我不是經常地同步port tree,偶爾才升級一下。
每天打包的tarball比較適合我

2013年1月11日星期五

Linux系統工具


Linux System monitor tools:

htop - (top)interactive process viewer.
vmstat - Report virtual memory statistics.
w - Show who is logged on and what they are doing.
uptime - Tell how long the system has been running.
ps - report a snapshot of the current processes.
free - Display amount of free and used memory in the system.
iostat
sar
mpstat
pmap - report memory map of a proces.
ss - another utility to investigate sockets.
tcpdump - dump traffic on a network.
strace - trace system calls and signals.
/proc - cpuinfo, meminfo, zoneinfo, mounts
Nagios - Network monitoring application.
Cacti - web-base monitoring application.
lsof - list open files.

sysstat package:

iostat
sar
mpstat

iprout package:

ip
ss
tc

few more tools:

nmap
lsof
ntop
conky / GkrellM
vnstat
mtr
iptraf
nmon - system monitor tools


Traffic Monitor / Networking testing

There are some useful tools: vnstat can report the transfered data and transfer rate. mtr can trace route path with ping together, useful for finding the traffic neck. ss is the successor of netstat, much more efficient and faster.

nmap, a scanning tool. ntop, network traffic reporter.

sar can do:

Collective CPU usage
Individual CPU statistics
Memory used and available
Swap space used and available
Overall I/O activities of the system
Individual device I/O activities
Context switch statistics
Run queue and load average data
Network statistics
Report sar data from a specific time
and lot more..

2012年11月5日星期一

ToKyo-JuPiTer: Ubuntu版本號

以前寫過關於ToKyo-JuPiTer: Ubuntu版本號的文章
現在找到了官方關於開發代號(DevelopmentCodeNames)的wiki
有齊歴史的開發代號,如果想看Release也有官方的wiki。可以查看Release Note

2012年10月13日星期六

修改分區標簽

先講ext2/3/4,建立分區時其實可以指定分區標簽的:
$ sudo mkfs.ext4 -L "LABEL" /dev/sdz99
如果想日後修改分區標簽,最簡單的就是用e2label
$ sudo e2label /dev/sdz99 "NEW_LABEL"
還有個tune2fs可以用的,具體自行研究。

想修改FAT文件系統的標簽一樣可以:
$ sudo dosfslabel /dev/sdz99 "NEW_LABEL"
要修改xfs的話則用:
$ sudo xfs_admin -L "NEW_LABEL" /dev/sdz99
xfs還有提供一堆有用的工具,比如:
xfs_fsr可以做線上重組,對一個已掛載的分區做碎片重組
xfsdump備份整個分區,可以做增量備份和分割備份。
好像ext4也有提供一些類似的工具

SEO: partition label xfs ext3 ext4 fat ntfs

2012年10月9日星期二

SSH反向連接

#!/bin/bash

function line()         {
while [ ! -f /tmp/stop ];
do ssh -o ExitOnForwardFailure=yes -R 4334:localhost:22 user@remotehost.com "while netcat -zv localhost 4334; do sleep 300; done";
sleep 5;
done
}

line &


ssh有個很好用的能力,就是建立反向連接。
之前有講過ssh的tunnel,反向連接有點類似但是方向相反。
先看代碼:
$ ssh -N -L 4334:localhost:4334 user@remotehost.com &
這樣就可以把localhost的4334port反向連接到remotehost的4334,有點神奇的。
向remotehost4334port建立的連接等同於連接到localhost

熱門文章