Prevent DoS/DDoS On Linux

Last month my server have been ddos by someone, so that I have search on the internet and see how can I prevent it. It’s juz very simple, as u know the linux firewall “iptable”. u can wirte a shell script monitoring the netstats and check whether an IP address have how many connections in this peroid. If there are more than X(u can set a variable on it) connections, the ip address will be ban for X minutes by iptables. Moreover, if there is any ip address has been banned, a email will sent to your administrator account, and I have tested by myself, it works! That’s a great shell script!

1

Checking how many connections does those IP address

2

If there are someone been banned, an email will be received

3

Testing the function:P 123.203.109.188 is my IP address and trying to hack DrKn(Kenny)’s Server 😛

backup your MySQL using a bash script and cron job

From allenkan.com/blog
useful sql backup command
1. dump the DB into a sql file
mysqldump -u <username> -p<password> <database> > <output file name>.sql

2. compress it
gzip <Filename>

3. Ftp send to backup server
** it is not suggested because backup ftp account and the backup data is sent in plain text format **

ftp -n $ftpserver <<END_SCRIPT
quote USER $ftpuser
quote PASS $ftppwd
put $gzipOutFile
quit
END_SCRIPT
exit 0

24/10

All STEAM server needs to be update since yesterday, otherwise the server will be pop-up a warning message something like…”Please update and restart the server”. If you ignore this warning, your server will not be listed on the master server list.

The new version was 4381 for windows and for linux it was 4352. It has also changed the protocol from 47 to 48. Therefore, the old version client can not connect to the new server anymore unless you update the new version. It means that the old version of non-steam client could not getting into the new version server. The new version of client can not join the server which hasn’t been upgraded as well.

Those servers which are hosted by wallaceho.com has been prompt upgraded to new version. However, there are still have many server which have not been upgraded till to now, for example: hkspirit

The new version of client has added many functions, one of it is while you showing up the score board, you may saw the photo of your friend list.

11/10

今朝一早上左朗家幫佢睇個火牛幾多W,之後約埋Jack(因為佢順手去攞mouse)出左深水渉買火牛(470W)+display卡(XFX 9600GSO)。

買完哂野約埋arka去朗家幫佢裝野…我地三條友裝果陣真係笑爆咀..講左好多爛野-.-未試過同人裝機咁好笑@@

300W舊牛

佢家的狗狗

Jack 新Razer Mouse

Geforce 9600GSO(上)  Geforce 7500LE(下)




7/10

今日一早帶埋部notebook上左呀朗屋企幫佢試下佢果度收唔收到高清手指,去到試都收得幾穩定~佢屋企果兩隻狗狗好得意!之後出左深水涉食sushi幫去買野。買左兩條1GB ram 加一隻mix高清手指。

走果陣等果部81等左成九個字先有車!唔知旺角果邊搞咩,返到上去佢屋企都7點半,之後裝埋條ram試埋隻手指~玩到十一點半先走人返屋企。