Kriwelz e-Notes
iwel's e-notes about his World
iwel's e-notes about his World
Jul 1st
yes !!! after my blog has been hacked by some cracker, i finally upgrade my WordPress based blog to version 3.0. I think anyone should upgrade too as soon as possible to avoid further damage to your blog
Jul 1st
yes.. my blog has been hacked !! i thought my blog isn’t important enough to be hacked, but it happened..
i notice someone has hacked into my blog after Google made my blog marked as “Suspicious Website”. I try to open the source code of my blog and i see some 64bit encoded php codes at the top of many files.. Simply removing and replacing all the files and upgrade all the database make my blog now on version 3 of WordPress
Thanks for the cracker..it reminds me again everything is not secure even for an infamous blog like mine
Jun 2nd
As an administrator of a cpanel server sometimes WHM is cannot handle all the actions you want to do, thats when SSH comes in handy to handle problems by directly accessing the command line.
To allow SSH connection to a CPanel server you need to do several things in your WHM :
1. Go to the “ConfigServer Security&Firewall Link”
2. Click on the “Firewall configuration” button, then let it show the configuration, find the “TCP_IN = ” text box and fill the port you want to allow to SSH access your server, let say u fill 9000, Klik “Change button”
3. When you go back to the ConfigServer homepage, click the “Firewall Allow IPs”, insert your IP or using this line below
tcp:in:d=YYYYY:s=xxx.xxx.xxx.xxx
whereas Y is your port number that you have set on the 2nd step, and X is the IP you want to allow SSH connection to your CPanel server,
Next Klik the “Change” button, then klik the “Restart LFD+CSF” button
Thats it, your done, but hey.. when your allready allowed SSH connection to your CPanel server, you access the root ??? relax, all you need to do is :
1. go back to your WHM,
2. search for “Manage Wheel Group Users” then click the link,
3. go to the “Add a user to the wheel group” then click the link you want to add, click the “Add to group” button.
wait a minute… before continuing, you still have one last step to do, that is adding your IP to Host Access List,
Voila, now you can use the “su -” command to login as root in your command line.
Hope this post helps you manage your server,
Come back again to get another Cpanel Guide tutorials
Apr 30th
Commands
at- Execute a task at a specific time. For example, shutdown computer, send birthday remainder etc. Useful to schedule one job at a time or a single future event.
cron – If you want to shutdown Linux box automatically everyday 8 pm then you need to use cron instead of at command (see below for examples). Useful to schedule recurring events or daily events such as backup data, or check system security etc.
at Command Examples
Let us see how to shutdow a Linux automatically at 8 pm, type the command at 8pm and press [enter] key, then type halt followed by enter key. To save your job press CTRL+D.
# at 8pm
Sample outputs:
at> halt
(Press CTRL+D)
Try out the following utilities:
atq – List the current at jobs pending.
atrm – Used to remove pending at jobs.
at command accept fairly complex time specifications, for example:
Run job at 6am on monday:
at 6am monday
Run job in 5 minutes time:
at now + 5 minutes
Run job at 4pm but 3 days later:
at 4pm + 3 days
Run job at 10am on 31st July:
at 10am Jul 31
See the file /usr/share/doc/at/timespec for complete time specifications and read man pages of at, atq, atrm. Make sure you have atd service running, if not start it using the following command:
# /etc/init.d/atd start
I personally wouldn’t schedule a shutdown if i was downloading a few tarballs and the system needed to be off when it was complete, unattended.
what if the speed decreases and it doesn’t finish in time?
Sure, you could expect it to take long and give it lots of time… But what if it gets done early, wouldn’t it be better if it shut down after it was complete, and not wait for the set time?
best to do something like this, chain commands. so you tell it to download the file and then when its done, shutdown.
wget http://somehwere.com/path/to/some.file && halt
note: it has to be double & signs. single one will cause both commands to execute at the same time. double causes it to wait for the first one to exit (clean exit or not) before continuing.
i personally would probably use more along the lines of
wget http://somehwere.com/path/to/some.file 2>/home/kai/wget.log && halt
so level 2 outputs (errors) are logged. if the file stopped downloading before it was done, i would then know why by reading the output of wget.log
scheduled shutdowns with at or cron are better for just having a system shutdown _nomatter what_ at said time. if you want your tasks to finish first, chain them.
Or if you want to schedule a shutdown in the next 24 hours:
shutdown -h time
e.g:
shutdown -h 06:45
Jan 28th
Sometimes you need to move one account from one reseller account to another reseller account in order to move the ownership of a hosting account in our WHM cpanel, to do :
1. Login to your WHM Panel (as root)
2. Go to Reseller Center (Under Reseller Category)
3. Choose menu “Change Ownership of an account” under the “Change Account Ownership/Email Resellers” category
4. Choose the domain / user you want to move in account selection,
5. Choose the reseller account then click the “OK” button
Now the account will be under the WHM reseller account
Jan 14th
Sometimes after using your linux box, data consumes spaces in your hard drive, then you start to think how to find large file size in linux box, after searching a while then i found the solution for this,the following command will list all files in sorted order in human readable format
find /var -size +10000k -print0 | xargs -0 ls -lSh
the explanation for this is : look for files bigger than 10MB in the /var directory, sort it by biggest file first (descending), and show it in human readable format (MegaBytes)
That’s it.. now you can find large file size in your linux box, simple right
Dec 11th
after blog walking to gadgetboi, apparently he came to visit my post, i must say its a fast respon bro
if not approving your comment i might not open my blog again (due to work
) and wut do u know.. wordpress already release a new version (although its minor), i think it would be a good thing to update juz for precaution
I don’t know bout others, but i usually update my wordpress installation by download the whole package and replacing all the files, since this is minor update i think i would go for automatic update now
Hope it runs smoothly.
Sep 26th
Well..after long time not updating my blog content n the wordpress CMS, finally upgrade my wordpress to version 2.8.4.
Lots of security hole announced. Even though i doubt that anyone wants to hack my blog coz its not famous enough
)
, i think precautions is better than regretion right? hehehehehe…
I think im gonna continue watching Alexander the movie..
Jun 17th
having to manage a few server and install services,i need to know what distribution of linux for each box i handle. So, to check linux distro version of my box i would run this in my shell :
cat /proc/version
as for example, the result is like this for ubuntu :
Linux version 2.6.27-14-generic (buildd@palmer) (gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12) ) #1 SMP Wed Apr 15 18:59:16 UTC 2009
as for centos would like this :
Linux version 2.6.18-53.1.14.el5 (mockbuild@builder6.centos.org) (gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)) #1 SMP Wed Mar 5 11:36:49 EST 2008
easy right ?