WWDC,SummerCamp,Survey,软设答辩会,UWeb评选,花旗杯,网络部,newEra,Starbucks,软件中国,twitter,學大漢武立國,图书馆,小观园,空调,Apple Studio,强生,高考,”惟楚有才,此地为盛”,施工,搬家,滨城,考期,毕业,牛奶,菠萝吐丝,蛋白粉,速溶咖啡,速冻水饺,吉祥馄饨,烧麦,某四,世界环境日,聚餐,data recoverary,晨曦

– via my iPhone

, , , , , , , ,

前天GFW发威;昨天学校里发生持枪劫持人质,国内各大站”因故”陆续维护;今天中国”伞兵”扬名世界.

人生在于折腾,我已经在4种操作系统上至少为3人的机器架了梯子翻墙.

—-

Blocked之后仍活跃在twitter上的中国大陆用户,都应算是活跃的核心用户,昨天下午一口气follow了不少人.

乱推中认识了一个Geek学长,还有人推荐了一家Geek商店:GeekCook,进去看了一下有些衣服感觉还是挺对味的,等着过冬了可以考虑去购身卫衣套装.

, , ,

    Mac Pro

  • 上次更新意外断电导致启动异常,重装Mac OS X Server
  • 还原备份的DNS和Open Directory配置
    iMac 31

  • 修改/etc/hosts,添加twitter的ip以翻墙
  • 添加Coda和Textmate


今天开着iTunes跑mp3,看着侧栏的genius bar让我联想到了Mac Retail里的Genius Bar,心血来潮想去了解里面这帮Mac Genius主要负责做什么.在Apple China找到了答案:

Mac Genius

如果你喜欢把东西拆开,再把它们正确地组装起来,那么,你就是我们所寻找的专家,我们想要和你谈谈。如果你曾是那种把东西拆开只为了再把它们(正确地)组装起来的年轻人,那么,我们想要和你谈谈。你就是我们所寻找的专家。

主要职责:

向顾客提供苹果产品的售前/售后服务。 在专家台为顾客提供服务以及修理/维护计算机

还G到了这个ungeni.us这个站点

About JC

Bio

Ungenius was JC’s blog from April 2006, to December 2007, and dealt with his former life as a Mac Genius.

JC – otherwise known as Jeremy Derr – was a Mac Genius for two Apple Stores for more than four years. He has now gone on to other pursuits, including founding Heroic Efforts Data Recovery and Barton Springs Software.

He continues to blog, both professionally and personally.
View full user profile

里面主要提供有关Mac Genius的一些Q&A,其中有个问题是:

Question[>]

Do you have to be gay to work for apple?

————————
嗯,中国”伞兵”扬名了.

, , , , ,

译 : Dismory 源 : http://en.onsoftware.com/how-to-rename-folders-in-google-reader/

Dismory按 : 相比在设置里导出OPML文件,清空Reader里所有订阅,本地修改OPML文件后再导入,以下提供的方式更加直观并且能够保留之前在Reader里为订阅添加的星标.

我昨天花了一晚时间在Google Reader里整理自己的订阅.我想添加一些新订阅,移除之前的一些订阅,再为一些文件夹重命名以提高工作效率.然而我发现Google Reader并没有提供任何重命名文件夹的途径:没有”重命名”按键,在设置里也没有相关选项,什么都没有. 在我刚要建立新的文件夹并把所有订阅移入其中时,我想到了这个既能为Google Reader里文件夹重命名,又不用对订阅逐个调整的方法.

1. 进入Google Reader的”设置”,点击”订阅”标签.

Rename Google Reader folders

2. 在右上方的过滤器里输入你想编辑的文件夹的名字.

Rename Google Reader folders

3. 之后你会看到那个文件夹里订阅的列表.现在单击列表顶端的”所有N个订阅”,然后再在任何一个订阅上单击”更改文件夹”,选择”新建文件夹”,以你想要的名字建立一个新文件夹.

Rename Google Reader folders
Rename Google Reader folders

4. 到”更多操作”菜单里,在”添加到文件夹”下选择刚才新建的文件夹.所有选择的订阅都会置于那个文件夹里.

Rename Google Reader folders

5. 还是在这个菜单中,在”从文件夹中删除”下选择旧文件夹.这样,所有选择的订阅就只存在刚才新建的文件夹里了.

Rename Google Reader folders

6. 剩下唯一需要做的就是到”文件夹和标签”标签里把旧文件夹删除.

Rename Google Reader folders

, , , , ,

30台机器,说多不多,说少不少.挨个人肉不是一个admin的行事风格..

放狗,翻书.试着写了几个脚本跑了一下,Log0里便划掉2个需求.

chmod/sudo

相关代码

#!/usr/bin/expect -f
#name : config_dns_ldap_via_ssh
#set variable
set username [lindex $argv 0]
set hostname [lindex $argv 1]
set password [lindex $argv 2]
set timeout -1
 
match_max 100000
# login
spawn ssh $username@$hostname
## get RSA BEGIN
# expect "*no)?*"
# send -- "yes\r"
## get RSA END
expect "*assword:*"
send -- "$password\r"
expect "*daroot$*"
send -- "sudo -K\r" # reset sudo password
expect "*$username$*"
## DNS name-server&search-domains config by ncutil BEGIN
send -- "sudo -S ncutil --apply-on-exit setprop /Automatic/AirPort/DNS name-server 192.168.1.100\r"
expect "*assword:*"
send -- "$password\r"
expect "*$username$*"
send -- "sudo ncutil --apply-on-exit setprop /Automatic/AirPort/DNS search-domains applestudio.da\r"
## DNS name-server&search-domains config by ncutil END
## add ldap server begin
expect "*$username$*"
send -- "sudo dsconfigldap -a 192.168.1.100\r"
## add ldap server end
## ldap search policy config begin
expect "*$username$*"
send -- "sudo dscl localhost -append /Search CSPSearchPath \"/LDAPv3/192.168.1.100\"\r"
expect "*$username$*"
send -- "sudo dscl localhost -create /Search SearchPolicy CSPSearchPath\r"
expect "*$username$*"
send -- "sudo dscl localhost -append /Contact CSPSearchPath \"/LDAPv3/192.168.1.100\"\r"
expect "*$username$*"
send -- "sudo dscl localhost -create /Contact SearchPolicy CSPSearchPath\r"
## ldap search policy config end
# logout
expect "*$username$*"
send -- "logout\r"
expect eof
#!/bin/bash
#name : loop
i=1
 
while [ $i -lt 31 ]
do
  if [ $i -gt 9 ]
    then $1 daroot imac$i [password]
    else $1 daroot imac0$i [password]
  fi
  i=`expr $i "+" 1`
done
 #loop是shell脚本的名字,config_dns_ldap_via_ssh是expect脚本的名字
$ loop config_dns_ldap_via_ssh

-
Expect脚本里sudo后面填的-S参数很重要,默认sudo是从console而不是stdin接受密码的输入.
脚本里ssh到远端后,远端执行的命令我都是用send模拟而不是spawn,暂时喜欢这样写,还不知道有什么弊端.

参考资料
www.google.com/ncr(不让Google自作聪明的跳转到谷歌中国)
Go2(配合对应FF扩展使用,翻墙效果更加)
-
Configure DNS lookups from the terminal
Using scutil to set DNS server
Terminal Syntax to add custom directory search path
Frey:/programming/ncutil
-
Schoun Regan, Mac OS X Server Essentials, Peachpit Press, 2005, ISBN: 9780321357588
Don Libes, A Tcl-based Toolkit for Automating Interactive Programs (Nutshell Handbook), O’Reilly Media, Inc., 1994, ISBN: 9781565920903
Arnold Robbins / Dale Dougherty, sed & awk (2nd Edition), O’Reilly Media, 1997, ISBN: 9781565922259
Paul Love / Joe Merlino / Craig Zimmerman / Jeremy C. Reed / Paul Weinstein, Beginning Unix, Wrox, 2005, ISBN: 9780764579943
(O’Reilly的电子书服务Safari Books Online真不错)

题外话,Thinkpad上的Hackintosh某次重启后不知怎的没声音了,又加之上星期武汉连续30度,发现Lenovo生产的TP散热上大不如前了,蓝屏数次后外购了Cooler Master 5218散热架,这玩意多少还管点用.顿时有了换MB(P)的强烈冲动..

Web前端开发上有一个好处就是可以相对轻松的查看和学习别人写的代码,现在的一大乐事就是用Firebug看那些pages.

机房-寝室/Mac-Win/.. : I hate the context-switch.

, , , , , , , , , , , , ,

Powered by WordPress 2.7.1 | G7 v5M Theme produced by underone, modified by Dismory
Creative Commons 2.5 | Valid XHTML 1.0 and CSS 2.1