Ever had a situation that you forgot your root password on your linux box ? You could reset your root password without using a boot cd or go to the extent of reinstalling your OS. All you need is a physical access to your server.
Here’s how (tested using CentOS4):
1.) Reboot your server, during loading of GRUB, press "a"
2.) Select the kernel that you want to boot, then press "e" (to edit the parameter)
3.) Add "single" to the last line of the parameter. (ex. root=LABEL=/ single), This will boot the system using single user mode.
4.) Save and reboot.
5.) After loading, type in the prompt: passwd
6.) Enter your new root password then reboot
Tuesday, November 29, 2011
Friday, November 11, 2011
Insert Graphs in your PHP
If your developing a website written in PHP there will be times that you will need to present graphs and this has been a big headache for some PHP developers. There is one library for PHP written for this purpose,
"JPGraph (http://www.aditus.nu/jpgraph/) - is an Object-Oriented Graph creating library for PHP >= 4.3.1 The library is completely written in PHP and ready to be used in any PHP scripts (both CGI/APXS/CLI versions of PHP are supported). The library can be used to create numerous types of graphs either on-line or written to a file. JpGraph makes it easy to draw both "quick and dirty" graphs with a minimum of code as well as complex graphs which requires a very fine grained control. The library assigns context sensitive default values for most of the parameters which minimizes the learning curve."
Below is a sample graph i’ve generated with the help of JPGraph from one of my PHP apps.
"JPGraph (http://www.aditus.nu/jpgraph/) - is an Object-Oriented Graph creating library for PHP >= 4.3.1 The library is completely written in PHP and ready to be used in any PHP scripts (both CGI/APXS/CLI versions of PHP are supported). The library can be used to create numerous types of graphs either on-line or written to a file. JpGraph makes it easy to draw both "quick and dirty" graphs with a minimum of code as well as complex graphs which requires a very fine grained control. The library assigns context sensitive default values for most of the parameters which minimizes the learning curve."
Below is a sample graph i’ve generated with the help of JPGraph from one of my PHP apps.
Labels:
Programming
Tuesday, November 8, 2011
Want to Raise some Funds?
Do you have projects that you want to be funded ? Then try posting it to ThePoint.
The Point (http://www.thepoint.com), a site that encourages people to post causes to raise money for various issues to “make change happen.” The money is sent only if enough people pledge money to push the issue over “the tipping point.”
The Point covers almost every sectors from Technology, Animals, Environment, Politics, etc….
So get those projects kicking and post it to the point. Who knows, you might get the fund.
The Point (http://www.thepoint.com), a site that encourages people to post causes to raise money for various issues to “make change happen.” The money is sent only if enough people pledge money to push the issue over “the tipping point.”
The Point covers almost every sectors from Technology, Animals, Environment, Politics, etc….
So get those projects kicking and post it to the point. Who knows, you might get the fund.
Labels:
Internet
Saturday, November 5, 2011
Setup Redundant Routers / Gateways
Almost all networks uses a router to connect a LAN to a WAN. One problem with routers is that, it’s the lifeline of your network, a downtime on the router would cause all workstations connected to the internet to be disconnected.
What do you do? Setup two routers? Yes, but how? Since almost all workstations don’t run routing protocol, they are setup using a single gateway address. Meaning, even if you have two routers, you still have to manually edit either the workstations or the 2nd router. This is not the way things should be. It should be automatic.
How do you do it? Easy. Use KeepAlived for Linux.
"What is Keepalived ?
The main goal of the keepalived project is to add a strong & robust keepalive facility to the Linux Virtual Server project. This project is written in C with multilayer TCP/IP stack checks. Keepalived implements a framework based on three family checks : Layer3, Layer4 & Layer5/7. This framework gives the daemon the ability of checking a LVS server pool states. When one of the server of the LVS server pool is down, keepalived informs the linux kernel via a setsockopt call to remove this server entrie from the LVS topology. In addition keepalived implements an independent VRRPv2 stack to handle director failover. So in short keepalived is a userspace daemon for LVS cluster nodes healthchecks and LVS directors failover. " — from Keep Alived Website
To keep it simple, keepalive uses the VRRP protocol in which multiple routers will be able to check each other and acts as a single router.
Wk1 –> Virtual IP —> Router1 –> Internet
—> Router2 –> Internet
In the example above, if Router1 fails, Router2 takes the Virtual IP and acts as the main router. During this time, Router2 will still continue to check Router1, if Router1 is up, then it will take again the Virtual IP.
With this, there is no more manual intervention from the Sys Ads.
Download KeepAlived
What do you do? Setup two routers? Yes, but how? Since almost all workstations don’t run routing protocol, they are setup using a single gateway address. Meaning, even if you have two routers, you still have to manually edit either the workstations or the 2nd router. This is not the way things should be. It should be automatic.
How do you do it? Easy. Use KeepAlived for Linux.
"What is Keepalived ?
The main goal of the keepalived project is to add a strong & robust keepalive facility to the Linux Virtual Server project. This project is written in C with multilayer TCP/IP stack checks. Keepalived implements a framework based on three family checks : Layer3, Layer4 & Layer5/7. This framework gives the daemon the ability of checking a LVS server pool states. When one of the server of the LVS server pool is down, keepalived informs the linux kernel via a setsockopt call to remove this server entrie from the LVS topology. In addition keepalived implements an independent VRRPv2 stack to handle director failover. So in short keepalived is a userspace daemon for LVS cluster nodes healthchecks and LVS directors failover. " — from Keep Alived Website
To keep it simple, keepalive uses the VRRP protocol in which multiple routers will be able to check each other and acts as a single router.
Wk1 –> Virtual IP —> Router1 –> Internet
—> Router2 –> Internet
In the example above, if Router1 fails, Router2 takes the Virtual IP and acts as the main router. During this time, Router2 will still continue to check Router1, if Router1 is up, then it will take again the Virtual IP.
With this, there is no more manual intervention from the Sys Ads.
Download KeepAlived
Sunday, October 30, 2011
Convert .tif to .gif using a Batch file
Recently one of my projects was to display an image (gif) to a PHP/MySQL application but the source image sent was in .tif format. So, i need to convert .tif to .gif, it wasn’t such a problem if i only had 1-10 files to convert but the thing is i have over a hundred of .tif files that needs to be converted daily.
Thanks to tconvert -(is a free command line image converter from tif to the gif image format), i made a simple batch file below to convert the file using tconvert.
@ECHO
tconvert.exe -all
del /q *.tif
PAUSE
EXIT
Save the batch file as, convert.bat and place a short cut on your desktop.
@ECHO — > Display
tconvert.exe -all –> convert all .tif files into .gif
del /q *.tif –> delete all .tif files
PAUSE –> wait unti keypressed
EXIT –> exit the program
Download tconvert from allscoop (http://www.allscoop.com/tools/convert-tif/)
Thanks to tconvert -(is a free command line image converter from tif to the gif image format), i made a simple batch file below to convert the file using tconvert.
@ECHO
tconvert.exe -all
del /q *.tif
PAUSE
EXIT
Save the batch file as, convert.bat and place a short cut on your desktop.
@ECHO — > Display
tconvert.exe -all –> convert all .tif files into .gif
del /q *.tif –> delete all .tif files
PAUSE –> wait unti keypressed
EXIT –> exit the program
Download tconvert from allscoop (http://www.allscoop.com/tools/convert-tif/)
Thursday, September 22, 2011
Backup MySQL DB in Linux and Save in Windows Server
I wrote a simple script that would backup your MySQL DB in Linux and save it in Windows Server Remote Drive.
#!/bin/sh
mysqldump -udbuser -pdbpass db1 > /home/rnones/db1.sql
cd /home/rnones/
mount -t cifs //ipaddress/folder -o username=winuser,password=winpass /mnt/win
cp db1.sql /mnt/win
Save the script as backup.sh and make it executable by using chmod command.
How the script works:
1.)The script will first backup your mysqldb using mysqldump command
2.) Mount a Windows Server share drive to /mnt/win
3.) Copy the backup file to the mounted drive
To automate, just insert this script in your cron job
#!/bin/sh
mysqldump -udbuser -pdbpass db1 > /home/rnones/db1.sql
cd /home/rnones/
mount -t cifs //ipaddress/folder -o username=winuser,password=winpass /mnt/win
cp db1.sql /mnt/win
Save the script as backup.sh and make it executable by using chmod command.
How the script works:
1.)The script will first backup your mysqldb using mysqldump command
2.) Mount a Windows Server share drive to /mnt/win
3.) Copy the backup file to the mounted drive
To automate, just insert this script in your cron job
Labels:
Server Administration
Monday, September 19, 2011
View Visited Web Sites of Internet Explorer
I’ve been searching for a free utility that would help me in viewing the history of websites visited on Internet Explorer and stumbled on IE History View. This utility allows me to view not only my local PC but network PC’s as well.
Internet Explorer doesn’t allow you to view and edit the entire URL list that it stores inside the history file. That’s why you need a viewer to do this. Each time that you type a URL in the address bar or click on a link in Internet Explorer browser, the URL address is automatically added to the history index file.
"This utility reads all information from the history file on your computer, and displays the list of all URLs that you have visited in the last few days. It also allows you to select one or more URL addresses, and then remove them from the history file or save them into text, HTML or XML file. In addition, you are allowed to view the visited URL list of other user profiles on your computer, and even access the visited URL list on a remote computer, as long as you have permission to access the history folder" - from IE History View website
You can download IE History View at http://www.nirsoft.net/utils/iehv.html
Great Tool!!!
Internet Explorer doesn’t allow you to view and edit the entire URL list that it stores inside the history file. That’s why you need a viewer to do this. Each time that you type a URL in the address bar or click on a link in Internet Explorer browser, the URL address is automatically added to the history index file.
"This utility reads all information from the history file on your computer, and displays the list of all URLs that you have visited in the last few days. It also allows you to select one or more URL addresses, and then remove them from the history file or save them into text, HTML or XML file. In addition, you are allowed to view the visited URL list of other user profiles on your computer, and even access the visited URL list on a remote computer, as long as you have permission to access the history folder" - from IE History View website
You can download IE History View at http://www.nirsoft.net/utils/iehv.html
Great Tool!!!
Labels:
Internet
Subscribe to:
Posts (Atom)
