Monday 30 June 2014

Trigger an action via CSF when server load is high on Server


Config Server Firewall works well by default. But if you customize it some, it can be even more poweful of a tool. When your load is high, you usually receive an alert from CSF. However, those reports contain a limited amount of information. If your receive these high server alerts often and want more information about what is actually going on when high load averages occur, then do the following. You can have lfd send you custom reports by using the PT_LOAD_ACTION option within the CSF configuration.First, login to shell.


Then create a file call /etc/csf/load.sh


touch /etc/csf/load.sh
nano /etc/csf.load.sh

Add the following contents to the file:



#!/bin/sh

>/etc/csf/csf.report

iostat -d 1 5 >> /etc/csf/csf.report

iostat -x -d 1 5 >> /etc/csf/csf.report

mpstat -P ALL >> /etc/csf/csf.report

top -b -n 1 >> /etc/csf/csf.report

netstat -autpn

mail -s “Load Report” root < /etc/csf/csf.report



Save the file.


Then, change the chmod settings of the file:


chmod +x /etc/csf/load.sh

Finally, edit /etc/csf/csf.conf and goto the section labeled “PT_LOAD_ACTION”. Add “/etc/csf/load.sh” so that it now looks like this:


PT_LOAD_ACTION = "/etc/csf/load.sh"

Restart csf:

csf -r

That’s it! Now when you receive a high CPU load alert, you will also receive an email with a lot more information in it. If you want CSF to automatically restart apache too, you can add the following line to the end of the load.sh file:


service httpd restart

And then save the file and restart config server.



Thursday 26 June 2014

Upgrading PostgreSQL

To upgrade a PostgreSQL installation start by dumping all the existing databases. You should do this before stopping the current database server
$ PGUSER=postgres /usr/bin/pg_dumpall > dump.sql
$ sudo /etc/init/d/postgresql stop
$ sudo mv /usr/local/pgsql /usr/local/pgsql.old


Build and install your new version. Be sure to create a PGDATA directory that is owned by the postgres user. Initialize the PGDATA directory with initdb
$ sudo mkdir /usr/local/pgsql/data
$ sudo chown postgres:postgres /usr/local/pgsql/data
$ sudo -u postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data


Once you have created your new database, start the new database server and populate the new database with the data you dumped from your old system:


$ sudo -u postgres /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
$ sudo -u postgres /usr/local/pgsql/bin/psql -d postgres -f dump.sql



Upgrading PostgreSQL

Problem with yum update

Following is the error that occurred :

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
addons | 951 B 00:00
base | 2.1 kB 00:00
extras | 1.1 kB 00:00
updates | 1.9 kB 00:00
Not using downloaded repomd.xml because it is older than what we have:
Current : Tue Feb 9 08:57:23 2010
Downloaded: Tue Jan 26 09:27:44 2010
Excluding Packages in global exclude list
Finished
Setting up Update Process
No Packages marked for Update

Solution :


Run the following two commands :

yum clean all
yum check-update

That should fix the issue.



Problem with yum update

How to Enable Sound in VMWare Server 2.0


So I had switched from VirtualBox to VMWARE since its free and has much easier bridging behind the scenes for my virtual machines. Currently I run Linux as my main computer and well the necessities of certain office windows products I was missing and their Linux counterparts didn’t work as well. I had created a windows xp virtual machine from my computers license key since I no longer have the thing installed.


Creating the virtual machine and setting up Linux went fine and smooth. Once in windows I started to tweak it and noticed there is no sound. I had shut down the machine and tried to add a sound device on “auto detect” was my only option. Booting the virtual machine I received an error that the sound was not able to be initialized, where I started to search the internet with no luck.


Finally I had figured it out and I have SOUND! Below you can find the steps I took and hope they work out as well for you as for me.


First is first – figure out what your device is for sound. I loaded up amarok and went to the configuration. From there to “Engine” and there it beholds “Device:”. For me there were two options:






1 /dev/dsp




2 /dev/sound/dsp



I had restarted amarok with each as my device and figured out that /dev/dsp was the one for me.


Then go to “/var/lib/vmware/Virtual Machines/” and open “.vmx” and look for the following lines:






sound.present = "TRUE"





sound.allowGuestConnectionControl = "FALSE"




sound.fileName = "/dev/dsp" (changed from -1)





sound.autodetect = "FALSE" (changed from TRUE)




sound.pciSlotNumber = "36"




sound.startConnected = "TRUE"



Save the file and reboot the virtual machine and there we have sound! Isn’t that fantastic?!? If you have comments or suggestions please leave them as others might be experiencing the same issues as you.





How to Enable Sound in VMWare Server 2.0

How to use gmail with mutt

For sending and receiving you mails, with the famous mail client mutt, insert the following lines into your ~/.muttrc


set smtp_url = “smtp://username@smtp.gmail.com:587/”
set smtp_pass = “password”
set from = “username@gmail.com”
set realname = “Your Real Name”


you can also use fetchmail to get your mail automatically.
so, edit the ~/.fetchmailrc and add the following :


poll smtp.gmail.com protocol imap user “username” password “password” mda “/usr/bin/procmail -d %T” ssl


That’s great if we will receive notification when a new mail arrived.
for that add the following lines into a shell script, we will name it checkmail.


$ cat >checkmail<<EOF
#!/bin/sh
if [ "$1" = "-v" ]; then
EXTRAARG=”-v”
fi
fetchmail -a -K $EXTRAARG >/dev/null 2>&1


if [ "$?" = "0" ]; then
DISPLAY=:0.0 /usr/bin/notify-send -t 0 -u critical -h “int:x:168? -h “int:y:100? -i /home/mezgani/photo/mail.jpg “?????? ????” “New mail received”
fi
EOF


Ok, right now we will define an entry to crontab, which will call the checkmail script every 5min.
of course change the path /home/handrix/bin/checkmail by the emplacement of the script in you host.


*/5 * * * * /home/mezgani/bin/checkmail



How to use gmail with mutt

Wordpress mod_rewrite rules taking over mod_status

While working on setting up a monitoring solution for a big wordpress installation, I realized that the server-status url was not working as expected even ifmod_status was configured correctly:


ExtendedStatus On


SetHandler server-status
Order deny,allow
Deny from all
Allow from some_ips


The .htaccess wordpress rules were taking over this and the server-status url was returning a page not found error from within wordpress. This was happening because of the way how the rewrite rules are setup to handle all the permalinks on the site, and for any non-existing file send it to index.php:
# BEGIN WordPress


RewriteEngine On
RewriteBase /
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteRule . /index.php [L]


# END WordPress

This works fine with any aliases defined in apache, but the mod_status handler was going to the rewrite rules first, hence the problem. This is not a wordpress problem, and should happen with any other application (like zend framework is one other example that comes to my mind right now) that uses the same type of catch-all rewrite rules to handle all the urls inside the application. The solution in this case is to specifically add a rewrite rule to not have the server-status url processed and sent to the default rule:
RewriteCond %REQUEST_URI !=/server-status
and the wordpress rewrite rules should look like this:
# BEGIN WordPress


RewriteEngine On
RewriteBase /
RewriteCond %REQUEST_URI !=/server-status
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteRule . /index.php [L]


# END WordPress



Wordpress mod_rewrite rules taking over mod_status

Cannot send emails- RoundCube just shows “Sending Message”

I found a problem with Roundcube, it shows sending message and hangs up there and actually it doesn’t send message anymore. I found the following solution here.


Problem with Roundcube, installed when updated to newest CURRENT release. – Page 3 – cPanel Forums:


vi /usr/local/cpanel/base/3rdparty/roundcube/config/main.inc.php


and changed


$rcmail_config['smtp_user'] = ‘%u’;
to
$rcmail_config['smtp_user'] = ”;



Cannot send emails- RoundCube just shows “Sending Message”

Cannot edit DNS zone after cPanel update

Issue :


After updating all the cPanel software, following error occurs when trying to Edit a DNS zone :


Unable to parse zone: Error while parsing zonedata for *DOMAIN NAME HERE*.com: expected valid rname, line 4 …propagated at /usr/local/cpanel/Cpanel/CPAN/Net/DNS/ZoneFile/Fast.pm line 142.


Fix :


The error means that the dns zone has invalid data in it and it cannot be loaded. So you need to recreate the zone to fix this.


You can use the following cPanel script to do this :


/scripts/pkgacct accountname ( just to backup the account)


/scripts/killdns domainname


/scripts/adddns –domain domainname


Please note that while recreating the domain using the above script it will not create the sub-domain. It will create the default DNS records. You can also specify the ip address using ” –ip X.X.X.X ” option


After running the scripts, you can manually add the entries for the sub-domains .



Cannot edit DNS zone after cPanel update

To make writable session save path

Just put the following code in your .htaccess


php_value session.save_path ‘/tmp’




To make writable session save path

Upcp Gets Killed Automatically

Do The Following if /scripts/upcp –force gets killed automatically.


wget -O scripts.tar.bz2


http://httpupdate.cpanel.net/cpanelsync/RELEASE/scripts.tar.bz2


tar -x -v -C / -j -p -f scripts.tar.bz2


chmod 755 /scripts/cpanelsync


/scripts/cpanelsync httpupdate.cpanel.net /cpanelsync/RELEASE/scripts


/scripts/upcp –force



Upcp Gets Killed Automatically

Error while connecting to MySQL. Failover enacted

Mysql Error on the Cpanel server.


Error while connecting to MySQL. Failover enacted.


Fix :: Just Login to ssh and run the following command to fix the above error.

/scripts/perlinstaller --force DBD::mysql




Error while connecting to MySQL. Failover enacted

How to repair Grub loader



GNU GRUB (“GRUB” for short) is a boot loader package from the GNU Project. GRUB is the reference implementation of the Multiboot Specification, which allows a user to have several different operating systems on their computer at once, and to choose which one to run when the computer starts. GRUB can be used to select from different kernel images available on a particular operating system’s partitions, as well as to pass boot-time parameters to such kernels.


Every once in a while windows may have the inclination to overwrite your bootloader with its own. This will make accessing your system impossible.
Well, there is a solution to override the 512 Kb of your drive that represent the MBR.
In the fact you can follow these steps to repair your GRUB loader:
Boot your PC with a Live CD in the drive, after run fdisk to display list of your partitions system.


$ sudo /sbin/fdisk -l


Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa588e9cb


Device Boot Start End Blocks Id System
/dev/sda1 * 1 30071 241545276 83 Linux
/dev/sda2 30072 30401 2650725 5 Extended
/dev/sda5 30072 30401 2650693+ 82 Linux swap / Solaris


In that fdisk example, the root linux partition reside in /dev/sda1
Create a directory /mnt/root and mount the linux partition.


$ sudo mkdir /mnt/root
$ sudo mount /dev/sda1 /mnt/root


Change the root “/” directory to our old root directory the /mnt/root
$ sudo chroot /mnt/root /bin/bash


Execute the grub command
$ sudo grub –config-file=/boot/grub/menbu.lst

GNU GRUB version 0.97 (640K lower / 3072K upper memory)


[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]


Now we need to tell grub where are the grub files:
If you don’t know where they are, type:
grub> find /boot/grub/stage1
(hd0,0)


Now type the following, replacing hd0 with the physical drive linux is installed
grub> root (hd0,0)


Remember that for grub (hd0,0) means hda (primary controller master), first partition.
Let’s install the grub on hd0
grub> setup (hd0,0)
grub> quit


$ sudo reboot
Now you can reboot safely, with your linux system. –Ali






How to repair Grub loader

Turn off bandwidth monitoring

Go to WHM >> Service Configuration >> Service Manager.
Look for ‘cPBandwd’. Make sure that the check box besides that is unchecked.
Save the settings and that should be it !



Turn off bandwidth monitoring

How To Reinstall Horde

To reinstall Horde, preserving the existing database, you can use the following:


/usr/local/cpanel/bin/update-horde –force



How To Reinstall Horde

Parallels Helm cannot reseller can no longer delete customer account



Suddenly one of my resellers stopped being able to delete a customer account and was getting the following error

Unable to perform the requested action as this Login has insufficient permissions

The rest of the resellers on the server however were able to delete accounts without problem. After several hours of searching and contacting parallels support the resolution was simple


The problem is insufficient account permissions for the reseller.


What I did was going to Home > Account Settings > Customer Account Roles, selecting the ‘Reseller’ role (the only available),


selecting ‘Specify Permission’ instead of ‘Pre-defined Roles’ in its configuration page and adding the ‘Delete Account Profile’ from ‘Available Permissions’ to ‘Selected Permissions’.


Then I saved the changes I made and successfully deleted again…






Parallels Helm cannot reseller can no longer delete customer account

Install squirrelmail to Parallels Helm 4.1 as an application package (APS)



I recently needed to be able to offer squirrelmail 1.4 to customers using Parallels Helm 4.1


I downloaded the latest version of squirrelmail and bundled it up so that it can be added as a package in the control panel.


The config file is based on the original sample config file provided in the parallels sample application package. GUID created using this tool.


Please note


The way the config is setup it will create the following two directories which are above the web root of the domain (this is recommended by the squirrelmail documentation).


private/squirrelmail/data
private/squirrelmail/attach


Once installed your clients will be able to access this package through their Helm control panel at

Home > My Domains > yourdomain.com > Application Packs

Enjoy!


ps: as usual no waranties made and no liabilities accepted. Any questions let me know!


Download the application package for Helm






Install squirrelmail to Parallels Helm 4.1 as an application package (APS)

Reset MYSQL root password


Simple steps to reset the mysql root password if you have forgotten it.


1. Stop the mysqld daemon process.


2. Start the mysqld daemon process with the '–skip-grant-tables‘ option.


3. Start the mysql client with the -u root option.


4. Execute the following:

UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';

5. Execute the following:

FLUSH PRIVILEGES;




Reset MYSQL root password

Export the DB Schema ONLY


To dump the database SCHEMA only, without dumping any actual data :


mysqldump --no-data --tables -u YOUR_USER_NAME -p DATABASE_YOU_WANT_SCRIPTED >> FILENAME.sql

Actual example:


mysqldump --no-data --tables -u larry -p contacts >> contacts.sql

If you want the data to be exported, omit the ”–no-data” portion.





Export the DB Schema ONLY

Installing ntop on Red Hat Enterprise Linux / CentOS Linux / Debian



ntop is a network probe that shows network usage in a way similar to what top does for processes, dnstop for dns, ptop for postgresql, iotop, atop …


In interactive mode, it displays the network status on the user’s terminal. In Web mode, it acts as a web server, creating a HTML dump of the network status. It sports a NetFlow/sFlow emitter/collector, a HTTP-based client interface for creating ntop-centric monitoring applications, and RRD for persistently storing traffic statistics.


ntop is available for both Unix and Win32-based platforms. It has been developed by Luca Deri, an Italian research scientist and network manager at University of Pisa.


On Redhat or Centos:
For installing ntop on Red Hat or Centos, please follow these instructions:


Packages needed :
- libpcap: system interface for user-level packet capture
- libpcap-devel: development library for libpcap
- rrdtool: Time-series data storage and display system (programs)
- rrdtool-devel: Time-series data storage and display system (development)
- perl-rrdtool: Time-series data storage and display system (perl interface)
- graphviz: Graph Visualization Software


First install libpcap, and libpcap-devel using yum
$ sudo yum install libpcap-devel libpcap


The rrdtool, ntop and graphviz packages you can get them like this:



$ wget ftp://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/rrdtool-devel-1.2.30-1.el5.rf.i386.rpm
$ wget ftp://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/rrdtool-1.2.30-1.el5.rf.i386.rpm
$ wget ftp://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/perl-rrdtool-1.2.30-1.el5.rf.i386.rpm
$ wget http://dag.wieers.com/rpm/packages/ntop/ntop-3.3-1.el5.rf.i386.rpm


$ wget http://www.graphviz.org/graphviz-rhel.repo
$ sudo cp graphviz-rhel.repo /etc/yum.repos.d/
$ sudo yum update
$ sudo yum install graphviz


Installing perl-rrdtool, rrdtool, rrdtool-devel and ntop with rpm package manager :
$ sudo rpm -ivh perl-rrdtool-1.2.30-1.el5.rf.i386.rpm rrdtool-1.2.30-1.el5.rf.i386.rpm rrdtool-devel-1.2.30-1.el5.rf.i386.rpm ntop-3.3-1.el5.rf.i386.rpm


Type the following command to set ntop admin password, enter:
$ ntop -A
Sat Jul 4 14:31:49 2009 NOTE: Interface merge enabled by default
Sat Jul 4 14:31:49 2009 Initializing gdbm databases
ntop startup – waiting for user response!
Please enter the password for the admin user:
Please enter the password again:
Sat Jul 4 14:32:24 2009 Admin user password has been set


The following command start ntop:
$ sudo /usr/bin/ntop -d -L -u ntop -P /var/ntop –skip-version-check –use-syslog=daemon -d


If you have many interfaces you can specify them like this :
$ /usr/bin/ntop -i “eth0,eth1? -d -L -u ntop -P /var/ntop –skip-version-check –use-syslog=daemon -d


Well we need to run ntop as services, please refer to /etc/ntop.conf:
$ sudo vim /etc/ntop.conf
–user ntop
–db-file-path /var/ntop
–interface eth0,eth1
–use-syslog
–http-server 3000
–https-server 3001
–local-subnets 192.168.1.0/20
–domain mydomain.org
–daemon


At last start your ntop service:
$ sudo service ntop start


By default ntop listen on 3000 port. You can view ntop stats by visiting following url:
http://server:3000/ or https://server:3001/
as defined in the ntop.conf.


On Debian:
The ntop package is present in the Debian repository, so you can get simply by:
$ aptitude install ntop


Personalize your ntop config file. After, you can start the service :
$ sudo invoke-rc.d ntop start






Installing ntop on Red Hat Enterprise Linux / CentOS Linux / Debian

Checking or Changing DNS entries on Mac OSX



To check your Personal VPN DNS entries on a Mac OSX computer while connected to SurfBouncer:


1) From the dock, select ‘System Preferences’.


2) Click on ‘Network’.


3) Select one of the available connections such as ‘AirPort’, ‘Ethernet’ and ‘PPPoE’.


4) Click on ‘Advanced’.


5) Click on ‘DNS’.


6) You should see a screen similar to the one below. The DNS servers are listed on the left.


7) Please send a screen shot and repeat for all available connections.







To take a screen shot of this page, Click on:


Command + Shift + 4 and then Space Bar


A camera will appear. Place it over the window and click. The image will be saved to your desktop.


Attach the image in your email back to us.

(Note: The actual DNS servers may be different than the ones shown above.)


To change DNS settings:


1) Exit Tunnelblick


2) From the dock, select ‘System Preferences’.


3) Click on ‘Network’.


4) Click on the lock in the lower left hand corner to unlock it, if it is locked.


5) Select one of the available connections such as ‘AirPort’, ‘Ethernet’ and ‘PPPoE’.


6) Click on ‘Advanced’.


7) Click on ‘DNS’. You should see a screen similar to the one above.


8) Click on the ‘+’ button and enter the new DNS address we provide you.


9) Drag the new addresses to the top of the list. (If there are grayed out addresses they will stay on top but are inactive.)






Checking or Changing DNS entries on Mac OSX

Converting Images with Command-line

The  convert command is a powerful tool. Here is some ways to manipulate images using the convert command in Linux.


Image types that convert supports include .jpg, .bmp, .gif, .png, .tiff, .xpm,
.xwd, and .pcx


Resizing images:


$ convert -resize 800x400 kitty.jpg kitty-sm.jpg
$ convert -sample 50%x50% dog.jpg dog-half.jpg


The first example creates an image (kitty-sm.jpg) that is 800 × 400 pixels. The second example reduced the image dog.jpg in half (50%x50%) and then saves it as dog-half.jpg.


Creating thumbnails:


$ convert -thumbnail 120x120 a.jpg a-a.png
$ convert -thumbnail 120x120 -border 8 a.jpg a-b.png
$ convert -thumbnail 120x120 -border 8 -rotate 8 a.jpg a-c.png


Where the convert commands can really shine are when you use them in scripts. Instead of resizing, rotating a single file, you can do any or all of
those things to a whole directory of files.


Here’s an example of a script you can run to resize an entire directory of photos to
800 × 400 pixels to upload to flickr or something:


$ cd $HOME/images $ mkdir small $ for pic in `ls *.png` do echo "converting $pic" convert -resize 800x400 $pic small/sm-$pic done



Converting Images with Command-line

Manually Upgrading MySQL

If at all possible, you should use /scripts/mysqlup to do a MySQL upgrade, however, if you need a version of MySQL outside of what they are offering in current cPanel versions, it is possible to upgrade manually.

These are the instructions for performing a manual upgrade of MySQL to 5.1.30, but this typically applies to all versions over 4.1 and higher. Typically it is best to upgrade to whatever the latest stable branch of MySQL is and apply these instructions to install the RPMS.


If this is on a live system, make sure to make backups of the databases.


# mkdir /root/dbbackups

# touch /root/dbbackups/list



for db in `mysql -e ‘show databases’ |awk ‘print $1’ | grep -v Database`



do
# mysqldump –add-drop-table $db > /root/dbbackups/$db.sql && echo $db >> list

done

# mkdir /root/sqllibs

# cp /usr/lib/libmysqlclient.* /root/sqllibs


Do a search for all installed MySQL packages to be removed:

# rpm -qa | grep -i mysql-

This should present a list of 5 or 6 MySQL RPM’s that are installed, likely. Uninstall them one by one with the rpm -e like so:

# rpm -e MySQL-devel-4.1.21-0.glibc23

Some packages are dependencies of each other, so you may need to remove one before being able to remove another.


Download the binaries for the OS version and MySQL version you are using from the cPanel repo:


http://httpupdate.cpanel.net/mysqlinstall/


execute rpm -i for each package (ex: pm -i MySQL-client-5.1.30-0.glibc23.i386.rpm)


Edit /var/cpanel/cpanel.config and change the MySQL version to 5.1 (or whatever version you’re running now). Then run this command:

# touch /etc/mysqlupdisable

This will keep cPanel from resetting or reverting back to its original MySQL version during updates.


Restart MySQL first to make sure that it can at least start (which it should). Once you’ve verified this, run mysql -V to make sure that the correct version is installed. You should see output similar as below:

root@server [~]# mysql -V

mysql Ver 14.13 Distrib 5.1.30-beta, for pc-linux-gnu (i686) using readline 5.0


MySQL should now be up and running, but it’s likely that trying to log in directly as the root user will fail. Before Following the below steps, make sure you can do a ‘mysql -u root’ and log in successfully. If not, you’ll need to set the root password. By default, MySQL has a blank root password which will need to be set to ours…twice.


Recopy the libs, but don’t overwrite any that already exist:

# mv /root/sqllibs/libmysqlclient.* /usr/lib/mysql/

Next update cPanel’s PHP and DBD MySQL bundle for perl by executing the following:

# /scripts/perlinstaller –force Bundle::DBD::mysql

# /scripts/makecpphp


Verify that phpMyAdmin and php -m load properly and without errors.






Manually Upgrading MySQL

What is Bandwidth?



Bandwidth


Bandwidth is a central concept in many fields, including information theory, radio communications, signal processing, and spectroscopy.


DEFINITION 1: Bandwidth


Is a measure of frequency range, measured in hertz.


EXAMPLE


The range of frequencies within which the performance of the antenna, with respect to some characteristics, conforms to a specified standard. (2.4-2.5GHz antenna has 100MHz bandwidth).



DEFINITION 2: Bandwidth


The amount of data that can be transmitted in a fixed amount of time, expressed in bits per second(bps) or bytes per second.


EXAMPLE


A V.90 modem supports a maximum theoretical bandwidth of 56 Kbps. Fast Ethernet supports a theoretical maximum bandwidth of 100 Mbps.



According to the Shannon-Hartley theorem, the data rate of reliable communication is directly proportional to the frequency range of the signal used for the communication. In this context, the word bandwidth can refer to either the data rate or the frequency range of the communication system (or both).

Bandwidth is a key concept in many applications. In radio communications, for example, bandwidth is the range of frequencies occupied by a modulated carrier wave, whereas in optics it is the width of an individual spectral line or the entire spectral range.

There is no single universal precise definition of bandwidth, as it is vaguely understood to be a measure of how wide a function is in the frequency domain. For different applications there are different precise definitions. For example, one definition of bandwidth could be the range of frequencies beyond which the frequency function is zero. This would correspond to the mathematical notion of the support of a function (i.e., the total “length” of values for which the function is nonzero). Another definition might not be so strict and ignore the frequencies where the frequency function is small. Small could mean less than 3 dB below (i.e., less than half of) the maximum value, or it could mean below a certain absolute value. In short, as with any definition of the width of a function, there are many definitions available, which are suitable for different applications.


Analog systems


For analog signals, which can be mathematically viewed as a function of time, bandwidth is the width, measured in hertz, of a frequency range in which the signal’s Fourier transform is nonzero. This definition can be relaxed wherein bandwidth would be the range of frequencies that the signal’s Fourier transform has a power above a certain threshold, say 3 dB within the maximum value, in the frequency domain. Bandwidth of a signal is a measure of how rapidly it fluctuates with respect to time. Hence, the greater the bandwidth, the faster the variation in the signal. The word bandwidth applies to signals as described above, but it could also apply to systems. In the latter case, to say that a system has a certain bandwidth is a short-hand for saying that the transfer function of the system has a certain bandwidth. As an example, the 3 dB bandwidth of the function depicted in the figure is f2 ? f1, whereas other definitions of bandwidth would yield a different answer.





Figure 1:
-3dB bandwidth)
-3dB bandwidth) (Bandwidth.jpg)

The fact that real baseband systems have both negative and positive frequencies can lead to confusion about bandwidth, since they are sometimes referred to only by the positive half, and one will occasionally see expressions such as B = 2W, where B is the total bandwidth, and W is the positive bandwidth. For instance, this signal would require a lowpass filter with cutoff frequency of at least W to stay intact. The bandwidth of an electronic filter is the part of the filter’s frequency response that lies within 3 dB of the response at the center frequency of its peak. In signal processing and control theory the bandwidth is the frequency at which the closed-loop system gain drops to ?3 dB. In basic electric circuit theory when studying Band-pass and Band-reject filters the bandwidth represents the distance between the two points in the frequency domain where the signal is frac1sqrt2 of the maximum signal strength. In photonics, the term bandwidth occurs in a variety of meanings:


  • the bandwidth of the output of some light source, e.g., an ASE source or a laser; the bandwidth of ultrashort optical pulses can be particularly large

  • the width of the frequency range that can be transmitted by some element, e.g. an optical fiber

  • the gain bandwidth of an optical amplifier

  • the width of the range of some other phenomenon (e.g., a reflection, the phase matching of a nonlinear process, or some resonance)

  • the maximum modulation frequency (or range of modulation frequencies) of an optical modulator

  • the range of frequencies in which some measurement apparatus e.g., a powermeter) can operate

  • he data rate (e.g., in Gbit/s) achieved in an optical communication system






What is Bandwidth?

How To Add DomainKeys and SPF Records on CPanel Servers

This how to describe how to add domainkeys and SPF (Sender Policy Framework) records on CPanel Servers. Whenever you create a domain on CPanel server using WHM, it wont add domainkeys and SPF records for particular domains. To add domainkeys and SPF records please use following steps.


We consider here we have a domain sohailriaz.com with cpanel username sohailri


Please note on CPanel servers most of the work is done using cpanel username which then reflect setting on particular domains. If you have several domains / sub domains under one username, it will add domainkeys and SPF records for all domains / subdomains.


Execute the following command on your CPanel server using root.

1 DomainKeys


1.1 Add DomainKeys for single user


/usr/local/cpanel/bin/domain_keys_installer sohailri

where sohailri is a username

1.2 Add DomainKeys for all CPanel users.


If you wish to add DomainKeys for all Cpanel users on your server, execute following command.

ls /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/domain_keys_installer $a
done

2 SPF (Sender Policy Framework)


2.1 Add SPF for single account.


/usr/local/cpanel/bin/spf_installer sohailri

2.2 Add SPF for all Cpanel accounts.


If you want to add SPF records for all cpanel accounts exist on your server then use the following command.

ls /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/spf_installer $a
done

3 Enable DomainKeys and SPF for every new CPanel account.


If you want to add DomainKeys and SPF for every new account created on Cpanel, then do the following.

vi /scripts/postwwwacct

postwwwacct is a file which execute after wwwacct (used to create account), paste following lines in the file

#!/usr/bin/perl

my %OPTS = @ARGV;
$ENVUSER = “$OPTS‘user’”;
system q(/usr/local/cpanel/bin/domain_keys_installer $USER);
system q(/usr/local/cpanel/bin/spf_installer $USER);




How To Add DomainKeys and SPF Records on CPanel Servers

How to solve Unhandled Error in Silverlight Application Code: 2104


I’ve found that I get this error every time I upload a Silverlight application to a new webserver. IIS does not have the correct settings by default.

The Problem: You ftp a Silverlight App to an IIS website, go to the website in a browser, and get the following error:

Message: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings


The Cause: The Silverlight Mime types (.xaml, .xap and .xbap) are not listed in that websites registered mime types, therefore IIS will not send those files to the browser.

The Solution: Open IIS on the server, go to HTTP headers, click on Mime Types, click “Add New” and add the following:

Extension – Mime Type
.xaml – application/xaml+xml
.xap – application/x-silverlight-app
.xbap – application/x-ms-xbap

Hit Apply and your application will load!




How to solve Unhandled Error in Silverlight Application Code: 2104

Changing multiple account ownerships via SSH

How to change the ownership of multiple accounts under /home via SSH? The option in WHM is a bit tedious.


Solution :


To change the ownership of all accounts to the respective user.user :


cd /home
ls -al | grep root


for i in `ls /var/cpanel/users/`; do chown $i:$i /home/$i ; done
for i in `ls /var/cpanel/users/`; do chown -R $i:$i /home/$i/* ; done


Then change the ownership of the individual public_htmls to their respective user.nobody:


for i in `ls /var/cpanel/users/`; do chown $i:nobody /home/$i/public_html ; done


Change the permissions for public_htmls to 750:


for i in `ls /var/cpanel/users/`; do chmod 750 /home/$i/public_html ; done


Fix the permissions for mail to work fine:


/scripts/mailperm


Fix the ownership of /home:


chown root.root /home



Changing multiple account ownerships via SSH

Unable login into the domain stats - Plesk

Search for the following entry in the /var/www/vhosts/domainName/conf/httpd.include: (/var/www/vhosts/domainName/conf/httpd.include is actually HTTPD_VHOSTS_D/domainName/conf/httpd.include):

AuthType Basic

AuthName “Domain statistics”

AuthUserFile /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat

require valid-user

Create the encrypted password using the (htpasswd generator):

http://home.flash.net/cgi-bin/pw.pl

(ex. testUser:sad#^hu78is45tsgf)

OR You can Also generate the encrypted password using the “htpasswd” command:

htpasswd -bdc

(eg. htpasswd -bdc testfile testUser testPass

Adding password for user testabc

# cat testfile

testUser:sad#^hu78is45tsgf

)

Append the obtained entry to the AuthUserFile (Here it is /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat).

cat >> /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat

testUser:sad#^hu78is45tsgf

Search for the following entry in the /var/www/vhosts/domainName/conf/httpd.include: (/var/www/vhosts/domainName/conf/httpd.include is actually HTTPD_VHOSTS_D/domainName/conf/httpd.include):
AuthType BasicAuthName “Domain statistics”AuthUserFile /var/www/vhosts/domainName/pd/d..httpdocs@plesk-statrequire valid-user


Create the encrypted password using the (htpasswd generator):http://home.flash.net/cgi-bin/pw.pl(ex. testUser:sad#^hu78is45tsgf)
OR You can Also generate the encrypted password using the “htpasswd” command:htpasswd -bdc(eg. htpasswd -bdc testfile testUser testPassAdding password for user testabc# cat testfiletestUser:sad#^hu78is45tsgf)
Append the obtained entry to the AuthUserFile (Here it is /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat).cat >> /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stattestUser:sad#^hu78is45tsgf



Unable login into the domain stats - Plesk

Not able to access VZPP (Virtuozzo Power Panel) for a VE.

Resolution


Make sure that “offline management” for the VE is enabled:


# grep OFFLINE_MANAGEMENT /etc/sysconfig/vz-scripts/VE_ID.conf
OFFLINE_MANAGEMENT="yes"


If “offline management”  is disabled (set to “no”), you have to enable it:


# vzctl set VE_ID --offline_management yes --save



Not able to access VZPP (Virtuozzo Power Panel) for a VE.

Important Directories In Linux

* /bin – essential UNIX commands such as ls, etc. Should contain all binaries needed to boot the system or run it in single-user mode…………… * /boot – files used during booting and possibly the kernel itself are stored here


* /dev – contains device files for various devices on system


* /etc – files used by subsystems such as networking, NFS, and mail. Includes tables of disks to mount, processes to run on startup, etc.


* /etc/profile.d – contains scripts that are run by /etc/profile upon login.


* /etc/rc.d – contains a number of shell scripts that are run on bootup at different run levels. There is also typically an rc.inet1 script to set up networking (in Slackwar), an rc.modules script to load modular device drivers, and an rc.local script that can be edited to run commands desired by the administrator, along the lines of autoexec.bat in DOS.


* /etc/rc.d/init.d – contains most of the initialization scripts themselves on an rpm-based system.


* /etc/rc.d/rc*.d – where “*” is a number corresponding to the default run level. Contains files for services to be started and stopped at that run level. On rpm-based systems, these files are symbolic links to the initialization scripts themselves, which are in /etc/rc.d/init.d.


* /etc/skel – directory containing several example or skeleton initialization shells. Often contains subdirectories and files used to populate a new user’s home directory.


* /etc/X11 – configuration files for the X Window system


* /home – home directories of individual users


* /lib – standard shared library files


* /lib/modules – modular device driver files, most with .o extensions


* /mnt – typical mount point for many user-mountable devices such as floppy drives, cd-rom readers, etc. Each device is mounted on a subdirectory of /mnt.


* /proc – virtual file system that provides a number of system statistics


* /root – home directory for root


* /sbin – location of binaries used for system administration, configuration, and monitoring


* /tmp – directory specifically designed for programs and users to store temporary files.


* /usr – directory containing a number of subdirectory with programs, libraries, documentation, etc.


* /usr/bin – contains most user commands. Should not contain binaries necessary for booting the system, which go in /bin. The /bin directory is generally located on the same disk partition as /, which is mounted in read-only mode during the boot process. Other filesystems are only mounted at a later stage during startup, so putting binaries essential for boot here is not a good idea.


* /usr/bin/X11 – most often a symbolic link to /usr/X11R6/bin, which contains executable binaries related to the X Window system


* /usr/doc – location of miscellaneous documentation, and the main location of program documentation files under Slackware


* /usr/include – standard location of include files used in C programs such as stdio.h


* /usr/info – primary location of the GNU info system files


* /usr/lib – standard library files such as libc.a. Searched by the linker when programs are compiled.


* /usr/lib/X11 – X Window system distribution


* /usr/local/bin – yet another place to look for comon executables


* /usr/man – location of manual page files


* /usr/sbin – other commands used by superuser for system administration


* /usr/share – contains subdirectories where many installed programs have configuration, setup and auxiliary files


* /usr/share/doc – location of program documentation files under Mandrake and Red Hat


* /usr/src – location of source programs used to build system. Source code for programs of all types are often unpacked in this directory.


* /usr/src/linux – often a symbolic link to a subdirectory whose name corresponds to the exact version of the Linux kernel that is running. Contains the kernel sources.


* /var – administrative files such as log files, used by various utilities


* /var/log/packages – contains files, each of which has detailed information on an installed package in Slackware. The same file can also be found at /var/adm/packages, since the adm subdirectory is a symbolic link to log. Each package file contains a short description plus a list of all installed files.


* /var/log/scripts – package installation scripts in Slackware are stored here. You can inspect these scripts to see what special features are included in individual packages.


* /var/spool – temporary storage for files being printed, mail that has not yet been picked up, etc.



Important Directories In Linux

Simple steps of changing your exim IP

Hey Remeber : You need to set RDNS for the IP then and then Only you can proceed further.


If you are in the danger of getting your main server IP block by SpamCop because you had a few anoying spamers abusing your server then you could simply change your exim mailserver IP to avoid the effect of your main IP beeing blacklisted…………


Below are some simple steps of changing your exim IP


Inside both incoming and outgoing exim mail server you will need to add an interface :
so just edit


pico /etc/exim_outgoing.conf


and


pico /etc/exim.conf


find
remote_smtp:
driver = smtp


and add interface = ip.you.want.to.use


example as shown below:


________________________
remote_smtp:
driver = smtp
interface = 22.22.22.22
_________________________


IP needs to be on server in order for this to work, hopefully this will help :)
BTW: Just a reminder – If there is an exim update when you upgrade your cpanel server you will need to re-enter the interface again



Simple steps of changing your exim IP

How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on CentOS 5.x

In this how to we’ll describe how to install ffmpeg, mplayer, mencoder, flvtool2, ffmpeg-php with all supported codecs to convert / manipulate videos easily on CentOS 5.x. If you want to run sites like youtube e.g www.indianpad.in, www.danceindiadance.in this howto will help you to install the base for your software. There are many other way to perform this but this works for me, so i want to share. –SR

1 Setting Up RPMForge Respository.


RPMForge repository (http://dag.wieers.com) is the biggest rpm respository for RHEL, CentOS for all versions. To enable RPMForge respository run following command to install all necessary files for getting RPMForge repository. The following command directly install rpm from http://da.wieers.com site.

rpm -Uhvhttp://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

This rpm will add necessary files in our repository configuration and can be viewed at /etc/yum.repos.d/rpmforge.repo

2 Install ffmpeg, mplayer, mencoder with all supported modules.


Now we have rpmforge repository, so we will use yum to install ffmpeg, mplayer, mencoder as well as all dependent software.

yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2

This command will some time to download and install all packages depends on your internet speed.

3 Install FFMPEG-PHP


ffmpeg-php is an extension for PHP that adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. ffmpeg-devel and php-devel is needed to compile ffmpeg-php from source code. Use following steps to install ffmpeg-php

cd /usr/src
wget http://garr.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
tar jxvf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
phpize
./configure
make
make install

It will copy the ffmpeg.so module in php default module location. Now you have to edit php.ini file to enable ffmpeg-php support in it by using ffmpeg.so module.

vi /etc/php.ini

and append following line

extension=ffmpeg.so

Restart apache service to take effect of php.ini

/etc/init.d/httpd restart

Run following command to ffmpeg module listing in php.

php -m | grep ffmpeg

Have a nice streaming. :)



How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on CentOS 5.x

How To Transfer CPanel Accounts

To transfer account you should have root access on both servers. Because to transfer account you need every thing to backup for transfer including Cpanel User / Pass (Same), Website, Database, Emails, Users, Stats etc. . The thing i like about CPanel is it will transfer accounts 100%, you will not miss any single think related to your accounts. This method implies on VPS’s and Dedicated Server where you can access WHM (Web Host Manager) or root shell.


Lets consider we have two servers A and B. Server A is the old server with two accounts and Server B is new server to which we will transfer accounts.


Server A = 192.168.0.1
Server B = 172.20.0.1


1 Transfer using WHM
Login to Server B WHM using following url


http://172.20.0.1:2086


where 2086 is the port on which WHM is running.


In the middle page select Transfer and then on Transfer page select Copy multiple accounts/packages from another server.


It will open new page to put info of the Server through which you are going to transfer i.e Server A.


Remote server type is (WHM version will be auto detected on multi account copies): leave as it is
Remote server address (ip address or FQDN): put server hostname or IP
Remote SSH port: 22 is the default, if you have changed ssh port on old server use that one here.
Do not compress transfers (cPanel 10.8.3+ required on both ends): leave at it is
Turn off SSL (cPanel 11.23.6+ required on both ends): leave at it is
Allow override*: leave at it is
Login as : Choose USER if you have sudo or direct root login are not allowed. Else select ROOT (recommended)
Select authentication method: Choose Password here, if you are using Public Key then you have to upload Key using Security -> Manage SSH Keys to use here.
Root Password: put root password here


After putting all information above click on Fetch Account List. In few second you will see list of accounts from Server A to transfer. Select the account using check boxes to copy, if need to copy all select Select All to check all accounts. When done with select click on Copy. (Beware once you click on Copy dont close browser or click on Back button).


You will see account transfer log on your browser and when finished it will show nice summary about transfer.


2 Transfer using Shell (Command Line)
SSH your Server A using putty from windows and command line from linux.


ssh 192.168.0.1


Now first of all we will create full backup to transfer and all the backups created are placed under /home directory.


2.1 Create One Account Backup
If you wish to backup single account, then execute following command


/scripts/pkgacct cpaneluser


you will find corresponding backup in /home directory named cpmove-cpaneluser*.tar.gz


2.2 Create all Accounts Backup
To create all accounts backup on your server, execute following command


cat /var/cpanel/users | while read a; do
/scripts/pkgacct $a
done


again you will find all accounts backup under /home named cpmove-cpaneluser*.tar.gz


2.3 SCP Backups to New Server
After creating backup you have to transfer all accounts backup to your new server i.e Server B using SCP.


scp cpmove-* root@172.120.0.1:/home


Besure all backups should move to /home directory of new server.


If you have done all accounts backup then you should have to move /var/cpanel/users file for restore on new server i.e Server B in /home directory with name user.txt


scp /var/cpanel/users root@172.120.0.1:/home/user.txt


2.4 Restore Backup
To restore single account backup execute following command.


/scripts/restorepkg cpaneluser


where cpaneluser is of old server and can be found on backup filename after cpmove. i.e


cpmove-cpaneluser*.tar.gz


To restore all accounts


cat /home/user.txt | while read a; do
/scripts/restorepkg $a
done


Now you can List Account in WHM to see all accounts are transferred successfully to your new server and you can login to cpanel accounts of user using same Cpanel user / pass as old server.



How To Transfer CPanel Accounts

Horde broken or not working correctly on cPanel

Simple, short & sweet post, this should easily fix any problems you’re having


/usr/local/cpanel/bin/update-horde --force


Also, this might be useful to run hourly, I leave this on our servers “just in case”.


(mysqlcheck --auto-repair eximstats ; mysqlcheck --auto-repair horde) >/dev/null 2>/dev/null



Horde broken or not working correctly on cPanel

How to backup Xen with Logical Volume Mounts ; Works with HyperVM, SolusVM, FluidVM and More

Through our research and implementation of many Xen environments, it has become necessary to develop a reliable and secure method for backing up our Xen instances that are mounted on Logical Volumes (LVM).


The underlying problem is that the logical volume is usually a live file system that cannot be directly mounted / backed up or imaged safely.


We have written a script that processes all running Xen logical volumes, creates a snapshot of the volume and through that snapshot , uses dd to image the snapshot to another server over ssh.


You would be surprised at how well these dd images compress. Piping dd to bzip2 then to ssh to receive the image produces a very substantial compression ratio.


The initial trouble was writing the logic in the script to properly go through each Xen LV , create the snapshot, image and then remove the snapshot. Obviously extensive testing had to be completed to ensure reliability and proper error reporting.


This script should work with any 3rd party Xen control panel implementation (HyperVM, FluidVM, SolusVM to name a few). They all use the same underlying technology / framework. Since our script is a simple bash / shell script, it will run on any linux based system with little modification.


If you are using a LV for another purpose on the same box, it is probably a good idea to modify the script to ignore that so it doesn’t inadvertently get backed up.


Before implementing the script, it is probably a good idea to go through the motions manually just to see how it performs :

lvcreate -s -L 5G -n vm101_img_snapshot /dev/vps/vm101_img
dd if=/dev/vps/vm101_img_snapshot | bzip2 | ssh xenbackup@x.x.x.x "dd of=vm101_img.bz2"

One thing that you cant get around is space — you need to leave as much room as the largest Xen image on your logical volume — otherwise the script will fail at the snapshot creation process.


Find the script below. Hopefully it will help make your life easier (as well as being able to sleep at night) :

#!/bin/bash
# XEN Backup script
# Written by Star Dot Hosting

todaysdate=`date "+%Y-%m-%d"`

echo "XEN Backup Log: " $currentmonth > /var/log/backup.log
echo -e "------------------------------------" >> /var/log/backup.log
echo -e "" >> /var/log/backup.log

for obj0 in $(lvs --noheadings --separator ',' -o lv_name,lv_size | grep -v "swap" | awk -F "," 'printf "%sn", $1');
do

#grab the snapshot size
snapsize=`lvs --noheadings --separator ',' -o lv_name,lv_size | grep -v "swap" | grep $obj0 | awk -F "," 'printf "%s", $2'`

#create the snapshot
lvcreate -s -L $snapsize -n $obj0_snapshot /dev/xenlvm/$obj0 >> /var/log/backup.log 2>&1

#dd piped to bzip2 to compress the stream before piping it over the network via ssh to the destination box
dd if=/dev/xenlvm/$obj0_snapshot | bzip2 | ssh xenbackup@0.0.0.0 "dd of=/home/xenbackup/xen-backups/$obj0.$todaysdate.bz" >> /var/log/backup.log 2>&1

if [ "$?" -eq 1 ]
then
echo -e "***SCRIPT FAILED, THERE WERE ERRORS***" >> /var/log/backup.log 2>&1
cat /var/log/backup.log | mail -s "XEN Backup Job failed" admin@yourdomain.com
lvremove -f /dev/xenlvm/$obj0_snapshot
exit 1
else
echo -e "Backup of $obj0 Completed Successfully!" >> /var/log/backup.log 2>&1
fi

# remove the snapshot
lvremove -f /dev/xenlvm/$obj0_snapshot

done

cat /var/log/backup.log | mail -s "XEN Backup Job Completed" admin@yourdomain.com



How to backup Xen with Logical Volume Mounts ; Works with HyperVM, SolusVM, FluidVM and More

How to install Flash Player 10 Under Ubuntu Linux 32 bit Edition

Adobe flash player version 10 (code-named “Astro”) has been released and available for download. It has many new features such as:
+ Visual performance improvements
+ 3D effects
+ Custom Filters and Effects
+ Advanced Text Layout
+ Enhanced Drawing API
+ Performance improvements and much more.


You must uninstall any currently installed Flash Player before installing the beta under Linux or Mac / Windows computer. Open Firefox and type following at url box:


about:plugins


( Flash Player 9 installed)



Install Ubuntu flash 10 Player


Visit this url and grab .deb file. Uninstall old flashplayer 9 ( if installed ):
$ sudo apt-get remove flashplugin-nonfreeNow, install Flash 10 (make sure Firefox is not running):
$ sudo dpkg -i install_flash_player_10_linux.deb


Start firefox and type about:plugins. You should see list of plugins including Flash 10.


T2 :  Install Flash Player 10 Final in your home directory


If you need to install flash plugin in your home directory, type the following commands. To uninstall type the command:
$ cd ~/.mozilla
$ rm flashplayer.xpt libflashplayer.so


Visit adobe website to grab flash player 10 tar.gz (tar ball). Download and install flash player 10 (please exit any browsers you may have running):
$ cd /tmp
$ wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
$ tar -zxvf install_flash_player_10_linux.tar.gz
$ cd install_flash_player_10_linux
$ ./flashplayer-installer


Sample output:


Copyright(C) 2002-2006 Adobe Macromedia Software LLC. All rights reserved.

Adobe Flash Player 10 for Linux

Adobe Flash Player 10 will be installed on this machine.

You are running the Adobe Flash Player installer as a non-root user.
Adobe Flash Player 10 will be installed in your home directory.

Support is available at http://www.adobe.com/support/flashplayer/

To install Adobe Flash Player 10 now, press ENTER.

To cancel the installation at any time, press Control-C.

NOTE: Please exit any browsers you may have running.

Press ENTER to continue...

----------- Install Action Summary -----------

Adobe Flash Player 10 will be installed in the following directory:

Mozilla installation directory = /home/vivek/.mozilla

Proceed with the installation? (y/n/q): y

NOTE: Please ask your administrator to remove the xpti.dat from the
components directory of the Mozilla or Netscape browser.

Installation complete.

Perform another installation? (y/n): n

Please log out of this session and log in for the changes to take effect.

The Adobe Flash Player installation is complete.

Now open Firefox and type about:plugins:




You can now view any flash based site.




How to install Flash Player 10 Under Ubuntu Linux 32 bit Edition

htaccess redirect for SSL non-www to www

Use the following code in the htaccess file under the public_html folder for the concerned domain :

RewriteEngine On
RewriteCond %HTTP_HOST ^domain.com [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]



htaccess redirect for SSL non-www to www

qb4th9awdx

qb4th9awdx



qb4th9awdx

cPanel Updates on Redhat 9 Can Break Stuff

If you’ve been running servers for a few years, you probably have at least one server or VPS in your fleet that’s running Redhat 9.  Redhat  9 is old, but it’s stable (probably since there are never any updates for it), and the customers lingering on those servers are usually happy…


…until you run a cPanel update and find that something doesn’t work right. From what I’ve seen, cPanel updates on Redhat 9 servers tend to break either FTP or IMAP, causing Webmail not to work. You may see errors like this:


HORDE: Login failed because your username or password was entered incorrectly.


SquirrelMail: ERROR: Connection dropped by IMAP server.


RoundCube: Unexpected condition from IMAP server, closed or corrupt connection to IMAP. Possible mailbox corruption.


To resolve this, you need to reinstall the fam package. You can do this by running:

rpm Uvhhttp://archive.download.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/fam-2.6.8-9.i386.rpm

For FTP, try reinstalling the RPM, or downgrading to the previous version:

???rpm -Uvh http://httpupdate.cpanel.net/ftpinstall/pure-ftpd/redhat/9/pure-ftpd-1.0.27-1.tls.i386.rpm

If that doesn’t work, you can go to http://httpupdate.cpanel.net/ftpinstall/pure-ftpd/redhat/9/ and keep installing the previous version down until you find the one that works on your server.



cPanel Updates on Redhat 9 Can Break Stuff

Lighty Tips & Tricks: Hide lighttpd software version

Description: This will show how to hide the lighttpd version to remote requests.


Useful: there is really no need to disclose this information to everyone. As shown in “Discover the web server software and version of a remote server” anyone can find valuable information from our web server banner. Hiding it  will not protect in any way from real vulnerabilities if they exist, but it will at least make their life harder. This will also not stop more complex fingerprinting programs to detect some information on the web server, but at least we should not make their life easier  .


Compared with Apache (apache by default will show a lot of information even about the linux distribution and installed apache modules), lighttpd will only show its server version in the header. This is good enough, but still we probably want to hide that information anyway. For this, we will use the global lighttpd variableserver.tag that defines the string returned by the server. The default (if not defined) is:

server.tag = "lighttpd "

and this will look in a regular header output like:
...
Server: lighttpd/1.4.19
...


To overwrite this, we just have to define our own output for the server.tagvariable in lighttpd.conf. Usually I like to define it like this:
server.tag = "lighttpd"
leaving the lighty name, but taking out the version; you can of course enter anything you like (even to forge an apache or iis server output, etc.)
server.tag = "Apache/1.3.29 (Unix) mod_perl/1.29 PHP/4.4.1 mod_ssl/2.8.16 OpenSSL/0.9.7g"


Conclusion: if you want to provide minimum information about your system then customize your lighty server.tag:
server.tag = "lighttpd"



Lighty Tips & Tricks: Hide lighttpd software version

Error while restoring cPanel backup

Error :


Sorry, a group for that username already exists.


Fix :


User account related information is stored in /etc/passwd/etc/shadow and /etc/group files . Check all of them and remove the entries.


You can remove the group by using:


groupdel groupname


And then restore the account.


You can also restore the account forcefully by using :


/scripts/restorepkg –force username




Error while restoring cPanel backup

110 Can’t open SMTP stream

I found the config for cpanel’s SM:


/usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php


I just changed:
$useSendmail = false;


to:
$useSendmail = true;


(around line 33)


This will probably get written over with the next cpanel update, but it at least helps get my users sending mail again for



110 Can’t open SMTP stream

/bin/sh: /usr/local/bandmin/bandmin: is a directory

The cronjob results in the following error :
/bin/sh: /usr/local/bandmin/bandmin: is a directory


Solution :


This happens when the bandmin directory simply contains another bandmin directory instead of an executable script of the same name.


Run the following script and see if the issue persists :


# /scripts/bandminup –force



/bin/sh: /usr/local/bandmin/bandmin: is a directory

cPanel default page after IP migration

This can be due to an IP mismatch. Make sure that the DNS records and the Apache VirtualHost for the domains are configured on the same IP.
Check the IP in “WHM >> Show IP Address Usage” and see if it matches with the IP you get on pinging the site from your local system.


If there is no mismatch then it should just be a case of propagation delay.



cPanel default page after IP migration

Sometimes you will get following error while accessing/updating DirectAdmin from your DA panel

In this case you can update the license file from command line by running following shell script provided by DA itself.


# cd /usr/local/directadmin/scripts/

# getLicense.sh


You will get client id and license ID in setup.txt file which available under same directory.



Sometimes you will get following error while accessing/updating DirectAdmin from your DA panel

Install PDFLib - PHP 5+

Installing PDFLib


The  steps to Install PDFlib


I used PDFLib Lite, for free, non-commercial use http://www.pdflib.com/download/pdflib-family/pdflib-lite/


You need to be root/sudo while doing this and PEAR/PECL needs to be installed.


wget http://www.pdflib.com/binaries/PDFlib/704/PDFlib-Lite-7.0.4p4.tar.gz


tar xzvf PDFlib-Lite-7.0.4.tar.gz


cd PDFlib-Lite-7.0.4


./configure –prefix=/usr


make


make install


pecl install pdflib (will ask for installation directory, type: /usr/)


You should recieve a string similar to this:



“Build process completed successfully Installing ‘/var/tmp/pear-build-root/install-pdflib-2.1.2//usr/local/lib/php/ext


What I did next, was copy the pdf.so file into my php extensions directory: cp /usr/local/lib/php/extensions/no-debug-/pdf.so /usr/include/php/ext I then modified my php.ini file, to load the pdflib, by adding the following line to the extensions section: extension=pdf.so I hope this helps some of those that got this error. There isn’t much help out there on this error, that I could find on google, that is why I decided to post it in my blog.



Install PDFLib - PHP 5+