How to Reset the root Password in CentOS

January 7th, 2010

Follow the steps to Reset the root Password in CentOS.

i) Reboot your computer.
ii) At the boot loader menu> use the arrow keys to highlight the installation you wish to edit. Once selected, type the letter a. You are presented with a prompt that should look something like the following:
grub append> ro root=LABEL=/
iii) Press the spacebar once and type in the word single to tell the grub bootloader to boot into single user mode. The prompt should now look something like this:
grub append> ro root=LABEL=/ single
iv) Press Enter> and grub will boot single-user mode. Once finished, you should be presented with a prompt that looks similar to this:
sh-3.0b#
v) Type in passwd root and press enter then enter and re-enter your new root password. When complete, type reboot and press enter. You can now login in as root.

MySQL Error 28

December 22nd, 2009

How To Fix MySQL Error 28

Overview: MySQL: 1030: got error 28 from server handler

cd /tmp
df -i /tmp
df -h /tmp

Delete anything which is not supposed to be there. Stop all databases:

/etc/rc.d/init.d/chkservd stop
/etc/rc.d/init.d/mysql stop

Then fix tables:

cd /var/lib/mysql

Check each letter for errors:

myisamchk -cs a*/*.MYI

Repair where deemed necessary:

myisamchk -r a*/*.MYI
myisamchk -r b*/*.MYI
myisamchk -r c*/*.MYI
myisamchk -r d*/*.MYI
myisamchk -r e*/*.MYI
myisamchk -r f*/*.MYI
myisamchk -r g*/*.MYI
myisamchk -r h*/*.MYI
myisamchk -r i*/*.MYI
myisamchk -r j*/*.MYI
myisamchk -r k*/*.MYI
myisamchk -r l*/*.MYI
myisamchk -r m*/*.MYI
myisamchk -r n*/*.MYI
myisamchk -r o*/*.MYI
myisamchk -r p*/*.MYI
myisamchk -r q*/*.MYI
myisamchk -r r*/*.MYI
myisamchk -r s*/*.MYI
myisamchk -r t*/*.MYI
myisamchk -r u*/*.MYI
myisamchk -r v*/*.MYI
myisamchk -r w*/*.MYI
myisamchk -r x*/*.MYI
myisamchk -r y*/*.MYI
myisamchk -r z*/*.MYI

Turn everything back on:

/etc/rc.d/init.d/chkservd start
/etc/rc.d/init.d/mysql start

Checking with ddos attack on server

December 2nd, 2009

A quick and useful command for checking if a server is under ddos is:

netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

This will list the IPs taking the most amounts of connections to a server. It is vital t to remember that the ddos is becoming more and more planned and sophisticated and hackers are using fewer connections with more attacking ips. If this is the case you will still get low number of connections even while you are under a DDOS.

Another very important thing to look at is how many active connections your server is currently processing.

netstat -n | grep :80 |wc -l

netstat -n | grep :80 | grep SYN |wc -l

The first command will reflect the number of active connections which are open to your server. Most of the attacks generally seen work by starting a connection to the server and then not sending any reply making the server wait for longer. The number of active connections from the first command is going to vary in large amount but if you are much above 500 you are probably having problems. If the second command is over 100 you are having trouble with a syn attack.

To Block a certain IP address that on server .Please use following commands

—————–command——————————

route add ipaddress reject

for example route add 192.168.0.168 reject

You can check whether given IP is blocked on server by using following command

route -n |grep IPaddress

—————–command——————————

OR

use follwoing command to block a ip with iptables on server
—————–command——————————
iptables -A INPUT 1 -s IPADRESS -j DROP/REJECT

service iptables restart

service iptables save

—————–command——————————

Then KILL all httpd connection and restarted httpd service by using following command

killall -KILL httpd

service httpd startssl

System-level virtualization with Virtuozzo

November 20th, 2009

When you look for Virtual Private Server Solution you need a fully automated management tools that provide a customized solution in a virtual private server environment, Sofitech use Virtuozzo technology by which you can have a full root access and dedicated customization setting of your own without having to share any server resources with other user because virtuozzo technology is optimized towards performance and security and hence all Virtual Private Servers are isolated from each other and don’t have access to each other resources.

Why Virtuzoo?

Virtuozzo was designed to be

System-level virtualization:

Virtuozzo is available for Linux and Microsoft Windows, it can support hundreds of VEs on a single server due to its use of operating system-level virtualization.VEs impose lower overhead than VMs, as a result, more VEs can be supported on a given server. All VEs run atop a single operating system kernel. The VE mechanism multiplexes this one OS kernel to look like multiple OS (and server) instances, especially from the perspective of running applications, users, and network services. Virtuozzo is based on OpenVZ, and its concepts are similar to several other operating system-level virtualization implementations, including Solaris Containers, Linux-VServer and FreeBSD Jail.

Security & Scalability:

Virtuozzo technology is more tested and secure than VM technologies that all have friendly residents and are protected from hackers. The network is superb, It is nothing but excellent, you can monitors running from remote locations to check the status of your servers whenever it is require without zero downtime. Each VE can seamlessly scale up to the resources of an entire physical server.

Service:

The service is superb and the support staff are outstanding either you need rebooting servers, doing OS reloads, or even adding IPs to servers.

Easy Integration

Virtuozzo management tools employ technologies from industry standard integration such as LDAP, SOAP, XML RPC, CLI, SNMP APIs and SDK, it also include the third party tools which may be easily integrated including: HP, IBM, Microsoft, and CA.

Bandwidth for Voip Website

November 10th, 2009

Bandwidth is defined as the capability to transfer data you require to meet your specific requirement. Most of the time this could be expensive since bandwidth is recurring and you may require greater bandwidth for specific reason like for example voice communication. Especially for voice communication, the bandwidth requirements are more important, since voice is a type of data which is bulkier than conventional text. This implies that the greater the connection speed, the better the voice quality you can get. Today, broadband connection is common talk and getting cheaper and cheaper but to find out reliable hosting company is little bit difficult.

While choosing website hosting providers depending on your requirement because VOIP Bandwidth consumption naturally depends on the codec used, you will need disk space and bandwidth which can meet your overall requirement. however if you plan something to publish a website that does not require lot of contents then the disk space requirement may not be a huge problem for you but you may require more bandwidth the site grow overtime. In most cases, a disk space with 300MB to 500MB should be enough to meet your hosting requirement in general. However if you wish to host a website with massive amount of voice communication, graphic pictures, video files, podcasting, mp3 then you should think about a web hosting plan that provide huge disk space, so in such case you may consider bandwidth from 500MB to 1500 MB and best if you look for a dedicated hosting plan for more resource and space.

Likewise, the bandwidth requirement will depend on your website traffic requirement and need regular evaluation too. Apparently, a website that anticipates attracting high traffic will consume the monthly bandwidth greater way. In such case you will need to find a website hosting service that offer huge bandwidth with 50 GB to 100 GB per month. Depending on your website requirement, it would be key consideration to select a web hosting service that provide sufficient amount of disk space and bandwidth to avoid any future problem.

KDE 4.2.2 Release

May 5th, 2009

KDE team has announced the release of KDE 4.2, code named “Cano” which includes the following fixes:

* Stability fixes in KRunner – KRunner’s threaded search for results is now more robust and a possible deadlock condition has been fixed.

* Performance enhancements in KMail – Synching email of cached IMAP accounts is now faster, a number of displaying changes makes reading emails smoother experience

* Bugfixes, performance improvements and optimization in KHTML – Text rendering has been optimized, support for CSS selectors has further been improved.

For more info please check the kde.org site

http://www.kde.org/announcements/announce-4.2.2.php

Non-Legacy Extensions-Joomla 1.5

April 21st, 2009

Joomla 1.5 Non-Legacy Extensions

* AdSense Module (Clicksafe) for Joomla 1.5
* Random Image Plus
* Template Chooser Module
* yvComment
* yvSmiley
* JXplorer (File Management And Sharing System)
* Alias for PageTitle Plugin (SEO without core hack)
* Stage6Plugin
* Slider Plugin
* Custom Code
* Bad Behaviour Plugin
* Hello World
* Hello World 2
* NoFollow Plugin
* Ulti Clocks
* OSTWigits – Captcha
* BW Google Verified Plugin
* Ulti Sudoku
* World Time Clock
* WikiBot2
* Joomla! 1.5 templatebuilder for Dreamweaver
* MjazTools Personalize
* Radius Authentication Plugin
* SearchCloud and Lists 2.2 – SEO Boost – 1.5 Native
* Translations Manager
* eXtplorer
* JC User Import
* Joomla Advanced Message
* Jx Latest Commented
* IncludePHP
* RokClub
* RokTodo
* RokSlideshow
* RokZine (commercial)
* RokFinder
* RokThings (club membership required)
* RokDownload
* RokComment (club membership required)
* RokBridge
* mod_zulu
* Manifest Maker for Components

Courtesy: Joomla Forums

There are many hosting companies those providing Joomla Hosting, while choosing a host providers for joomla make sure to choose a hosting company that offering personalized plans and providing dedicated support level for Joomla.

Step to Lock File in Win Rar & Win Zip

February 24th, 2009

Here are the step by which you can lock file in win rar and win zip…You can do it simply using win rar..

Nearly all archives support giving password, including WinZip, 7-Zip and it’s not something unusual with Win Rar. However Win Rar is more comfortable to lock a file with password and if you are setting access like this, it is better you set the compression level to “Store”, which will make the compression and decompression faster, since the main endeavor here is to set a password.

1) Right click on the file for which you want the password to b put.
2) Click on “Add to Archive”.
3) Then go to Advanced tab.
4)Click on set password…choose your password.
5) Click ok.
6) A winrar file with your filename will be created.
7) Next you may delete the original file, since you have now compressed it with a password.Anyone trying to open the rar file won’t be able to open that, except he knows the password.

CSS shorthand Property Guideline

October 11th, 2008

There is actually no official guideline for each CSS shorthand property value, however this may help you during design work that we have organized collectively.

Background
background-color:#fff;
background-image:url(background.gif);
background-repeat:no-repeat;
background-position:top left;

Woh… it’s too long, take a look at this.
background:#fff url(background.gif) no-repeat top left;

Font
font-size:1em;
line-height:2em;
font-weight:bold;
font-style:italic;
font-family:arial;

Shorthand:
font:1em/2em bold italic serif;

Margin & padding
There are different shorthand properties for margin & padding.

Four different values
margin-top:10px;
margin-right:5px;
margin-bottom:15px;
margin-left:20px;

shorthand:
margin:10px 5px 15px 20px; (top, right, bottom, left)

Three different values
margin-top:10px;
margin-right:5px;
margin-bottom:15px;
margin-left:5px;

shorthand:
margin:10px 5px 15px; (top, right and left, bottom)

Two different values
margin-top:10px;
margin-right:20px;
margin-bottom:10px;
margin-left:20px;

shorthand:
margin:10px 20px; (top and bottom, right and left)

One value
margin-top:10px;
margin-right:10px;
margin-bottom:10px;
margin-left:10px;

shorthand:
margin:10px; (top, bottom, right and left)

These rules also apply to padding and border.

Border
border-width:1px;
border-color:#000;
border-style:solid;

shorthand:
border:1px solid #000;

border:1px solid #f00;
border-left:5px dotted #00f;
border-top:10px dotted #00f;

shorthand:
border:1px solid #336;
border-width:10px 1px 1px 5px;
border-color:#00f #f00 #f00 #00f;

Lists
list-style:#fff;
list-style-type:none;
list-style-position:outside;
list-style-image:url(bullet.gif);

Shorthand:
list-style: none outside url(bullet.gif);

Color
color:#000000;

shorthand:
color:#000;

These values as defined for RGB, if both R values are similar (00 in current example), then you can combine them as one (0).

Amother example

color:#00ff00;

shorthand:
color:#0f0;

Tweaks on the Linux server

October 2nd, 2008

The following linux security document will help you to tweak on the linux server for the security stuff
and help you how do you know whether you’ve been compromised or not?

1. Exim.
Enable extended logging :
Add the following line in exim, below the first line recommended
log_selector = +address_rewrite +all_parents +arguments
+connection_reject +delay_delivery +delivery_size +dnslist_defer
+incoming_interface +incoming_port +lost_incoming_connection +queue_run
+received_sender +received_recipients +retry_defer +sender_on_delivery
+size_reject +skip_delivery +smtp_confirmation +smtp_connection
+smtp_protocol_error +smtp_syntax_error +subject +tls_cipher +tls_peerdn
+\

Fommail Trap
http://void.thunderteam.org/fm-trap.html

For Securing Exim this could be a Good resource
http://www.rvskin.com/index.php?page=public/antispam

2. Httpd :

install mod_security
install mod_dosevasive (causes problem with FP sometimes though)

3. PHP

disable_functions = “system,exec”

eAccelerator for PHP acceleration
http://sourceforge.net/projects/eaccelerator

4. Some small recommended apps

Install BFD from rfxnetworks.net
Install LSM from rfxnetworks.net
APF from rfxnetworks.net ( since we have portsentry not really required )
rkhunter can be found on www.rootkit.nl

5. cpanel script to disable compilers incase we have not done this yet
/scripts/compilers off

6. MYSQL

mysql query cache
vi /etc/my.cnf
query-cache-type = 1
query-cache-size = 100M
100M can be changed according to how busy the server is

7. Securing some binaries

chmod 750 /usr/bin/rcp
chmod 750 /usr/bin/wget
chmod 750 /usr/bin/lynx
chmod 750 /usr/bin/links
chmod 750 /usr/bin/scp
chmod 000 /etc/httpd/proxy/

Also consider to check this;

* Check your log files,
* Look for setuid/setgid files, especially if they are owned by root
* Check what your integrity checker has to say about your system binaries
* Check for packet sniffers which may or may not be running
* If you didn’t install it, it shouldn’t be there
* Check your crontabs and at queues.
* Check for services that shouldn’t be running on your system
* Check /etc/passwd for new accounts/inactive accounts that have suddenly become active