搬磚頭

          Knocking on Heaven's Door
          posts - 34, comments - 6, trackbacks - 0, articles - 0

          2009年2月17日

          RedHat Linux操作系統(tǒng)修改時區(qū)的方法
          Most modern Linux distributions have user-friendly programs to set the timezone, often accesible through the program menus or right-clicking the clock in a desktop environment such as KDE or GNOME. Failing that it’s possible to manually change the system timezone in Linux in a few short steps.
          It’s possible to change the system timezone in Linux in a few short steps.
          Steps
          1. Logged in as root, check which timezone your machine is currently using by executing `date`. You’ll see something like “Mon 17 Jan 2005 12:15:08 PM PST -0.461203 seconds”, PST in this case is the current timezone.
          2. Change to the directory to /usr/share/zoneinfo, here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the “Americas” directory.
          3. If you wish, backup the previous timezone configuration by copying it to a different location. Such as `mv /etc/localtime /etc/localtime-old`.
          4. Create a symbolic link from the appropiate timezone to /etc/localtime. Example: `ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime`.
          5. If you have the utility rdate, update the current system time by executing `/usr/bin/rdate -s time.nist.gov`. (This step can be skip!)
          6. Set the ZONE entry in the file /etc/sysconfig/clock file (e.g. “America/Los_Angeles”)
          7. Set the hardware clock by executing: ` /sbin/hwclock –systohc`
          Tips
          · On some versions of RedHat Linux, Slackware, Gentoo, SuSE, Debian, Ubuntu, and anything else that is “normal”, the command to display and change the time is ‘date’, not ‘clock’
          · On RedHat Linux there is a utility called “Setup” that allows one to select the timezone from a list, but you must have installed the ‘redhat-config-date’ package.
          Warnings
          · Some applications (such as PHP) have separate timezone settings from the system timezone.
          · On some systems, /etc/localtime is actually a symlink to the appropriate file under the /usr/share/zoneinfo directory (rather than a copy of that file).
          · On some systems, there is a system utility provided that will prompt for the correct timezone and make the proper changes to the system configuration. For example,Debianprovides the “tzsetup” utility.
          Here is an example of changing the timezone: (Logged in as root)
          In order to manually change the timezone, you can edit the /etc/sysconfig/clockfile and then make a new soft link to /etc/localtime. Here is an example of changing the timezone manually to “America/Denver”:
          1. Select the appropriate time zone from the /usr/share/zoneinfo directory. Time zone names are relative to that directory. In this case, we will select “America/Denver”
          2. Edit the /etc/sysconfig/clocktext file so that it looks like this:
          ZONE=”America/Denver”
          UTC=true
          ARC=false
          Of course, this assumes that your hardware clock is running UTC time…
          3. Delete the following file: /etc/localtime (backup it when you need it !)
          4. Create a new soft link for /etc/localtime. Here is an example of step 3 and step 4:
          # cd /etc
          # ls -al localtime
          lrwxrwxrwx 1 root root 39 Mar 28 07:00 localtime -> /usr/share/zoneinfo/America/Los_Angeles
          # rm /etc/localtime
          # ln -s /usr/share/zoneinfo/America/Denver /etc/localtime
          # ls -al localtime
          lrwxrwxrwx 1 root root 34 Mar 28 08:59 localtime -> /usr/share/zoneinfo/America/Denver
          # date
          Fri Mar 28 09:00:04 MST 2003


          針對中國時區(qū),修改操作如下
          1.   修改文件 /etc/sysconfig/clock內(nèi)容:
          ZONE=Asia/Shanghai
          UTC=false
          ARC=false
          2.     rm /etc/localtime
          ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
          還有其他方法修改時區(qū),不過是基于圖形化界面的命令: tzselect 、 timeconfig
          本文為鏡像,原貼在此:http://www.btk4ever.com/?p=10443

          posted @ 2009-04-28 09:35 生活在別處 閱讀(2165) | 評論 (0)編輯 收藏

          朋友搬到個新地方,沒有寬帶了,但是能收到些加密的無線網(wǎng)絡(luò),挺想蹭網(wǎng)的,本人由于是所謂“挨踢”人士,自當(dāng)義不容辭出手相助。

          我也只是想了解下WEP破解這事,目的也只是提醒大家一下要加強無線網(wǎng)絡(luò)安全,千萬不要干啥非法的事情,當(dāng)然有本事的話,就把屁股擦干凈。

          其實前兩年我就知道WEP加密是極不安全的,而且也出于好奇做過密鑰破解的嘗試,但是由于破解軟件特別挑網(wǎng)卡,結(jié)果自然就是半途而廢了。這次到網(wǎng)上 再度查了點相關(guān)資料,發(fā)現(xiàn)這事情已然變得相當(dāng)?shù)暮唵瘟?基本上只需要 BackTrack3 就可以搞定了。Backtrack 是一個黑客操作系統(tǒng),其實也算是一個linux的黑客版,主要是安裝了很多實用的軟件和黑客工具,偏向于安全侵入方面的。

          我是下載了一個BackTrack3 的usb版本,并且下了最新的掃描工具spoonwep2,系統(tǒng)自帶的是spoonwep也能用,但是據(jù)說新版更好使,更方面。整個過程挺簡單的,機器設(shè) 置成usb可引導(dǎo)啟動,然后啟動進入usb上的BackTrack系統(tǒng),都是圖形界面的,打開spoonwep2工具,掃描周圍的無線信號,選擇信號強 的,有客戶端連接,并且DATA包比較多的信號來破解吧,這樣應(yīng)該可以快點,據(jù)說XX分鐘就能破解了。沒有客戶端連接的無線信號,據(jù)說有些AP也是同樣可 以破解的,無非是攻擊方式的變化以及花費的時間更長而已。

          我的經(jīng)歷是,晚上10點多開始破一個無線信號,等了一個多小時,進度開始變緩慢,因為本來連著的兩個客戶端下線了,估計困搞去了…,很無奈,我也不 能傻等,只得也睡覺去了。第二天早上起來,1o點多的時候,才抓滿了要求的數(shù)據(jù)包,整個密鑰破解過程倒是瞬間完成,然后我看到的密碼是”1111111″ ,囧 rz,看來設(shè)無線密碼的人都很懶。這個過程還是挺漫長的,可能是沒選擇對正確的攻擊方式,導(dǎo)致數(shù)據(jù)包獲取的過程很長。假如有客戶端在BT下載,估計快很 多,要是只是qq聊天,那就要耗很久了。不過整個過程,已經(jīng)相當(dāng)?shù)纳倒匣恕?

          這事也不能說的太細,想了解詳細的人,網(wǎng)上查去吧,順便提供一個教程

          至于如何加強無線安全,有這么幾點(網(wǎng)上找的)

          如果你需要你的AP很難被破解,建議:
          1)用WPA 加密方式,并且使用不可能被字典猜到的密碼,目前還是基本可靠的
          2)如果只支持 WEP加密,那么,盡量考慮用隱藏 SSID的方式,這樣可以增加破解難度
          3)如果只支持 WEP加密,那么,可以考慮使用中文名字作為SSID,這樣基本問題不大。
          4)一般破解時候,大家都會選擇常用的頻道,例如 6頻道, 第三步顯示頻道的時候,你的AP也會被列出來,那么第一個目標失敗的時候,黑客往往會選擇第二個容易下手的目標, 但是如果你選擇了8、 4、這些奇怪的頻道,那么狠客往往懶得重新進入該頻道的監(jiān)控模式,你就可以逃過一劫。不過, 某些廉價AP,往往對6 頻道做了優(yōu)化,這個頻道信號最強….這就沒辦法了。
          5)有空換換你的密碼:)

          還有其他幾點也可以做,如減低信號、關(guān)閉DHCP、MAC地址綁定,當(dāng)然這些措施也只是增加難度而已。

          最后提一下,蹭網(wǎng)是有風(fēng)險的,無線信號不加密的,人家未必就是大善人或者菜鳥,而且還有人專門釣魚的,加大信號,設(shè)置簡單密碼,專門等蹭網(wǎng)的人來,數(shù)據(jù)包一抓,等著被玩吧。

          本文為鏡像,原貼在此:http://www.btk4ever.com/?p=10423

          posted @ 2009-04-28 09:33 生活在別處 閱讀(1194) | 評論 (0)編輯 收藏

          考慮把Live Space的日志轉(zhuǎn)移到Wordpress 架的blog去,郁悶的是Live Space并不支持通用的導(dǎo)出格式,要是一條條日志復(fù)制過去的話,這工作量也實在是夠嚇人的。只好到網(wǎng)上找解決辦法了,真搞不定的話,只能放棄Live Space的日志了。結(jié)果很不幸,被我找個一個Live Space Mover的工具,很華麗的搞定了動遷的工作。在此向作者Wei Wei致敬了,隨便介紹推廣一下。

          Live Space Mover 工具的說明在這里:http://b2.broom9.com/?page_id=519

          這個工具是通過Python腳本抓取live space的日志和留言,保存為wordpress支持的通用xml文件。最后將文件通過wordpress后臺管理提供的導(dǎo)入功能,將日志遷移過去。

          具體操作步驟就參照作者blog里的user guide,非常詳細的。

          大致過程是這樣:

          1.安裝Python的環(huán)境,并下載Beautiful Soup的類庫

          2.Google Code下載最近的Live Space Mover 工具(幾個python腳本)

          3.按照作者的要求,對space進行設(shè)置,主要是開放訪問權(quán)限和設(shè)置日期格式

          4.命令行方式執(zhí)行腳本,開始日志抓取(腳本參數(shù)參照user guide)

          –如執(zhí)行過程出現(xiàn)超時或者假死情況(我都碰到了…),關(guān)閉重新執(zhí)行腳本即可,工具有cache文件,會從斷點開始繼續(xù)的

          5.將生成的xml文件導(dǎo)入wordprss

          工具目前還有一點瑕疵,下面這段話來自作者的blog,關(guān)于目前工具無法解決問題的說明,看來又是live space的怨念。

          After the live space updates in Dec 2008 (live space mover version 1.7), there are some limitations for comments, including:

          1. can’t get the accurate time of comments, sometimes even incorrect;

          2. can’t get the email and url of comment authors.

          These are both due to the ridiculous design of Live Space. If you have any idea about how to solve these 2 problems, please let me know.

          本文為鏡像,原貼在此:http://www.btk4ever.com/?p=10025

          posted @ 2009-02-17 17:00 生活在別處 閱讀(896) | 評論 (0)編輯 收藏

          已部署的一個JAVA程序最近需要改成定期執(zhí)行,于是就放到crontab調(diào)度,結(jié)果遇到了中文亂碼問題。腳本在shell環(huán)境下直接運行沒有問 題。到網(wǎng)上收了一下,碰到這個問題的還真不少,結(jié)論是crontab執(zhí)行時不會攜帶用戶的環(huán)境變量,缺失一些系統(tǒng)變量。需要在腳本里額外添加缺失的環(huán)境變 量,針對中文問題,需要聲明 LANG參數(shù)

          在腳本開頭增加:
          LANG=”zh_CN.GB18030″
          export LANG

          由于是中文問題,設(shè)置的編碼要和系統(tǒng)設(shè)置的一致,具體可以到/etc/sysconfig/i18n 查看對應(yīng)的環(huán)境變量

          本文為鏡像:原帖在此:http://www.btk4ever.com/?p=10040

          posted @ 2009-02-17 16:55 生活在別處 閱讀(1419) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 定远县| 沅陵县| 准格尔旗| 朝阳区| 平果县| 大兴区| 五家渠市| 新乡市| 潞西市| 筠连县| 黄平县| 亳州市| 邯郸县| 长顺县| 界首市| 佛坪县| 左贡县| 隆化县| 泽库县| 铜陵市| 三穗县| 松潘县| 乌什县| 新乡县| 修武县| 新丰县| 合水县| 云林县| 浙江省| 溆浦县| 潍坊市| 广昌县| 荥阳市| 潼南县| 白玉县| 丹江口市| 台山市| 大城县| 三原县| 西华县| 定襄县|