20091027

[轉載]噗浪(plurk)共同創辦人雲維彬分享的創業心得

原出處:http://alvinwoon.com/dev/speech.html Alvin Woon, Plurk (plurk創辦人,雲維彬)
http://alvinwoon.com/dev/speech.html

* Don't worry about money. Make something that people want. And that is so much harder

真正需要關注的是如何讓使用者獲得更好的以及真正需要的,不能只是一味的想要"賺錢"

* Release early and iterate

快點放手去做,就可以快點發現錯誤,並即時修正錯誤,經歷這樣的過程是非常重要的

* Be pragmatic. Don't get too attached with your original idea

別一直執著於原本的計畫,因為也許在開始就走錯了方向

* The biggest risk is the risk of not doing anything at all. What's the worst can happen?

不願意改變現狀比嘗試新事物來的更為危險

* Be persistent. Ignore hype or baseless criticism (they are just jealous)

堅持自己,別理會那些耳語以及不實的評論(他們只是在忌妒你)

* Startup takes over your life. It's an emotional rollercoaster

創業一旦啟動將會佔據你所有的生命

* Co-founders are important

說服一個人一起合作,若連一起合作的夥伴都無法說服,更別說要打動其他人。此外,不要自己一個人悶頭做,因為很多想法是需要多方思考的

* Don't worry about clones or competition

別在意那些模仿、比較,別把時間放在關心別人在做些甚麼,把自己做好才是最重要的

* Hire someone who is smarter than you

別吝嗇花錢雇用一個優秀的人才,並好好照顧他

* Have fun!

一定要快樂!

from http://www.nciku.com.tw/space/space.php?uid=6&do=blog&id=2895&cid=13197

20091014

很有用但是常常忘記的指令(我會常常更新的)

幹~~~我真的是超健忘的
以下就是我常用卻又很重要的指令
#1 用mutt login 到localhost的imap
mutt -f imap://user@localhost
#2 用du show /home/* 的使用量不包含子目錄內
# -s, --summarize display only a total for each argument
du -s /home/*
du -s /home/*|sort -nr 這個就比較有威力了吧
du -s /home/*|sort -nr|awk -F\ '{ print $1}' #這個是萃取容量大小的欄位
#3 網路校時
ntpdate tock.stdtime.gov.tw && /sbin/hwclock -w
#4 DNS Query
dig
dig [@server] [FQDN] [type]
dig yahoo.com.tw MX #使用你預設的DNS查詢yahoo.com.tw的MX
dig 168.95.1.1 yahoo.com.tw NS #使用CHT的DNS查詢yahoo.com.tw的NS
#5 去除重複
uniq
cat afile.txt | sort | uniq >> bfile.txt
sort -u 也可以做到uniq
#6 壓縮/解壓縮
壓縮
tar -zcvf filename.tar.gz /path/target
解壓縮
tar -zxvf filename.tar.gz
檢視壓縮內的檔案內容
tar -ztvf filename.tar.gz
#7 數值運算
bash做數值運算
echo "(865999.1/1024000.2)*100"|bc -l
echo "$(echo "scale=3; 8900000/1000000"|bc -l)"
#8 ls 按照時間排序
ls -alr --time-style=long-iso --sort time|less
#9 dig 反解
dig -x x.x.x.x
#10 Query目錄內檔案或目錄絕對路徑
檔案的絕對路徑
find /home/10946/ -type f
目錄的絕對路徑
#11 顯示encodeing Base64的中文字
perl -MMIME::Base64 -MEncode=decode -n -00 -e 's/\n //g;s/(?<=:: )(\S+)/decode("UTF-8",decode_base64($1))/eg;print'
使用方式是加在pipe後面
from perlmonks.org
#12 加總來自非公司內部的信件容量
awk '/: from=</ && !/taiyi/ { print $8}' /var/log/mail.log|awk -F"size=" '/[0-9]/ { sum+=$2} END {print sum/1024/1024}'
#13 LVM
lvcreate -L 9G -n root vgpoollvcreate -l 100%FREE -n swap vgpoollvextend -l +100%FREE /dev/vgpool/root





20090930

Postfix 如何備份所有進出的信件??

在 postfix 的 main.cf 裡加上:
recipient_bcc_maps = hash:/etc/postfix/recipient_bcc
sender_bcc_maps = hash:/etc/postfix/sender_bcc

然後編輯 recipient_bcc 跟 sender_bcc
格式很簡單, 如果帳號是 foo 要備份到 bar 就直接打
foo bar
即可, 一行一行加進去就行, 不備份的就不加了,
另外也可以把所有帳號的郵件都備份到 bar 裡面.

記得檔案編完要下 postmap 指令轉一下 table

ps. 好像要較高版本 (2.2?) 的 postfix 才有這個功能,
答案來自EarlyCAT

參考網址酷學院討論串

20090515

Sony GPS-CS1 log file to kml or to gpx or more

之前最令我頭痛的CS1產出的Log檔都苦無一個可以轉出多種格式的軟體
直到最近車友Hoya姐在200904的時候去環島了所以跟我借CS-1去用
回來的時候當然是一堆Log File
所以又是頭痛的開始...
之前我都是呆呆的用http://www.gpsvisualizer.com/ 這個網站去轉換我的log
但是之前在用的時候log file是只有1~2個但是這次15個...
不多...但是我的懶人病+好奇心發作所以Google了一下關鍵字GPS-CS1 to gpx
找到了...這個blog
http://shlinho.spaces.live.com/blog/cns!20A717814D948327!538.entry
這個Blog的這篇剛好有我需要的答案
http://www.gpsbabel.org/
這個軟體真的不錯用...可以把我的log轉成許多格式
重點是...他有GUI & command二種操作方式來轉換你的log

GPSBabel 讚。

20090417

Ubuntu reconfig ldap

Ubuntu apt-get install slapd ... ...時
會針對你給他的domain name 設定一個dn=(你的domain name)
若這不是你要的dn的話,這就糗了...到底要去哪裡reconfig啊...
呵...Google真的很厲害
keyword ubuntu reconfig ldap
方法如下
# dpkg-reconfigure slapd
接下來就是...依照他詢問的問題回答答案了
祝你成功~~~

ubuntu disables 'MARK' messages

暗~~~
每次看到syslog裡面都有很多 --MARK--就不爽
google ubuntu disables 'MARK' messages

方法1如下
#vi /etc/syslog.conf

SYSLOGD="-m 0" #加入這一段

#/etc/init.d/sysklogd restart

方法2如下
#vi /etc/defaults/syslogd

SYSLOGD=”-m 0″ #修改這個參數

#/etc/init.d/sysklogd restart

大功告成...結束讓人看到就不爽的 --MARK--
暗~~~林北宋啦!

20090313

[轉載]在PHP中,變數名稱為動態變化時的程式寫法

請看下方程式碼:

$xyz1="abcd1";

$xyz2="abcd2";

$xyz3="abcd3";

$xyz4="abcd4";

$xyz5="abcd5";

$k="xyz";

for($i=0;$i<=5;$i++) {
echo ${($k.$i)}."
"; }


結果

abcd1

abcd2

abcd3

abcd4

abcd5

以上解決了所謂變數名稱為動態變化的問題,此種程式寫法可以省下很多的時間。

轉載自 ur88的blog
謝謝ur88

20090204

Debian Apache2 設定新的 VirtualHost restart 後出現 Error msg

今天我在弄Apache的時候發現
當我在/etc/apache2/sites-enabled,新增一台VirtualHost
conf都修改好後Restart service時系統回應
[warn] NameVirtualHost *:0 has no VirtualHosts
但是該VirtualHost是可以被瀏覽的,但是每次都看到這個msg真的覺得很不爽
所以google了一下NameVirtualHost、"[warn] NameVirtualHost *:0 has no VirtualHosts"
這二個關鍵字
發現NameVirtualHost後面要帶port的值
也要帶port的值
所以會長這個樣子

NameVirtualHost *:80
<VirtualHost *:80>
...
</VirtualHost>

之後Restart Service就不會在出現該msg了
呵...整個人都爽起來了...

20090112

TestDisk

TestDisk is OpenSource software and is licensed under the terms of the GNU Public License (GPL).

TestDisk is a powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy.

TestDisk can

* Fix partition table, recover deleted partition
* Recover FAT32 boot sector from its backup
* Rebuild FAT12/FAT16/FAT32 boot sector
* Fix FAT tables
* Rebuild NTFS boot sector
* Recover NTFS boot sector from its backup
* Fix MFT using MFT mirror
* Locate ext2/ext3 Backup SuperBlock
* Undelete files from FAT, NTFS and ext2 filesystem
* Copy files from deleted FAT, NTFS and ext2/ext3 partitions.

TestDisk has features for both novices and experts. For those who know little or nothing about data recovery techniques, TestDisk can be used to collect detailed information about a non-booting drive which can then be sent to a tech for further analysis. Those more familiar with such procedures should find TestDisk a handy tool in performing onsite recovery.

Operating systems

TestDisk can run under

* DOS (either real or in a Windows 9x DOS-box),
* Windows (NT4, 2000, XP, 2003, Vista),
* Linux,
* FreeBSD, NetBSD, OpenBSD,
* SunOS and
* MacOS

Source files and precompiled binary executables are available for DOS, Win32, MacOSX and Linux from the download page

Filesystems

TestDisk can find lost partitions for all of these file systems:

* BeFS ( BeOS )
* BSD disklabel ( FreeBSD/OpenBSD/NetBSD )
* CramFS, Compressed File System
* DOS/Windows FAT12, FAT16 and FAT32
* HFS, HFS+ and HFSX, Hierarchical File System
* JFS, IBM's Journaled File System
* Linux ext2 and ext3
* Linux LUKS encrypted partition
* Linux RAID md 0.9/1.0/1.1/1.2
o RAID 1: mirroring
o RAID 4: striped array with parity device
o RAID 5: striped array with distributed parity information
o RAID 6: striped array with distributed dual redundancy information
* Linux Swap (versions 1 and 2)
* LVM and LVM2, Linux Logical Volume Manager
* Mac partition map
* Novell Storage Services NSS
* NTFS ( Windows NT/2000/XP/2003/Vista/2008 )
* ReiserFS 3.5, 3.6 and 4
* Sun Solaris i386 disklabel
* Unix File System UFS and UFS2 (Sun/BSD/...)
* XFS, SGI's Journaled File System

轉載自 http://www.cgsecurity.org/wiki/TestDisk