Archives for Quick Tips & Tricks category
Posted in Quick Tips & Tricks by tux |
Here’s one trick to do that:
Step 1. Install FreeTDS
FreeTDS Website: http://www.freetds.org/ choose FreeTDS source distribution
Compile parameter: –prefix=/usr/local/freetds –enable-msdblib
Then, copy /etc/ld.so.conf, to /usr/local/freetds/lib; and then run ldconfig
Step 2. Change /usr/local/freetds/etc/freetds.conf
[sql2k]
host = your.mssql.server.ip
port = 1433
client charset = cp950
tds version = 8.0
b. tds version: 4.2 (for MS SQL Server 6.x); 7.0 (for 7.x); 8.0 (for 2000)
Step 3. Test FreeTDS connect to MS SQL Server
#cd /usr/local/freetds/bin
#./tsql -S sql2k -U sa
1> use mydatabase
2> select * from mytable
3> go
This is a preview of
quick tip: how to connect linux to MSSQL
.
Read the full post (238 words, estimated 57 secs reading time)
Posted in Quick Tips & Tricks by tux |
Want to test your Asterisk PBX system if it can sustain load and large traffic? Then you can use this tool.
Sipp is a performance testing tool for the SIP protocol. Its main features are basic SIPStone scenarios, TCP/UDP transport, customizable (xml based) scenarios, dynamic adjustement of call-rate and a comprehensive set of real-time statistics.
Sipp can be used to test real SIP equipments and very useful to emulate thousands of user agents calling your SIP system.
Installation:
1. Download the stable version of Sipp ( sipp-xxx.tar.gz)
2. Uncompress the tarball file
#tar zxvf sipp-xxx.tar.gz
#cd sipp
#make
Posted in Quick Tips & Tricks by tux |
These are the steps on adding additional hard drives on a pre-installed Linux server.
Drives will be detected and can be checked thru the “dmesg” command.
[root@localhost ~]#fdisk /dev/cciss/c0d1
press n to create partition, just use the default settings for it
press w to write exit
3. Create ext3 filesystem
[root@localhost ~]# mkfs.ext3 /dev/cciss/c0d1p1
4. Mount that drive to test but first create a directory where to mount it.
[root@localhost ~]#mkdir /data
[root@localhost ~]#mount -t auto /dev/cciss/c0d1p1 /data
This is a preview of
Quick tip: Adding new hard drives on an installed Linux Server
.
Read the full post (314 words, estimated 1:15 mins reading time)
Posted in Quick Tips & Tricks by tux |
1.compile cronolog (http://cronolog.org) and install it on /usr/local/sbin
2. backup orig /usr/local/apache-tomcat-5.5.20/bin/catalina.sh on /root
3. edit lines on catalina.sh from
org.apache.catalina.startup.Bootstrap “$@” start \
>> “$CATALINA_BASE”/logs/catalina.out 2>&1 &
to
org.apache.catalina.startup.Bootstrap “$@” start 2>&1 \
| /usr/local/sbin/cronolog “$CATALINA_BASE”/logs/catalina.out.%Y-%m-%d >> /dev/null &
4. Removed the line
touch “$CATALINA_BASE”/logs/catalina.out
5. Restart web service
#/usr/local/tomcat/bin/shutdown.sh
# service httpd stop
# /usr/local/tomcat/bin/startup.sh
#service httpd start
TESTING
1. Check tomcat logs to see generated Catalina.out per day
# ls -la /usr/local/tomcat/logs
-rw-r–r– 1 root root 65607 Nov 6 14:55 catalina.out.2007-11-06
2. browse ww2.freelinuxtutorials.com and login using test account to see if tomcat is working
This is a preview of
quick tip: rotating tomcat logs via cronolog
.
Read the full post (121 words, estimated 29 secs reading time)
Posted in Quick Tips & Tricks by tux |
Quick tip in backing up and restore your MySQL database:
Backing up and Restoring MySQL database
Backing up database:
Syntax:
mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]
o [username] -database username
o [password] -password for your database
o [databasename] – the name of your database
o [backupfile.sql] – the file to which the backup should be written.
Example:
mysqldump -u root -p asterisk > asteriskbackupmarch3.sql
(just input the password when prompt for password)
Multiple database:
Syntax:
mysqldump -u [username] -p [password] –databases [databasename1] [databasename2] > [backupfile.sql]
Example:
mysqldump -u asteriskuser -p –databases asterisk asteriskcdrdb > multibackup.sql
(then input db password)
Posted in Quick Tips & Tricks by tux |
Setting up mysql password is one of the essential task in systems administration
Note: Linux/Unix login root account for your operating system and MySQL root are different
You can use the built-in “mysqladmin” command to change MySQL root password. It can be executed anywhere as long the binary path is set on your Linux or Windows environment
Condition 1: If you have never set a root password for MySQL, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:
Posted in Quick Tips & Tricks by tux |
Finding CPU utilization is one of the important tasks in systems administration. There are built-in and 3rd party tools that you can use to perform this task.
1. top – displays Linux tasks
this is the most common command used in getting CPU usage
#top
2. mpstat – display CPU individually and processors related stats.
In order to use this, package “sysstat” should be installed. you can use apt-get (debian-based) or yum (red-hat based) command to install it via internet
#yum install sysstat
#mpstat
#mpstat -P ALL
3. sar – Collect, report, or save system activity information.
Posted in Quick Tips & Tricks by tux |
How to check if perl module is installed?
A. Checking if Perl Module is Installed
This is important on checking if a given perl module is already installed or not.
Code:
#perl -MModule::Name -e 1
if present, no errors appeared:
[root@darwin ~]# perl -MNet::SNMP -e 1
without:
[root@darwin ~]# perl -MNet::Telnet -e 1
Can’t locate Net/Telnet.pm in @INC (@INC contains: /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/local/lib/perl5/site_perl /usr/lib/perl5/site_perl .).
BEGIN failed–compilation aborted.
B. Check if the documentation of a perl module is installed.
Code:
perldoc Module::Name
e.g.