<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    搬磚頭

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

    2008年7月9日

    RedHat Linux操作系統修改時區的方法
    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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    大致過程是這樣:

    1.安裝Python的環境,并下載Beautiful Soup的類庫

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

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

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

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

    5.將生成的xml文件導入wordprss

    工具目前還有一點瑕疵,下面這段話來自作者的blog,關于目前工具無法解決問題的說明,看來又是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 生活在別處 閱讀(892) | 評論 (0)編輯 收藏

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

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

    由于是中文問題,設置的編碼要和系統設置的一致,具體可以到/etc/sysconfig/i18n 查看對應的環境變量

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

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

    據說在oracle 10g的版本,在數據庫實例正常啟動open的情況下,直接通過命令類似" drop database 'dbname' "這種方式就可以刪除一個數據庫實例。
    這里說的是oracle 9i的情況下,不依賴其他工具的情況下,手工刪除一個數據庫實例。
    操作步驟為網上查來的,并經過我驗證通過,操作之前請確保該實例已經被停止,具體步驟見下:
    ========================
    To delete a database,
    First:
    Select "rm -f "||name from v$controlfile
    union
    select "rm -f "||name from v$datafile
    union
    select "rm -f "||member from v$logfile;
    Second:
    Clean up above output & make it executable
    Third:
    If installation follows OFA standard:
    remove directory $ORACLE_BASE/admin/$ORACLE_SID
    Fourth:
    Delete archive log directory (if archive mode)
    ============================
     

    posted @ 2008-11-11 11:49 生活在別處 閱讀(1645) | 評論 (0)編輯 收藏

    找一篇靠譜的教程來跟著做,是相當重要,不然就會吃藥,網上文章都是抄來抄去的,不然怎么死的都不知道個。
    我比較衰,找了一篇不是很靠譜的來做,結果越到了不少小問題。
    關于手工建庫,參照下面兩篇,應該是比較靠譜的。
    另外一篇比較靠譜的文章,地址如下:http://www.ixdba.net/hbcms/article/14/336.html
    ===============================================

    Red Hat Enterprise 3 + Oracle 10g Release 2

    $su – oracle

    1--- 設置系統環境變量:

    ORACLE_HOME=/opt/oracle/product/10.2

    ORACLE_BASE=/opt/oracle

    ORACLE_SID=dbtest

    ......

    2--- 系統規劃:

    實例名稱ORACLE_SID=dbtest

    數據庫名稱DB_NAME=dbtest

    3--- 手工創建如下目錄:

    /opt/oracle/admin/dbtest/cdump

    /opt/oracle/admin/dbtest/bdump

    /opt/oracle/admin/dbtest/udump

    /opt/oracle/admin/dbtest/pfile

    /opt/oracle/oradata/dbtest/

    /opt/oracle/oradata/dbtest/archive

    4--- 建立密碼文件:

    orapwd file=/opt/oracle/product/10.2/dbs/orapwd_dbtest password=superman

    5---修改參數文件:

    格式:/opt/oracle/product/10.2/dbs/init.ora

    實例:/opt/oracle/product/10.2/dbs/initdbtest.ora

    內容如下:

    ---------------------------------------------------

    dbtest.__db_cache_size=331350016

    dbtest.__java_pool_size=4194304

    dbtest.__large_pool_size=8388608

    dbtest.__shared_pool_size=138412032

    dbtest.__streams_pool_size=0

    *._kgl_large_heap_warning_threshold=8388608

    *.audit_file_dest='/opt/oracle/admin/dbtest/adump'

    *.background_dump_dest='/opt/oracle/admin/dbtest/bdump'

    *.compatible='10.2.0.1.0'

    *.control_files='/opt/oracle/oradata/dbtest/control01.ctl','/opt/oracle/oradata/dbtest/control02.ctl','/opt/oracle/oradata/dbtest/control03.ctl'

    *.core_dump_dest='/opt/oracle/admin/dbtest/cdump'

    *.db_2k_cache_size=33554432

    *.db_block_size=8192

    *.db_domain=''

    *.db_file_multiblock_read_count=128

    *.db_files=4000

    *.db_name='dbtest'

    *.db_recovery_file_dest_size=4294967296

    *.db_recovery_file_dest=''

    *.log_archive_dest='/opt/oracle/oradata/dbtest/archive'

    *.log_checkpoints_to_alert=FALSE

    *.open_cursors=300

    *.parallel_execution_message_size=65535

    *.parallel_max_servers=128

    *.pga_aggregate_target=209715200

    *.processes=150

    *.recyclebin='OFF'

    *.remote_login_passwordfile='EXCLUSIVE'

    *.replication_dependency_tracking=FALSE

    *.session_cached_cursors=100

    *.sga_target=500m

    *.shared_pool_size=100m

    *.undo_management='AUTO'

    *.undo_retention=0

    *.undo_tablespace='UNDOTS'

    *.user_dump_dest='/opt/oracle/admin/dbtest/udump'

    *.workarea_size_policy='AUTO'

    _allow_resetlogs_corruption=true

    ---------------------------------------------------

    可將此文件復制到:/opt/oracle/admin/dbtest/pfile/init.ora

    6--- 登陸oracle

    > sqlplus “/ as sysdba”

    7--- 啟動實例:

    SQL> startup nomount pfile=/opt/oracle/admin/dbtest/pfile/init.ora

    8--- 創建數據庫的腳本:

    -----------------------------------------------------------

    CREATE DATABASE dbtest

    LOGFILE

    GROUP 1 ('/opt/oracle/oradata/dbtest/redo01.log','/opt/oracle/oradata/dbtest/redo01_1.log') size 100m reuse,

    GROUP 2 ('/opt/oracle/oradata/dbtest/redo02.log','/opt/oracle/oradata/dbtest/redo02_1.log') size 100m reuse,

    GROUP 3 ('/opt/oracle/oradata/dbtest/redo03.log','/opt/oracle/oradata/dbtest/redo03_1.log') size 100m reuse

    MAXLOGFILES 50

    MAXLOGMEMBERS 5

    MAXLOGHISTORY 200

    MAXDATAFILES 500

    MAXINSTANCES 5

    ARCHIVELOG

    CHARACTER SET UTF8

    NATIONAL CHARACTER SET UTF8

    DATAFILE '/opt/oracle/oradata/dbtest/system01.dbf' SIZE 1000M EXTENT MANAGEMENT LOCAL

    SYSAUX DATAFILE '/opt/oracle/oradata/dbtest/sysaux01.dbf' SIZE 1000M

    UNDO TABLESPACE UNDOTS DATAFILE '/opt/oracle/oradata/dbtest/undo.dbf' SIZE 500M

    DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/opt/oracle/oradata/dbtest/temp.dbf' SIZE 500M

    ;

    -----------------------------------------------------------

    9--- 運行如下文件(安裝下面的先后順序)

    /opt/oracle/product/10.2/rdbms/admin/catalog.sql

    /opt/oracle/product/10.2/rdbms/admin/catproc.sql

    10--- 創建相關表空間與用戶:

    CREATE TABLESPACE USERS DATAFILE '/opt/oracle/oradata/dbtest/users01.dbf' SIZE 1000M;---數據表空間

    CREATE TABLESPACE INDX DATAFILE '/opt/oracle/oradata/dbtest/indx01.dbf' SIZE 1000M;---在建立索引的時候把此表空間作為存儲空間,即單獨用一個表空間來存儲索引,這是個好習慣,雖然我們沒有辦法建立一個默認的索引表空間!

    CREATE USER test IDENTIFIED BY test DEFAULT TABLESPACE users ;---測試用戶

    GRANT CONNECT,RESOURCE TO test;

    11--- 一點注意的地方:

    1>.相關文件的目錄要設置正確,有數據文件,控制文件,參數文件等,還有就是它們的位置要與控制文件中指定的要一致。

    2>.init.ora中的undo_tablespace的名字必須要與create database的相同,包括大小寫等注意。否則很麻煩,報的錯誤你都不知道是不是在忽悠你!總之,一句話,控制文件中的內容要和init文件中的內容以及要和實際文件的實際情況要相同。

    3>.分析數據庫出錯可以到/opt/oracle/admin/dbtest/bdump/alert_dbtest.log中查找。

    ===============================================

     補充:

       我碰到的一個問題,在普通用戶sqlplus登錄時,碰到下面的告警提示  

        Error accessing PRODUCT_USER_PROFILE
    Warning: Product user profile information not loaded!
    You may need to run PUPBLD.SQL as SYSTEM

     請按照提示,以SYSTEM用戶登入SQL*Plus,然后執行PUPBLD.SQL,這個文件通常在$ORACLE_HOME/sqlplus/admin目錄中。
    SQL> @$ORACLE_HOME/sqlplus/admin/pupbld.sql

    posted @ 2008-11-11 11:47 生活在別處 閱讀(681) | 評論 (0)編輯 收藏

    切割合并文件在linux下用split和cat就可以完成。下面舉些實例進行說明。
    1.文件切割
    文件切割模式分為兩種:
         文本文件
         二進制模式。
    1.1文本模式
    文本模式只適用于文本文件,用這種模式切割后的每個文件都是可讀的。文本模式又分為兩種:
         按最大文件大小切割;
         按文本行數切割。
    1.1.1最大文件大小切割
    split -C 5k duanxin split
    將文本文件duanxin按每塊最大5k的大小進行切割,不打碎行。輸出文件名類似splitaa, splitab……
    1.1.2 按文本行數切割
    split -l 100 duanxin split
    每個分塊100行,不考慮大小。日志分析時應該有用。
    1.2 二進制模式
    split -b 5k duanxin split
    每個分塊(當然,最后一個不保證)大小都是5k,基本不可讀。任何類型文件都可以用這種切割模式。
    2.文件合并
    cat split* >newduanxin
    不管用什么方式切割,合并方法不變。
    3.其它
    split可以用-a選項指定輸出文件名的長度。如
    split -l 100 -a 3 duanxin split
    則輸出文件出類似于splitaaa,splitaab。不指定時默認為2。
    用-b或-C指定分塊大小時,可用的單位有,b for 512bytes, k for 1Kbytes, m for 1 Megbytes.

    參考資料
    man split
    -----------------------------------------------------------
    找東西的時候發現網上都是講這個的,就隨手貼一下,據說分割還可以用DD命令
    我的需求用split好像是搞不定的,希望從文本的指定行數進行分割,最終找到一個方法,見下:
    sed -n '1001,2000p' ur-file >newfile
    隨后就發現,sed超級有用,有興趣的自己了解吧,附送一個介紹sed用法的文章:

    posted @ 2008-11-11 11:25 生活在別處 閱讀(3914) | 評論 (0)編輯 收藏

     

    今天晚上上網,打開網頁都很困難,查了查發現開著BT,關掉以后就正常。
    這種鳥事情,以前也碰到過,應該是TCP/IP并發連接數的問題,一查果然又被重置到了10。
    昨天是10號,是微軟每月發布安全補丁的日子,記得是有裝補丁個,估計就是那個補丁搞得鬼了。
    各位打了補丁的同志,去修改下系統連接數吧!

    posted @ 2008-07-11 21:46 生活在別處 閱讀(299) | 評論 (0)編輯 收藏


        今天試圖在gtalk上傳個文件,搗騰半天也耍不起來,最后驚奇的發現,原來中文版的gtalk是被閹割過的,少掉了不少功能。話說,google.cn也就是谷歌,也是被閹割過的,在這個和諧的國度里,就算你輸入google.com,你也去不了想去的地方,咱這里有偉大的GFW和DNS挾持。百度么,天生就閹掉的,谷歌至少還有行字“據當地法律法規和政策,部分搜索結果未予顯示。”讓你知道這玩意是太監,百度么看上去是個女人。
        我并不是google飯,但是google有些服務我倒一直在用。gmail、gtalk、reader、bookmark、picasa,還有那個工具條,有些東西用起來還挺爽的。但是你一旦知道,你常用的東西,有些是被閹割過的,總會有點疙瘩個。當然,有些閹割不能怪罪我們偉大的和諧國,比如把gmail語言換成英文,就會多出選項個。
        最后順帶提一下電影的閹割版,內地的剪刀手功力是相當的深厚,不僅可以把那玩意割掉,還不經意留下幾個彩蛋,提升一下片子的深度,贊一記個。
        最后的最后,問候一記GFW,上個月幾個網站又上不去了,連sourceforge也走掉了,罪過罪過!

    posted @ 2008-07-09 16:33 生活在別處 閱讀(361) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 国产成人精品免费午夜app| 久久99精品视免费看| 亚洲综合免费视频| 国产成人精品日本亚洲专区| 国产成人免费爽爽爽视频| 国产一级淫片a免费播放口| 一级毛片免费播放| 男女猛烈无遮掩视频免费软件| 亚洲乱码中文字幕小综合| 亚洲日韩图片专区第1页| 国产亚洲精品免费视频播放| 国产精品嫩草影院免费| 性色av免费观看| 中文毛片无遮挡高潮免费| 免费无码成人AV在线播放不卡 | 91短视频免费在线观看| 免费成人在线电影| baoyu777永久免费视频 | 国产精品色午夜视频免费看| 97在线线免费观看视频在线观看| 中文字幕视频免费| 国产亚洲午夜精品| 亚洲精品无码精品mV在线观看| 国产成人综合久久精品免费 | 337P日本欧洲亚洲大胆艺术图 | 日本一区免费电影| 免费鲁丝片一级观看| 中文在线观看免费网站| 一级一级毛片免费播放| 自拍日韩亚洲一区在线| 亚洲av极品无码专区在线观看| 亚洲精品国产综合久久一线| 色老头永久免费网站| 国产精品久久久久久久久免费| 永久在线免费观看| 99久久免费国产精品特黄| 最近最新的免费中文字幕| 69精品免费视频| 国产成人免费在线| 毛片免费视频播放| 国产精品免费电影|