UTC=false
ARC=false
本文為鏡像,原貼在此:http://www.btk4ever.com/?p=10443
posted @ 2009-04-28 09:35 生活在別處 閱讀(2177) | 評論 (0) | 編輯 收藏
posts - 34, comments - 6, trackbacks - 0, articles - 0 |
||
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.
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 生活在別處 閱讀(2177) | 評論 (0) | 編輯 收藏 朋友搬到個新地方,沒有寬帶了,但是能收到些加密的無線網(wǎng)絡(luò),挺想蹭網(wǎng)的,本人由于是所謂“挨踢”人士,自當義不容辭出手相助。 我也只是想了解下WEP破解這事,目的也只是提醒大家一下要加強無線網(wǎng)絡(luò)安全,千萬不要干啥非法的事情,當然有本事的話,就把屁股擦干凈。 其實前兩年我就知道WEP加密是極不安全的,而且也出于好奇做過密鑰破解的嘗試,但是由于破解軟件特別挑網(wǎng)卡,結(jié)果自然就是半途而廢了。這次到網(wǎng)上 再度查了點相關(guān)資料,發(fā)現(xiàn)這事情已然變得相當?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)相當?shù)纳倒匣恕? 這事也不能說的太細,想了解詳細的人,網(wǎng)上查去吧,順便提供一個教程。 至于如何加強無線安全,有這么幾點(網(wǎng)上找的) 如果你需要你的AP很難被破解,建議: 還有其他幾點也可以做,如減低信號、關(guān)閉DHCP、MAC地址綁定,當然這些措施也只是增加難度而已。 最后提一下,蹭網(wǎng)是有風險的,無線信號不加密的,人家未必就是大善人或者菜鳥,而且還有人專門釣魚的,加大信號,設(shè)置簡單密碼,專門等蹭網(wǎng)的人來,數(shù)據(jù)包一抓,等著被玩吧。 本文為鏡像,原貼在此:http://www.btk4ever.com/?p=10423
posted @ 2009-04-28 09:33 生活在別處 閱讀(1196) | 評論 (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 生活在別處 閱讀(899) | 評論 (0) | 編輯 收藏 已部署的一個JAVA程序最近需要改成定期執(zhí)行,于是就放到crontab調(diào)度,結(jié)果遇到了中文亂碼問題。腳本在shell環(huán)境下直接運行沒有問 題。到網(wǎng)上收了一下,碰到這個問題的還真不少,結(jié)論是crontab執(zhí)行時不會攜帶用戶的環(huán)境變量,缺失一些系統(tǒng)變量。需要在腳本里額外添加缺失的環(huán)境變 量,針對中文問題,需要聲明 LANG參數(shù) 在腳本開頭增加: 由于是中文問題,設(shè)置的編碼要和系統(tǒng)設(shè)置的一致,具體可以到/etc/sysconfig/i18n 查看對應(yīng)的環(huán)境變量 本文為鏡像:原帖在此:http://www.btk4ever.com/?p=10040posted @ 2009-02-17 16:55 生活在別處 閱讀(1423) | 評論 (0) | 編輯 收藏 據(jù)說在oracle 10g的版本,在數(shù)據(jù)庫實例正常啟動open的情況下,直接通過命令類似" drop database 'dbname'
"這種方式就可以刪除一個數(shù)據(jù)庫實例。
這里說的是oracle 9i的情況下,不依賴其他工具的情況下,手工刪除一個數(shù)據(jù)庫實例。
操作步驟為網(wǎng)上查來的,并經(jīng)過我驗證通過,操作之前請確保該實例已經(jīng)被停止,具體步驟見下:
========================
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 生活在別處 閱讀(1652) | 評論 (0) | 編輯 收藏 找一篇靠譜的教程來跟著做,是相當重要,不然就會吃藥,網(wǎng)上文章都是抄來抄去的,不然怎么死的都不知道個。
我比較衰,找了一篇不是很靠譜的來做,結(jié)果越到了不少小問題。
關(guān)于手工建庫,參照下面兩篇,應(yīng)該是比較靠譜的。
另外一篇比較靠譜的文章,地址如下:http://www.ixdba.net/hbcms/article/14/336.html
===============================================
Red Hat Enterprise 3 + Oracle 10g Release 2 $su – oracle 1--- 設(shè)置系統(tǒng)環(huán)境變量: ORACLE_HOME=/opt/oracle/product/10.2 ORACLE_BASE=/opt/oracle ORACLE_SID=dbtest ...... 2--- 系統(tǒng)規(guī)劃: 實例名稱ORACLE_SID=dbtest 數(shù)據(jù)庫名稱DB_NAME=dbtest 3--- 手工創(chuàng)建如下目錄: /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---修改參數(shù)文件: 格式:/opt/oracle/product/10.2/dbs/init.ora 實例:/opt/oracle/product/10.2/dbs/initdbtest.ora 內(nèi)容如下:
---------------------------------------------------
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
---------------------------------------------------
可將此文件復(fù)制到:/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---
創(chuàng)建數(shù)據(jù)庫的腳本:
-----------------------------------------------------------
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--- 創(chuàng)建相關(guān)表空間與用戶:
CREATE TABLESPACE USERS DATAFILE
'/opt/oracle/oradata/dbtest/users01.dbf' SIZE
1000M;---數(shù)據(jù)表空間
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>.相關(guān)文件的目錄要設(shè)置正確,有數(shù)據(jù)文件,控制文件,參數(shù)文件等,還有就是它們的位置要與控制文件中指定的要一致。
2>.init.ora中的undo_tablespace的名字必須要與create
database的相同,包括大小寫等注意。否則很麻煩,報的錯誤你都不知道是不是在忽悠你!總之,一句話,控制文件中的內(nèi)容要和init文件中的內(nèi)容以及要和實際文件的實際情況要相同。
3>.分析數(shù)據(jù)庫出錯可以到/opt/oracle/admin/dbtest/bdump/alert_dbtest.log中查找。
===============================================
補充:
我碰到的一個問題,在普通用戶sqlplus登錄時,碰到下面的告警提示
Error accessing
PRODUCT_USER_PROFILE 請按照提示,以SYSTEM用戶登入SQL*Plus,然后執(zhí)行PUPBLD.SQL,這個文件通常在$ORACLE_HOME/sqlplus/admin目錄中。 posted @ 2008-11-11 11:47 生活在別處 閱讀(687) | 評論 (0) | 編輯 收藏 切割合并文件在linux下用split和cat就可以完成。下面舉些實例進行說明。
1.文件切割 文件切割模式分為兩種: 文本文件
二進制模式。
1.1文本模式
文本模式只適用于文本文件,用這種模式切割后的每個文件都是可讀的。文本模式又分為兩種: 按最大文件大小切割; 按文本行數(shù)切割。 1.1.1最大文件大小切割
split -C 5k duanxin split
將文本文件duanxin按每塊最大5k的大小進行切割,不打碎行。輸出文件名類似splitaa, splitab……
1.1.2 按文本行數(shù)切割 split -l 100 duanxin split
每個分塊100行,不考慮大小。日志分析時應(yīng)該有用。
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 -----------------------------------------------------------
找東西的時候發(fā)現(xiàn)網(wǎng)上都是講這個的,就隨手貼一下,據(jù)說分割還可以用DD命令
我的需求用split好像是搞不定的,希望從文本的指定行數(shù)進行分割,最終找到一個方法,見下:
sed -n '1001,2000p' ur-file
>newfile
隨后就發(fā)現(xiàn),sed超級有用,有興趣的自己了解吧,附送一個介紹sed用法的文章:
posted @ 2008-11-11 11:25 生活在別處 閱讀(3916) | 評論 (0) | 編輯 收藏
今天晚上上網(wǎng),打開網(wǎng)頁都很困難,查了查發(fā)現(xiàn)開著BT,關(guān)掉以后就正常。 posted @ 2008-07-11 21:46 生活在別處 閱讀(303) | 評論 (0) | 編輯 收藏 今天試圖在gtalk上傳個文件,搗騰半天也耍不起來,最后驚奇的發(fā)現(xiàn),原來中文版的gtalk是被閹割過的,少掉了不少功能。話說,google.cn也就是谷歌,也是被閹割過的,在這個和諧的國度里,就算你輸入google.com,你也去不了想去的地方,咱這里有偉大的GFW和DNS挾持。百度么,天生就閹掉的,谷歌至少還有行字“據(jù)當?shù)胤煞ㄒ?guī)和政策,部分搜索結(jié)果未予顯示。”讓你知道這玩意是太監(jiān),百度么看上去是個女人。 我并不是google飯,但是google有些服務(wù)我倒一直在用。gmail、gtalk、reader、bookmark、picasa,還有那個工具條,有些東西用起來還挺爽的。但是你一旦知道,你常用的東西,有些是被閹割過的,總會有點疙瘩個。當然,有些閹割不能怪罪我們偉大的和諧國,比如把gmail語言換成英文,就會多出選項個。 最后順帶提一下電影的閹割版,內(nèi)地的剪刀手功力是相當?shù)纳詈瘢粌H可以把那玩意割掉,還不經(jīng)意留下幾個彩蛋,提升一下片子的深度,贊一記個。 最后的最后,問候一記GFW,上個月幾個網(wǎng)站又上不去了,連sourceforge也走掉了,罪過罪過! posted @ 2008-07-09 16:33 生活在別處 閱讀(369) | 評論 (0) | 編輯 收藏 原帖地址在此:http://www.geektalks.cn/article.php?story=20080602125246318
用telnet發(fā)電子郵件的目的很多,我們暫且假設(shè)一番:如果你不幸落入恐怖份子之手,他們只有一臺瘦得不行的電腦,總之除了telnet程序啥都沒有,在恐怖份子去吃羊肉泡饃而疏于照看你的大好時機,你如何發(fā)電子郵件通知外界呢? 當然,首先你要有一個支持中繼轉(zhuǎn)發(fā)的SMTP的帳號,幸運的是,現(xiàn)在即使免費的郵箱也會提供這個。 假設(shè)你有一個geekx@126.com的郵箱,密碼是xgeek,則會話如下:(紅色的話是你要說的) $ telnet smtp.126.com 25 # 25 為標準SMTP端口 Trying 220.181.15.111... helo 126.com # 打個招呼先 250 OK
subject:Help!! Terrorists are eating yang—rou—pao—mo... 那么,如何知道你的用戶名和密碼的base64編碼呢?當然是預(yù)先要記在腦子里,如果實在記不下的話,用uuencode翻譯一下吧: $ echo -n 'geekx' | uuencode -m xxx # -m 指定 base64編碼 begin-base64 664 xxx 好了,在恐怖份子吃完午飯回來之前,你已經(jīng)成功地把信發(fā)給超人啦。 posted @ 2008-06-12 10:28 生活在別處 閱讀(526) | 評論 (0) | 編輯 收藏 history|grep halt 不同的系統(tǒng)history文件是不一樣的, 查找find / -name "*history" Redhat的root /var/log下呀 posted @ 2008-04-24 14:26 生活在別處 閱讀(144) | 評論 (0) | 編輯 收藏 |
||