Hamachi killed after upgrading Ubuntu 9.10 (Karmic Koala). This is because hamachi executable is compressed with upx.
Steps in uncompressing Hamachi with upx
1. Install upx-ucl (make sure you have root or sudo privileged)
sudo apt-get install upx-ucl
2. locate hamachi executable (default installation /usr/bin)
cd /usr/bin
3. decompress hamachi
sudo upx -d hamachi
after executing this commands you will see this outputs
Ultimate Packer for eXecutables
Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007
UPX 3.01 Markus Oberhumer, Laszlo Molnar & John Reiser Jul 31st 2007
File size Ratio Format Name
-------------------- ------ ----------- -----------
830676 < - 331144 39.86% linux/386 hamachi
Unpacked 1 file.
And now you are read to run hamachi... enjoy!
How to get date on bash/sh command?
#!/bin/bash # Datestamp e.g 2002-09-21_24h00m DATE=`date +%Y-%m-%d_%Hh%Mm` # Day of the week e.g. Monday DATE=`date +%A` # Day number of the week 1 to 7 where 1 represents Monday DATE=`date +%u` # Date of the Month e.g. 27 DATE=`date +%d` # Month e.g January DATE=`date +%B` # Week Number e.g 37 DATE=`date +%V`
How to set-up default page for cpanel account?
1. Create a default page that you want to be the default page.
2. Copy your created page to /root/cpanel3-skel/public_html/
That’s all! Every time you create an account on WHM your default page will be create on accounts public_html folder.
For reseller accounts that don’t have root privileged, you should have /cpanel3-skel/ directory on your main account you can add public_html folder their.
To perform a system administrator task, you have to know the root password. What happens if you forgot your root password? Not to worry. Just reboot your PC and you can reset the root password by following these steps:
Soon you see the graphical boot loader on screen that shows the name of the operating systems you can boot. If your system runs with LILO boot loader, press
Ctrl+Xand at the boot prompt typelinux singleand press enter. Then proceed to step 4.
GRUB prompts you for commands to add to its defualt boot command.
singleLinux starts up as usual but runs in a single-user mode that do not require you to log in. After linux starts, you will see the following command line prompts that ends with a hash mark (#), similar to the following :
sh-2.05b#
paswrd command to change the root password as follows:
sh-2.05b# passwd
Changing password for root user.
New password:
root password that you want to use (it doesn’t appear on screen) and then press enter.Linux asks for the password again, like this:
Retype new password:
If you enter the same password both times, the
passwrdcommand changes therootpassword.
After linux starts, it displays the familiar login screen. Now you can log in as
rootwith the new password
‘Like locking your keys in the car, to forget your password after
you’ve spent an hour installing and tweaking a new MySQL server can be
an embarassment to say the least.’
Fortunately, if you have root access to that computer, all in NOT lost.
Here are the steps when you found yourself in this situation.
1. Kill the server process.
% kill pid
(where pid is the process id. Do not use kill -9 unless absolutely
necessary, as this may damage your table files)
2. Run safe-mysqld with the –skip-grant-tables command line option.
(This instructs the MySQL server to allow unrestricted access to
anyone) NOTE: restrict all remote access before issuing this command
% safe-mysqld --skip-grant-table
3. Change root password
mysql > use mysql;
mysql > update user set password = password('newpassword') where user
= 'root';
4. Disconnect and instruct the mysql server to reload the grants
tables to begin requiring passwords.
% mysqladmin flush-privileges
“That does it — and nobody ever has to know what you did. As for
locking your keys in your car, you’re on your own there.”
Must have for php-mysql beginners developers.
First make sure you know your mysql root password, you have to replace DATABASEPASSWORD to your mysql root password.
If you have already used RoundCube installation please make sure you remove any traces of it with,
cd /usr/local/cpanel/base
rm -rf roundcube*
mysql -p -e 'drop database roundcube';
chattr -i /usr/local/cpanel/base/frontend/x/webmaillogin.html
chattr -i /usr/local/cpanel/base/webmaillogin.cgi
/scripts/upcp
You will have to specify your root password when prompted.
Now lets download roundcube first and chmod the directorys
cd /usr/local/cpanel/base
wget -O roundcube.tar.gz http://heanet.dl.sourceforge.net/sourceforge/roundcubemail/
roundcubemail-0.1-rc1.tar.gz
tar -zxvf roundcube.tar.gz
rm -rf roundcube.tar.gz
mv -f roundcubemail-0.1-rc1 roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs
Create the database and install the intial sql file. The following commands will do this for you.
mysql -e "CREATE DATABASE roundcube;" -pDATABASEPASSWORD
mysql -e "use roundcube; source SQL/mysql.initial.sql;" -pDATABASEPASSWORD
Now lets sort out the configuration
cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php
Now open db.inc.php
nano db.inc.php
Find
$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
Replace with
$rcmail_config['db_dsnw'] = 'mysql://root:DATABASEPASSWORD@localhost/roundcube';
Now Open main.inc.php
nano main.inc.php
Find
$rcmail_config['default_host'] = '';
Replace with
$rcmail_config['default_host'] = 'localhost';
Now we have to configure cPanel to show roundcube in the theme. Please note this is for the X theme(default) only!! If you use another theme please skip the next part and see below.
cd /usr/local/cpanel/base/roundcube/skins/default/images/
cp --reply=yes roundcube_logo.png /usr/local/cpanel/base/frontend/x/images/roundcube_logo.png
cp --reply=yes roundcube_logo.png /usr/local/cpanel/base/webmail/x/images/roundcube_logo.png
cd /usr/local/cpanel/base
wget http://www.hostgeekz.com/files/hostgeekz/HGpatch-roundcube-0.1-rc1
patch -p0 < HGpatch-roundcube-0.1-rc1
**NOTE** If you receive a message stating
Reversed (or previously applied) patch detected! Assume -R?
please press N for No as this is because you previously installed roundcube
This will auto do all the necessary changes to roundcube and the X theme.
Once the patch is executed you may now access roundcube via http://yourip/webmail
—–
If you do not use the X theme please do the following
cd /usr/local/cpanel/base
wget http://www.hostgeekz.com/files/hostgeekz/HGpatch-roundcube-NON-X-0.1-rc1
patch -p0 < HGpatch-roundcube-NON-X-0.1-rc1
Then open your webmaillogin.html, please replace YOURTHEME with the name of your theme.
nano /usr/local/cpanel/base/frontend/YOURTHEME/webmaillogin.html
and find
Add Below
***UPDATE***
Remember to chattr +i the files or add the patch to your /scripts/upcp.
chattr +i /usr/local/cpanel/base/frontend/x/webmaillogin.html
chattr +i /usr/local/cpanel/base/webmaillogin.cgi
If you are using cPanel 11 ensure to run the following fix.
wget http://www.hostgeekz.com/files/hostgeekz/cpanel-11-fix.sh
chmod 700 cpanel-11-fix.sh
./cpanel-11-fix.sh
rm -f cpanel-11-fix.sh
That’s it! You may now access roundcube via http://yourip/webmail
Ive been handling webserver with more than 1000 website and lots of unique visitors per month. Session are stored on the server hard drive and every end of the month i need to clean it up.
Now i was puzzled by rm command.
rm -f *
in /tmp/ directory. The terminal choked and gave out:
-bash: /bin/rm: Argument list too long
Apparently there are a maximum number of files that can be passed to rm.
ls -1 | grep sess | wc -l
382611
wow 382611 session files! image how long it would take if you have an application that running with sessions.
The solution for this problem would be :
find . -name 'sess*' | xargs rm