Knowledge Base

UPS Calibration procedure

Start —>Programs –>Accessories —>Communications —>Hyper Terminal

1. Press “Y” – You will get a prompt like “SM”

2.Press 1 two times with 3-5 sec interval(Left top button in keyboard)
You will get a prompt like “PROG”
3. Press 456
then check the last value if it is “A1” we don’t need to change the value
else change the value according to the UPS model

press +/- for changing the value
UPS Model Value
SUA1500I A1
SUA1000I A8
SUA3000I 96
4. u —> Setting upper power (max 264).
5. l —-> Setting lower power (min 196).
6. N —> Checking Serial number.
7. A —> Disply LED checking.
8. s —–> Sensitivity checking ( High,medium,low).
8. U —> This shows Power checking ( Do not check “U” in UPS connected machines).

===================================

Paswd change in kubuntu

How To Change Password In Ubuntu 7.04 PC Edition (with Dual Boot Win XP Pro)
Posted May 28, 2008
Filed under: Tech Bytes | Tags: dual boot, password recovery, Ubuntu 7.04, Windows XP |

This assumes you have a dual boot with Ubuntu 7.04 and Windows XP Pro. This is a great guide.

Boot up the PC and at the screen to select the OS (assuming you have edited the grub to automate the daul boot)

Select the option Ubuntu, kernel 2.6.20-15-generic (recovery mode) or equivalent

Press “e” to edit the commands

The next screen displays three lines as below

root (hd0,6) or equivalent
kernel /boot/vmlinuz-2.6.20-15-generic ………….. ro single
initrd /boot/initrd.img-2.6.20-15-generic

Select the second line (starting kernel /boot/vmlinuz …..) and select “e” to edit

This takes you to the end of the line. After ro single type rw init=/bin/bash and press Enter

Then press “b” to boot into the shell. NOTE: You are now logged in as root, be careful with the commands issued here.

The shell looks like this

root@none:/#

At the prompt type as below to display the usernames created in Ubuntu

root@none:/#ls /home

To change the password for user named admin100 whose password you want to set as linux!kenya type as below

root@none:/#passwd admin100
Enter new UNIX password: linux!kenya
Retype new UNIX password: linux!kenya
passwd: password updated successfully ( this is displayed if all is OK)
root@(none):/#reboot (this reboots the PC)

Now login to Ubuntu with your new password.

NOTE: To change the root password while still in the shell, type as below

root@none:/#passwd root
Enter new UNIX password: !@%^&jkjkireykjavik
Retype new UNIX password: !@%^&jkjkireykjavik
passwd: password updated successfully

====================

Solution to NIS not starting in Kubuntu is , delaying the start of NIS during
boot.

sudo mv /etc/rc2.d/S18nis /etc/rc2.d/S30nis
sudo mv /etc/rc5.d/S18nis /etc/rc5.d/S30nis

Its not the perfect fix , but yeah ubuntu is still working on it
https://bugs.launchpad.net/ubuntu/+source/nis/+bug/233807
=================

Mysql Database

create database : –

mysql> create database myDB;
show databases;
use myDB
grant all privileges on myDB.* to ‘test’@’localhost’ identified by ‘test123’;
grant all privileges on myDB.* to ‘test’@’%’ identified by ‘test123’;
mysql> show grants;
safemode mysql
==========
/usr/local/etc/rc.d/mysql-server stop
/usr/local/bin/mysqld_safe –skip-grant-tables &

select * from user where user=’root’;
update user set Password=PASSWORD(“radasm31”) where user=’root’;
flush privileges;

Quit mysql
/usr/local/etc/rc.d/mysql-server start

============================

passwd change-:
pkill -9 mysql
mysqld_safe –skip-grant-tables &
UPDATE user SET password=password(‘passwd’) WHERE user=root
mysql -u root -h localhost -p
mysql> drop database award_mediawiki;

=======================

dump == mysqldump -u test_fbill test_feedbackbill -p > db_billing.sql

=======================

mysqldump -u [username] -p [database] > [database].sql
http://www.electrictoolbox.com/backing-up-mysql-with-mysqldump/
http://www.cyberciti.biz/tips/recover-mysql-root-password.html
killall -9 mysql
mysqld_safe –skip-grant-tables &
mysql mysql
> update user set password=password(“aMDd5a^2x”) where user=”root”;
>flush privileges;
vi /root/.my.cnf

[mysql]
user=root
pass=aMDd5a^2x

==================

Tar

tar -zxvf ….. Decompress filename.tar.gz
tar -cvf binuloan.tar binuloan
tar.gz…tar -xzvf
tar -xvf filename.tar
tar xvf gnome-doc-utils-0.6.1.tar.bz2

=================

Image resize script

#!/bin/bash
#
# resize image to maximum dimension of $res and write to tmpdir.
#

ls -al | grep -i “.jpg” | awk ‘{ print $9 }’ > list.txt

res=’1024×768′
tmpdir=’images’
q=’70’
mkdir $tmpdir >/dev/null 2>&1

exec < list.txt
while read lst
do
convert -quality $q -size $res -resize $res $lst $tmpdir/$lst >/dev/null
2>&1;
done
rm -f list.txt
tar -cvzf images.tar.gz $tmpdir
rm -rf $tmpdir
================================

Apache / PHP

In httpd.conf
check and add these lines
1.)For php4
LoadModule php4_module libexec/libphp4.so
2.)In mod_dir
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
3.)AddType application/x-httpd-php .php
++++++++++++++++++++++++++++++++++++++++
Apache 1.3.31
————-
wget http://apache.mirror.digitalspace.net/httpd/apache_1.3.31.tar.gz
tar -xfz apache_1.3.31.tar.gz
cd apache_1.3.31
SSL_BASE=/usr
/configure –prefix=/usr/local/apache –enable-module=so
–enable-module=expires –enable-module=rewrite –enable-suexec
–suexec-logfile=/usr/local/apache/logs/suexec_log –suexec-caller=nobody
make
make install
Mhash-0.8.18
————
wget http://unc.dl.sourceforge.net/sourceforge/mhash/mhash-0.8.18.tar.gz
tar -zxvf mhash-0.8.18.tar.gz
cd mhash-0.8.18
./configure –prefix=/usr
make
make install
Exif 0.5.12
———–
wget http://unc.dl.sourceforge.net/sourceforge/libexif/libexif-0.5.12.tar.gz
tar -zxvf libexif-0.5.12.tar.gz
cd libexif-0.5.12
./configure –prefix=/usr
make
make install
Curl 7.11.1
————
wget http://curl.webmeta.com/curl-7.11.1.tar.gz
tar -zxvf curl-7.11.1.tar.gz
cd curl-7.11.1
./configure –prefix=/usr
make
make install
Sablot-1.0.1
————
wget http://download-1.gingerall.cz/download/sablot/Sablot-1.0.1.tar.gz
tar -zxvf Sablot-1.0.1.tar.gz
cd Sablot-1.0.1
./configure –prefix=/usr
make
make install
CRYPT 2.5.7
———–
wget http://unc.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure –prefix=/usr –disable-posix-threads
rm -f /usr/lib/libmcrypt.*
rm -rf /usr/local/lib/libmcrypt
rm -rf /usr/lib/libmcrypt
make
make install
GD-2.0.22
———
wget http://www.boutell.com/gd/http/gd-2.0.22.tar.gz
tar -zxvf gd-2.0.22.tar.gz
cd gd-2.0.22
rm -f config.cache
./configure –prefix=/usr
make clean
make libgd.a
make
cp -fv .libs/libgd.a .
make install
Check if /usr/include/freetype2 is present, if so set
ttfopts=”–with-ttf –with-freetype-dir=/usr –enable-gd-native-ttf”
else set ttfopts=”–with-ttf”
Flash
—–
wget http://layer1.cpanel.net/buildapache/1/flash.tar.gz
tar -xzf flash.tar.gz -C /usr/local
cd /usr/local/flash
ln -s . lib
cd /usr/local/flash
ln -s . include
Ming 0.2a
———
wget http://layer1.cpanel.net/buildapache/1/ming-0.2a.tgz
tar -zxvf ming-0.2a.tgz
cd ming-0.2a
make
make install
PHP 4.3.6
———
wget http://static.php.net/www.php.net/distributions/php-4.3.6.tar.bz2
tar -jxf php-4.3.6.tar.bz2
cd php-4.3.6
./configure
–prefix=/usr/local/apache
–with-apxs=/usr/local/apache/bin/apxs
–with-mysql=/usr or /usr/local/bin/mysql according to where mysql binary is.
–with-pgsql if directory /var/lib/pgsql exists
–enable-bcmath
–enable-calendar
–enable-ftp
–enable-gd-native-ttf
–enable-magic-quotes
–with-ttf
–with-freetype-dir
-enable-track-vars
–enable-wddx
–enable-versioning
–with-zlib
–with-pear
–with-pspell
–enable-sockets
–with-imap
–with-imap-ssl
–with-gettext
–enable-mbstring
–with-jpeg-dir=/usr/local
–with-png-dir=/usr
–with-kerberos
–with-zlib

*–with-curl
*–enable-exif
*–with-xslt-sablot=/usr
*–with-mhash

**–with-swf=/usr/local/flash
**–with-mcrypt
**–with-ming=../ming-0.2a
**–with-gd
make
make install

================

Grub edit

(First of all, enter your BIOS setup and in BOOT Sequence window choose to boot with CDROM first.)

1) Boot with your Fedora Core Installation CD 1.

2) Type “linux rescue” at the prompt.

3) Answer the questions about keyboard and language.

4) Tell the rescue mode to use your proper partition to mount (the one that you want to get booted into)

Choose Continue

(Don’t choose Cancel or Read Only) because you want to edit grub.conf

5) When you come to the console prompt type:

sh-2.05# chroot /mnt/sysimage

6) Edit your grub.conf with nano, type:

sh-2.05# nano /boot/grub/grub.conf

7) You’ll only have to edit 2 lines:

splashimage=(hd0,4)/grub/splash.xpm.gz

root (hd0,4)
(This is your /boot partition, specifies which partition contains your Linux kernel image.
This is the grub.conf after editing your grub.conf

————————————————————————-
#grub.conf generated by anaconda

default=0

timeout=10
splashimage=(hd0,5)/grub/splash.xpm.gz

title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
root (hd0,5)

kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
initrd /initrd-2.4.22-1.2174.nptl.img

title Microsoft Windows XP Pro
rootnoverify (hd0,0)
chainloader +1
—————————————————————————-

8) Eject your Fedora Core installation CD1 and type exit to reboot your system.

sh-2.05# exit
=========================

VPN Client Setup

This is the procedure to install openvpn client

1. Install openvpn:

==================
apt-get install openvpn
==================

Then, download lzo-2.03 compression library from

==================
http://www.oberhumer.com/opensource/lzo/download/lzo-2.03.tar.gz
==================

Before installing it, do:

==================
apt-get install libcurl4-openssl-dev
==================

Then unpack lzo-2.03, cd to that folder and do:

==================
./configure
sudo make
sudo make check
sudo make test
sudo make install
==================

Once you are done with lzo install, cd to openvpn folder and do the following.

==================
./configure
sudo make
sudo make install
==================

Now, put your config file under /etc/client.ovpn and your keys under your Documents folder.
Make sure that you update client.ovpn so it reflects the new path. You can start the client using

==================
/usr/local/sbin/openvpn –config /etc/client.ovpn
==================

Next, you can create a shortcut. Make a small script /usr/local/bin/openvpn.sh and put
the following lines.(nano /usr/local/bin/openvpn.sh)

==================
#!/bin/bash
sudo /usr/local/sbin/openvpn –config /etc/client.ovpn
==================

Change the permissions with chmod +x or chmod 744 if you want to have exclusive execute rights and then do:

==================
sudo updatedb
==================

Then
.sh script

======

Setup SSH key

To ssh into server using ssh key. Follow these steps:

In the source server:

ssh-keygen -t rsa -N ''
Press Enter

Copy the key from that file.

Login to destination server and paste the key into the file:

 /root/.ssh/authorized_keys

http://tldp.org/LDP/abs/html/part4.html

=====================
How to configure NAT using IPtables

http://www.howtoforge.com/nat_iptables
====================
How to reset root password in FreeBSD
http://www.cyberciti.biz/tips/howto-freebsd-reset-recover-root-password.html
========================
Vps Server Installation
http://planet.admon.org/howto/openvz-on-centos-5-3-installation
-and-config/


 http://www.trainsignaltraining.com/free-video-training/



NB :- Any doubts or clarifications contact binuvs143@gmail.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s