Admins eHow SysAdmin Tips & Tricks

March 4, 2010

How to run multiple instances of yahoo messenger

Filed under: General,Windows — Tags: , , , , — admin @ 1:46 pm

It is possible to run several instances of Yahoo! Messenger using a tiny registry tweak.
Create a file named “yahoo.reg” and copy and paste the following inside it :

REGEDIT4

[HKEY_CURRENT_USER\Software\yahoo\pager\Test]
"Plural"=dword:00000001

Save the file and double click on it , windows asks for a confirmation to write the data inside windows registry , click on Yes.
We are all set 🙂

March 3, 2010

How to authenticate Apache 2 with Radius on Debian

Filed under: Apache,Debian,Security — Tags: , , , — admin @ 11:37 am

Install Apache radius module :

apt-get install libapache2-mod-auth-radius

enable radius module for Apache :

a2enmod auth_radius

open /etc/apache2/apache2.conf and add the following lines to end of file :

AddRadiusAuth IP_OF_RADIUS_SERVER:PORT SECRET 5
AddRadiusCookieValid 60

go to /var/www folder or the folder which you want to protect and create a .htaccess file inside it containing following lines :

AuthType Basic
AuthName "AdminseHow Radius Authentication"
AuthBasicAuthoritative Off
AuthBasicProvider radius
AuthRadiusAuthoritative on
AuthRadiusActive On
Require valid-user

restart Apache :

/etc/init.d/apache2 restart

for more info regarding the configuration options , you can read the following link :
http://freeradius.org/mod_auth_radius/

February 28, 2010

How to install nano on your dreambox

Filed under: DreamBox — Tags: , , , — admin @ 2:50 am

The bundled vi package with dreambox really sucks ! and I am a big fan of nano text editor , as always I was disappointed to find a rebuilt nano package in Gemini or even dreamboxupdate repos , so I searched the net and wonderfully found a nano package which works with my dm800 😀
instruction to install nano :

cd /sbin
wget http://downloads.nas-central.org/LS2_MIPSel/Packages/mipsel-nano_2.0
mv mipsel-nano_2.0 nano
chmod +x nano

February 27, 2010

How to make your dreambox an automatic super downloader

Filed under: DreamBox — admin @ 9:22 pm

I am creating this post mostly for my own reference in future , the scenario is that my ISP gives me a free PPPOE username and password with unlimited traffic to download between 3am-7am and I didn’t want to keep my desktop PC up and running on midnights , so I thought I can make my dreambox which is always on an automatic midnight super downloader and after 24 hours of work , I accomplished it.
1.Create a file named “dl” containing the commands to download files in /media/sda (where flash disk is mounted) , format of file is :

wget -q -c "ftp://user:pass@ftphost/filename1" &
wget -q -c "ftp://user:pass@ftphost/filename2" &
....

2.make it executable :

chmod +x /media/sda/dl

3.edit /etc/ppp/ip-up and add the following to the end of file :

cd /media/sda
/media/sda/dl
echo "`date` : PPPD IP-UP" >> /media/sda/dl.log

4.edit /etc/ppp/ip-down and add the following to the end of file :

killall wget
echo "`date` : PPPD IP-DOWN" >> /media/sda/dl.log

ip-up is automatically called when PPP connection is established. it starts all downloads automatically.
ip-down is automatically called when PPP connection is disconnected. it stops all downloads automatically.
5.Create monitor-pppd in /media/sda and put the following inside it ( also make it executable ) :

if [ ! -e "/proc/sys/net/ipv4/conf/ppp0" ];
then
        echo "`date` : restarting pppd" >> /media/sda/dl.log
        killall pppd
        pppd plugin rp-pppoe.so eth0 user USERNAME password PASSWORD noauth defaultroute replacedefaultroute
fi

6.create a cron job by creating a file named root inside /etc/cron/crontabs folder and paste the following inside it :

* 3,4,5,6 * * * /media/sda/monitor-pppd

and restart the cron daemon by calling :

/usr/script/crond_script.sh restart

the cron daemon will establish the PPPOE connection automatically and monitor-ppd will monitor it.
don’t forget the time should be synchronized and timezone should be set correctly.

Set date,time and timezone on dreambox (dm800)

Filed under: DreamBox — Tags: , , , , — admin @ 6:49 pm

You can set the time and date on dm800 by following command :

date -s YYYY.MM.DD-hh:mm:ss

YYYY is Year
MM is Month
DD is Day
hh is Hour (0-24)
mm is Minute
ss is Second

for changing the timezone , first get a file list of cities by following command :

ls /usr/share/zoneinfo/

choose your city or nearest city to you , then use the following command to change the timezone ( replace YOUR_CITY with your chosen city ) :

ln -sf /usr/share/zoneinfo/YOUR_CITY /etc/localtime

How to setup a PPPOE connection on your dreambox

Filed under: DreamBox — Tags: , , , — admin @ 3:58 pm

Setting up a PPPOE connection on my dm800 was one of the hardest challenges I’ve ever had , I wonder why there is no documentation about it on the net ! I guess I am the first one documenting it in the world 🙂
In this article we will install PPPOE on my dm800 box , I have Gemini 4.6 installed on it now. a “uname -a” command give the following output :

root@dm800:/etc# uname -a
Linux dm800 2.6.12-5.1-brcmstb-dm800 #1 Wed Mar 11 20:59:15 CET 2009 7401c0-nand unknown

first we need to install several kernel modules on our dreambox :

ipkg install kernel-module-slhc
ipkg install kernel-module-ppp-generic
ipkg install kernel-module-pppox
ipkg install kernel-module-pppoe

then we need to install PPP and PPPOE package , I don’t know why they are not available in default repo of Gemini image , but after a lot of search I found them in dreamboxupdate.com repo , so next step is to download and install them :

cd /tmp
wget http://dreamboxupdate.com/opendreambox/1.5/dm800/feed-rel_27/ppp_2.4.3-r2_mipsel.ipk
wget http://dreamboxupdate.com/opendreambox/1.5/dm800/feed-rel_27/ppp-oe_2.4.3-r2_mipsel.ipk
ipkg install ppp_2.4.3-r2_mipsel.ipk
ipkg install ppp-oe_2.4.3-r2_mipsel.ipk

after installing all of required packages , we need to load the required kernel modules into memory.
so run the following commands :

depmod -a
modprobe pppoe

now we should have all required kernel modules loaded :

root@dm800:/etc/init.d# lsmod
Module                  Size  Used by    Tainted: P
pppoe 12416 0 - Live 0xc01ed000
pppox 2864 1 pppoe, Live 0xc01a8000
ppp_generic 29792 2 pppoe,pppox, Live 0xc01b3000
slhc 7552 1 ppp_generic, Live 0xc01a5000

Please note pppoe kernel module is loaded now.

OK , now we are ready to go and connect our PPPOE connection , to do this simply run the following command ( change USERNAME & PASSWORD in following command to your own PPPOE username and password ) :

pppd plugin rp-pppoe.so eth0 user USERNAME password PASSWORD noauth defaultroute replacedefaultroute persist maxfail 0

thats it 🙂 if you have done everything correctly now , you should be connected now.
to disconnect from your PPPOE connection , simply run the following command :

killall pppd

Troubeshooting :
Sometimes I noticed , pppoe module doesnt get loaded (by command “modprobe pppoe”) with an error message while I had all required modules installed , after a lot of tries and errors I found out a reinstall of ppp_2.4.3-r2_mipsel.ipk resolves the issue , may be it is a bug.
After you have pppoe loaded in memory and checked it by “lsmod” command , if your connection still does not work , you can debug it by running syslog daemon and adding a “debug” option to the end of “pppd” command as follows :

syslogd
pppd plugin rp-pppoe.so eth0 user USERNAME password PASSWORD noauth defaultroute replacedefaultroute persist maxfail 0 debug

now you can go to “/var/log/” folder and check messages file. any errors or problems should be reported there , I suggest you to open another telnet or ssh to your dreambox and run the following commands :

cd /var/log/
tail -f messages

and now run the pppd , you can simultaneously see all debug messages.

February 13, 2010

How to remove LiveZilla copyright link

Filed under: General — admin @ 4:29 pm

Open livezilla/_config/config.inc.php file.
Search for $CONFIG[“gl_c_param”] in the file and comment or remove the line.
All Done 🙂

November 15, 2009

How to setup a general IP proxy in linux

Filed under: General — admin @ 10:09 pm

the networking features in Linux are really amazing , in this post I want to show you how you can setup a general IP proxy on a specific port.
in order to write the required script open a new file named proxy :

nano proxy

copy and paste the following script into the file :

YourIP=X.X.X.X
TargetIP=Y.Y.Y.Y
Port=Z

iptables -t nat -A PREROUTING -p tcp --dport $Port -d $YourIP -j DNAT --to $TargetIP
iptables -t nat -A POSTROUTING -p tcp --dport $Port -d $TargetIP -j SNAT --to $YourIP

Change X.X.X.X to your nic IP.
Change Y.Y.Y.Y to target IP.
and Change Z to the port which needs to be proxied.
save and close the file.
make it executable and run it :

chmod +x proxy
./proxy

enable IPv4 forwarding in sysctl.conf :

nano /etc/sysctl.conf

and make sure you have the following line uncommented :

net.ipv4.ip_forward=1

and apply the changes :

sysctl -p

now we are all set 🙂

October 7, 2009

How to backup and restore your Windows VPS

Filed under: General — admin @ 8:58 pm

The best solution to backup your VPS data is to compress your files and folders into a single zip file and then upload it to a free file hosting service , after upload it will give you a link so you can download the zip file on your home pc or on another VPS and then you can decompress it.
for compressor I recommend 7zip which is a free software and can be downloaded from the following link :
http://www.7-zip.org/download.html
and for free file hosting service I recommend the following site :
http://ifile.it

September 19, 2009

cPanel/WHM max emails each domain can send per hour

Filed under: cPanel,General — Tags: , , , — admin @ 7:51 pm

if you want to limit all domains globally , login into your WHM control panel. then go to Server Configuration –> Tweak Settings.
in the Mail section , you will find this setting :
The maximum each domain can send out per hour (0 is unlimited)
set it to any number that you want and click on Save.
but if you want to set the limit for each domain individually , edit /var/cpanel/maxemails :

nano /var/cpanel/maxemails

and add the following line into it ( replace domain.com and 100 with your domain name and limit number ) :

domain.com=100

then execute the following command :

/scripts/build_maxemails_config
« Newer PostsOlder Posts »

Powered by WordPress