//
Showing posts with label 网络 ‧ 工作. Show all posts
Showing posts with label 网络 ‧ 工作. Show all posts

2011/01/23

收买人心

前同事艾德文移师到Mlink进展工作得到Domino Pizza款待一事竟从此对Domino Pizza闻之色变,成为同事间午餐的话题,没想到同样的事竟然发生在我和另外3位同事身上,而这次是被老板“摆上台”。正所谓君要臣死,臣不得不死。

话说那天接到老板通知,需要几位“得力助手”到客户M公司协助公司有份参与的“大”方案,详情不明,老板拍胸口直说不是做kuli、不是卖猪仔、不是承包(outsource)。对于这来历不明的工事,心里有种莫名的黑暗。星期五午餐后,4个人,3辆车浩浩荡荡出发。


抵达后,见面不如闻名的客户王先生解释工作的细节,其实很简单,用劳力就可以解决的眼见手板功夫,把一张张sim卡插入modem,装上power adapter,装上serial cable,8架一组,备用。复杂的是发送信息,王先生的资料库与硬体的平台组织方式容易混淆,发过一轮,我投降了,一轮折腾后王先生叫我们先用晚餐(当时8.30pm),晚餐竟然是Domino Pizza,大中小批萨各一个,每一种都不同口味。

不间歇地在用完晚餐继续组装,发信息,务必在最短的时间把工事昨晚,回家过个好周末,岂料MTN老板忽然来督工,表面功夫十分得体,“来,大家幸苦了,我打包鱼翅羹给大家宵夜,还有米粉。“后来我们发现,这所谓的慰劳宵夜餐原来是他在外头吃不完打包回来收买人心的余温小菜。

2010/09/22

Enable apache file and directory indexing under Linux or UNIX

If a URL which maps to a directory is requested, and there is no DirectoryIndex (e.g., index.html) in that directory, then mod_autoindex will return a formatted listing of the directory.

Option # 1: Using Apache config file

Add directory option to Apache configuration file /etc/httpd/httpd.conf or /etc/apache2/apache2.conf:
# vi /etc/apache2/apache2.conf
Add following code:

Options Indexes FollowSymLinks

Save and close the file. Restart Apache:
# /etc/init.d/httpd restart
OR
# /etc/init.d/apache2 restart

Option #2: Using .htaccess Files with Apache

You can place config line Options Indexes in .htaccess file. Make sure .htaccess file support is enabled.
Change directory to pdfs
$ cd pdfs
Open .htaccess file
$ vi .htaccess
Append following apache directive:
Options Indexes
Save and close the file.

2010/09/07

Reset Webmin Root password


Webmin Password ResetAt times we often forget the webmin password for a given user say root or after repeated failed login attempts webmin locks the account and one cannot login anymore. In order to change/reset the password we need to run a changepass.pl  that is provided with webmin by running it from the shell terminal on the server it self.
So logon to the server via ssh and sudo as root user.
If you execute the script the following out is displayed.
[root@livrona webmin]# /usr/libexec/webmin/changepass.pl
usage: changepass.pl

This program allows you to change the password of a user in the Webmin
password file. For example, to change the password of the admin user
to foo, you would run:
        changepass.pl /etc/webmin admin foo
This assumes that /etc/webmin is the Webmin configuration directory.

So let's say that in order to change the password of user root to changeme we would execute the following.
 [root@livrona webmin]# /usr/libexec/webmin/changepass.pl /etc/webmin root changeme
Updated password of Webmin user root
[root@livrona webmin]#
exit
exit
-sh-3.1$

Now go back to browser and try to login with the new password, it should work.
If the given user does not exist in webmin, it would say that the user does not exist and list out all the users in the webmin system.
[root@livrona webmin]# /usr/libexec/webmin/changepass.pl /etc/webmin admin password
The Webmin user admin does not exist
The users on your system are: root

2010/09/03

Use MYSQLDUMP and CRON to backup Databases (MySql)

"The mysqldump client can be used to dump a database or a collection of databases for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump contains SQL statements to create the table and/or populate the table."-- from the MySQL Reference Manual.

Technique 1
I wrote a short PERL script to backup my database and compress the results into a unique name based on current date.
Sample PERL script --

#!/usr/bin/perl

($Second, $Minute, $Hour, $Day, $Month, $Year, $WeekDay, $DayOfYear, $IsDST) = localtime(time) ; 

$Year += 1900 ; $Month += 1;

$dt = sprintf("%04d%02d%02d", $Year, $Month, $Day, ) ;

exec "/usr/local/bin/mysqldump --opt -hHOSTNAME -uUSERID -pPASSWORD DATABASE_NAME |gzip > PATHNAME/$dt.gz";
The $dt variable gets resolved to the current date in YYYYMMDD format.

Technique 2
The wizards at Pair networks sent out this gem of wisdom in one of their monthly newsletters.
To back up a particular database, enter this command (all on one line):

/usr/local/bin/mysqldump -hDBXX.PAIR.COM -uDB_USERNAME -pDB_PASSWORD USERNAME_DATABASENAME > 
usr/home/USERNAME/backup/DATABASENAME.`/bin/date +\%Y\%m\%d`
Here are the replacement values for the above command:
DBXX.PAIR.COM = The hostname of the database server the database resides on
DB_USERNAME = The MySQL username for the database in question
DB_PASSWORD = The MySQL password for the username above
USERNAME_DATABASENAME = The full name of the database
USERNAME = Your pair Networks username
These commands will generate a file in the "backup" directory off of the home directory called DATABASENAME.DATE where DATE is the date the backup was made. Make sure that a "backup" directory exists off of your home directory when creating these cron jobs.

Just set this up to run regularly with cron and you now have regular backups.

2010/08/18

下载谷歌书

首先声明,IE不支援此功能,只有火狐狸(FireFox)
需具备3项工具:
1. Greasemonkey
2. 下载谷歌书程式 http://userscripts.org/scripts/show/37933
3. FlashGot

参考:http://sharad-pathology.blogspot.com/2009/03/how-to-download-google-books.html

2010/06/24

Converting MailEnable to SmarterMail

1. download MailEnable Converter Utility: Download link
[http://www.smartertools.com/downloads/SmarterMail/SMConverterWizard_ME.zip]

This conversion tool will convert the following data: Domains, Users, Mailboxes, Groups, and Mailing Lists. Post offices are converted as domain aliases to the primary domain in the post office. All extra domains within the post office are also converted as domain aliases.

Ref: http://portal.smartertools.com/KB/a252/converting-imail-mailenable-mailmax-and-merak-to-smartermail.aspx

2. Install SmarterMail and disable all of the services.

3. Run the SmarterTools MailEnable to Smartermail conversion utility and allow it to migrate the domains. The reason for this is purely so that the old emails will get moved over from mailenable to smartermail so you won't loose data.

4. Archive user list and upload to new server.

5. Create domain and user account in webmail interface.

Ref: http://www.helmarchive.com/index.php_t-7736.html

2010/05/20

Wbadmin Command and Task Scheduler

You can create scheduled system image backups for your users by using the Wbadmin command and Task Scheduler.

Tools

  • Wbadmin command. You can use the Wbadmin command to create and manage system image backups for computers running Windows 7. To open a command prompt with elevated privileges, click Start, right-click Command Prompt, and then click Run as administrator. Then, to see the syntax for the Wbadmin command, at the prompt type: wbadmin /?
  • Task Scheduler. If you want to create a schedule to run backups at different times on different days, you can use Task Scheduler to create a series of tasks to run the Wbadmin start backup command on the desired schedule or to launch a batch file. To open Task Scheduler, click Start, click Administrative Tools, and then click Task Scheduler.

    Example:
    backup.bat
    for /f "tokens=2-4 delims=/ " %%g in ('date /t') do (
    set mm=%%g
    set dd=%%h
    set yy=%%i
    )

    wbadmin start backup -backupTarget:F: -allCritical -include:E: -quiet >> F:\BackupLog\backupLogs%yy%%mm%%dd%.txt

    or

    for /f "tokens=2-4 delims=/ " %%g in ('date /t') do (
    set mm=%%g
    set dd=%%h
    set yy=%%i
    )

    xcopy "D:\Domains\LocalUser" /s /i /y "E:\www_backup\%yy%-%mm%-%dd%\" >> E:\www_backup\logs\%yy%%mm%%dd%.txt

Resources

For information about, and instructions for using the Wbadmin command and Wbadmin start backup with Task Scheduler, see the following articles on the Microsoft Web site:
In addition, Windows Backup in Windows 7 contains several tools and features to help your users perform one-time and scheduled ups and, later, recover their files, data, and systems. You can manage certain functionalities of these tools using Group Policy. However, for the most part, these features are not designed to be administered in a managed environment.
  • For information about how your users can use Windows Backup features in Windows 7, see Windows Help and How-To (http://go.microsoft.com/fwlink/?LinkId=143621).
  • For information about managing these features using Group Policy, download the Group Policy Settings Reference (http://go.microsoft.com/fwlink/?LinkId=143622).

    Ref:
    http://windows.microsoft.com/en-us/windows7/Backup-and-recovery-strategies-for-IT-pros#BKMK_WBADMIN
    http://technet.microsoft.com/en-us/library/cc742130%28WS.10%29.aspx

2010/03/24

Manage SSL Certificate Under Microsoft Management Console (mmc)

There are several ways to deal with SSL certificate under Microsoft Windows. One way is to use the certificate manager built into Internet Explorer, which works under most versions of Windows. But the IE route only works with certificates stored under "Current User". If you need to work with certificates stored under "Local Computer" (and certificates need to be stored in there for Windows Services,) you have to use MMC instead. MMC is available only for Windows 2000 Pro and better. Here are the step necessary to setup MMC to deal with SSL certificates.

1. From Windows Start Menu, select Run... and enter mmc
2. Choose (Console | Add/Remove Snap-in...)
3. Choose Add. From "Available Stand Alone Snap-ins" choose Certificate. Then choose My user account and then click on Finish
4. Repeat the step above once more, but this time choose Computer account. After that choose Local Computer and click on Finish
5. Now choose (Console | Save As). Give it the filename SSLCertificate.msc
6. To test out the new consoel, launch MMC again, then choose (Console | Open) to open SSLCertificate.msc that you have just saved.
7. To import a certificate (which needs to be in PFX format) into the local computer Certificate store, open up the branch Certificates (Local Computer)/Personal/Certificates, right click and choose (All Tasks | Import...)

2010/03/10

以天堂之名入侵

三月八日,一个如常的蓝色星期一。
带着懒懒的心情,踏进冷冷的办公室。
一切显得那么平静,而且一直监视的主机活动,也显得出奇的正常。
一通不welcome的电话,敲醒了安全的警钟。
“网站被骇了”

那恶心到反胃的血淋淋女人摆着撩人的笑容,婀娜多姿骚弄她的头额。
看了不但鸡皮疙瘩,而且想给她一击勾拳。
不明白为什么有些人吃饱没事作,骇人家的网站。
打起“天堂成员”的口号,说什么“不是骇意,而是警惕”
自圆其说的歪理。

2010/01/22

快捷安装webmin

只需三个指令:

yum -y install perl-Net-SSLeay
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.480-1.noarch.rpm
rpm -i webmin-1.480-1.noarch.rpm

安装完成后用 https://localhost:10000/ 登入

2010/01/13

安装xp

前两天朋友买了一台HP Compaq CQ40-627TU托我帮他安装xp,搞了半天,才知道xp这么难安装,原因在于新一代的电脑都是SATA硬碟,而xp在面世的时代还是IDE,所以安装的程序需要先安装SATA driver.

鸣谢以下作者提供技术方面的资讯:
1. http://laptop-driver.blogspot.com/2009/10/compaq-presario-cq40-627tu-windows-xp.html

2. http://saysprasad.wordpress.com/2009/02/04/how-to-install-winxp-on-hp-compaq-and-other-new-age-laptops/

3. http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&ProductID=2991&DwnldID=17883&strOSs=44&OSFullName=Windows%20XP%20Professional*&lang=eng

4. http://drivers.softpedia.com/get/NETWORK-CARD/OTHER-NETWORK-CARDS/BROADCOM-Wireless-802-11b-and-802-11g.shtml

2009/12/14

Wicd 取代 Network Manager

我用的企鹅(Linux)机不但是个哑的,就连wifi也无法使用,奇就奇在当我使用微软boot up它可以发声,也可以wifi.
其实Linux不是不好,最起码在format机后不需要找驱动软件(driver),尽管微软在xp版也省略了安装驱动软件,可是较新的硬体还是需要driver支援。

使用了一段时间的Network Manager总是接收不到wifi的讯息,结果今天给我休了,换成wicd
http://wiki.geteasypeasy.com/How_to_use_Wicd_instead_of_Network_Manager
满满的希望以为解决了wifi signal的问题,但是还是行不同,没法子已经休了,就继续用wicd吧。

2009/11/09

GeoIP

Install Geo::IP Perl Module

1. open a windows terminal window

C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Geo-IP.ppd
====================
Install 'Geo-IP' version 1.27 in ActivePerl 5.8.7.815.
====================
Installing C:\Perl\site\lib\auto\Geo\IP\IP.dll
Installing C:\Perl\site\lib\auto\Geo\IP\IP.lib
Installing C:\Perl\site\lib\auto\Geo\IP\IP.exp
Installing C:\Perl\site\lib\auto\Geo\IP\IP.bs
Installing C:\Perl\html\site\lib\Geo\IP.html
Installing C:\Perl\html\site\lib\Geo\Mirror.html
Installing C:\Perl\html\site\lib\Geo\IP\Record.html

2. Download the current Country, City and Organization (AS Numbers) databases
http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz

3. Unzip the files and place them in your GeoIP data directory, i.e. C:\Program Files\GeoIP

4. Update your awstats.mysite.conf configuration file
LoadPlugin="geoip"

[ref: http://www.antezeta.com/awstats/geoip.html]

第二波攻击

心力交瘁迎战第二波攻击……

2009/10/22

Convert a MySQL DB from latin1 to UTF8

I had a latin1 collated MySQL 4.1 db that contained both English and Japanese text. I dumped the data and then tried to migrate it into my new MySQL 5.0.26 installation. Of course being a bit lazy I did not take the time to check things out properly and was not surprised to find that all Japanese text had become mojibake. I set off on a mission to fix the problem.

I had two options. Stick with latin1 or move to utf8. I chose to move to utf8 as the front end of my website is all in utf8 so making the whole thing utf8 from front to back would make sense. Here is how I did it:

Dumped the original db with the following command:

mysqldump -u root -p --opt --default-character-set=latin1 --skip-set-charset DBNAME > DBNAME<!--.sql

Then using sed I changed all occurrences of the word latin1 to utf8:

sed -e 's/latin1/utf8/g' -i ./DBNAME.sql

From here I then created the new database and then imported the dumpfile.

mysql -p -e "create database DBNAME"

mysql -p --default-character-set=utf8 DBNAME < DBNAME.sql<!--

And that's it.

2009/10/14

防毒

每一次的寂静之后都是惊涛骇浪的暴风雨。一阵comfort period突然杀出有史最高的spool count,1万5千个spool,是一般的150倍。一个多么惊人的幅度。
在一番inspection & investigation,得到的结果是authentication出现了漏洞,用过微软Outlook或Outlook Express的用户都知道SMTP authentication is required for POP3 email account这类的传说。

结果这次栽在这鬼东西之下,漏洞的出现在于该用户用他的帐号为密码,即是说密码和帐号是一样的,骇客投机取巧之下就这样authenticated进来了,传送了1万5千个垃圾邮件出去,结果主机IP列入黑名单。

在http://www.mxtoolbox.com/blacklists.aspx提供上诉的介面,释放IP需要1小时至24小时不等。病毒随着科技而变种,越来越不容易对付了。

2009/09/17

漫长假期后遗症

4天假期在欢笑、谈天、吃喝、聚会中溜走了,恍神又是工作天,对于我有很高层度的resist to change或者喜欢stick to current stat来说,重拾工作的心情似乎变得慢条斯理,有气无力。工作归工作,始终还是要做,4天pending的工作还不少,x档案一宗,那些人总是把问题向这里推,有的没的,没完没了。漫长假期后遗症的症状有点像T.G.I.F.但是心情是热不起来的,毕竟那是illusion。头脑不清醒,哎呀,我到底是怎么了,做了好几个噩梦,吓醒又谜迷糊糊睡了,那在书桌上该死的闹钟在6.45am响了,可我昨晚明明就放在地上,而且我确定是放在地上……

2009/08/20

LOST v.1

尝试安装plesk在Cent OS 5.2,但是不成功,有点无奈。根据线上的安装指南,似乎轻描易写,但是安装的过程却困难重重,从每一个指令下产生的错误码寻找蛛丝马迹,google再google,有太多的脑袋buffer被占据,当线索找完后又找不到solutions,变得有点demotivated了,那一道道的难题如关卡般等待开印,直到打开最后一道封印,就是到达203.223.148.144:8443的门框。

我好累,I feel like quiting,不断sourcing、sourcing,再sourcing。Can somebody answer me the question why,迷迷糊糊的下午,没完没了的googling,get rid of me, I don't need you.

2009/08/19

Spam DB Lookup

If you have static IP but your IP get blocked by Spam database, check if your IP get blocked by which Spam database via URL of http://www.iptools.com, look for "Spam DB Lookup" section and type in your IP. Spam database which show in red have blacklisted your IP from their database, click on the red highlighted Spam database name and look for the URL to request "IP removal".

2009/08/14

Install Plesk on Cent OS 5.2

Important Pre-Installation Tasks:

Login to the VPS Hosting/server & execute "uname -i" to get the OS bit version so that you can download the appropriate installer package.
[root@server ~]# uname -i
x86_64

Run the following 3 commands, to check if Apache, PHP & MySQL are preinstalled by the OS:
[root@server ~]# rpm -qa | grep -i http
[root@server ~]# rpm -qa | grep -i php
[root@server ~]# rpm -qa | grep -i mysql

If the above are found to be installed [most of the time they are] by the OS, they conflict with the applications Plesk installs, hence remove them using..
[root@server ~]# yum remove http*
[root@server ~]# yum remove php*
[root@server ~]# yum remove mysql*

Check SELinux status, we have it disabled but still... execute "getenforce" it should say "Disabled" or "Not enforcing". If it's enforcing, disable it by executing: "setenforce 0".
root@server [~]# getenforce
Disabled

Once done, download the Auto-installer utility that suits your operating system from HERE and save it on your server's hard drive.
eg : [root@server plesk]# wget plesk_auto_installer_file_name

Set the execution permission for Auto-installer:
eg : [root@server plesk]# chmod +x plesk_auto_installer_file_name

Run the Auto-installer:
eg : [root@server plesk]# ./plesk_auto_installer_file_name


Ref:
http://www.eukhost.com/forums/f15/how-install-plesk-control-panel-linux-vps-dedicated-servers-5434/
http://www.parallels.com/en/download/plesk8/
IP address