January 19th, 2010 by
EZ linux ·
No Comments
Keep in mind most new Routers and Switches have auto sensing and do not need a crossover cable. In fact cross over cables will soon be outdated.
[Q] What’s the difference between CAT 5e patch cable and CAT 5e crossover cable?
[A] The difference has to do with the wiring of the cable and the situation in which you will use the cable.
On a CAT 5e patch cable, the wiring configuration is identical on both ends of the cable.
On a CAT 5e crossover cable, the wiring of pins 1, 2, 3, and 6 are “crossed-over” to pins 3, 6, 1, and 2.
CAT 5e crossover cables are used in situations where two devices have the same interface, for example, connecting a hub to a hub, or a switch to a switch, or even when patching a hub or switch into a wallplate.
The most common use is to connect two PCs directly to each other, without the use of any kind of router, hub, or switch. This is called a peer-to-peer network, and is a low-cost solution to allow file and Internet sharing between two computers.
Cat5 cat6 and crossover example

Tags:
Hardware
January 18th, 2010 by
EZ linux ·
No Comments
Simple when logged in with the user type:
passwd
Then enter the new password twice to save it.
To change the root password on a Linux server you have to be logged in as root.
Tags:
Cheat Sheets · Linux Security
January 13th, 2010 by
EZ linux ·
No Comments
Simply run /scripts/upcp –force
It’s a common bug that happens when a cPanel WHM update has an error.
Tags:
Cpanel and WHM
January 13th, 2010 by
EZ linux ·
1 Comment
1. Restart the httpd service. This might free a little space some times.
2. Check for apache logs like error_log, access_log , suexec_log in /usr/local/apache/logs . These can either be cleared off or if you need the logs then you can take a zipped copy and keep it aside.
3. Same can be done for the files in cPanel logs (/usr/local/cpanel/logs) as well .
4. Domlogs – Get into the /usr/local/apache/domlogs/ directory. Run the following command :-
# ls -al -SR | head -10 —> It will list 10 files in the decreasing order according to their size
If the domlog file is too large for a domain then it is possible that awstats is not running . Check whether cpanellogd is running on the server using pstree . If not, restart it .
Else, it is possible that awstats for only that particular domain is not updating. Get into the directory /usr/local/cpanel/base and check if any file as ‘awstats.domainname.com.conf’ exists. If yes , delete that file.
Now, run /scripts/runweblogs for that user. It will update the awstats and automatically clear the domlogs file thereafter. Do not delete the domlogs file itself.
5. Remove old and unwanted backups of ‘apache’ that might have been taken long ago. Also, check for any other duplicate folders that can be removed safely.
6. Remove core files, if any . Normally, some core files (like core.1234) might be present in /usr/local/cpanel/whostmgr/docroot . Check for these and remove them.
7. Restart your server, the quota might be off for that partition and reboot will correct it. Keep in mind if there is a harddrive error this can leave the server offline while the system or admin tuns a FSDK.
Tags:
Cheat Sheets · Linux Tricks
December 29th, 2009 by
EZ linux ·
No Comments
The best way is:
shutdown -r now
This will tell the server to take it’s time so to speak and reboot when it’s ready.
For a hard reboot simply put:
reboot
In most cases a hard reboot is fine unless you have file errors and the servers needs to clean them up before a reboot.
Tags:
Linux Commands
December 29th, 2009 by
EZ linux ·
No Comments
Both of these restart cpanel and Web Host Manager WHM services the exact same way
service cpanel restart
/etc/init.d/cpanel restart
Tags:
Cpanel and WHM
December 22nd, 2009 by
EZ linux ·
1 Comment
Do you prefer to manually install everything? Here is a article for you on installing FFMPEG on a Linux server.
For the automated people check this article out for FFMPEG Installation
FFmpeg is a complete solution to record, convert and stream audio and video. It includes libavcodec, the leading audio/video codec library.
NOTE:
- This guide is designed for a Linux Linux is the kernel of an operating system. Linux was built on the Unix tradition. Linux was originally developed by Linus Torwalds of Finland, who currenctly owns the Linux trademark. Linux stands for Linus’ Unix. i386 powered server .
- If you experience any problems installing FFmpeg on your server and need help, we suggest you sign up for the xPress Plan. Our engineers are ready to fix any installation problems you might have with your server.
To install FFmpeg from source, SSH to the server and run the commands below (in that order). Before you start working on this project, make sure the following binary packages are installed on your server:
gcc, gcc4, gcc4-c++, gcc4-gfortran, gd, gd-devel, gmake, ImageMagick, ImageMagick-devel, libcpp, libgcc, libstdc++, make, ncurses, ncurses-devel, ruby, subversion
If any of these packages are missing, install them using Yum . For example:
- /usr/bin/yum install PACKAGE
- Caution
The following binary packages are always updated with newer versions. You might experience technical issues if you download a newer version for one or two of these applications.
Follow these steps (in that order):
- Let’s create a directory to do our work in:
- mkdir /usr/local/src
- cd /usr/local/src
- Download source binary packages
- /usr/bin/wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
- /usr/bin/wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
- /usr/bin/wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.2.tar.bz2
- /usr/bin/wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-ppc-20071007.tar.bz2
- /usr/bin/wget http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.bz2
- /usr/bin/wget http://downloads.sourceforge.net/project/faac/faad2-src/faad2-2.7/faad2-2.7.tar.gz
- /usr/bin/wget http://biznetnetworks.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
- /usr/bin/wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
- /usr/bin/wget http://www.sfr-fresh.com/unix/misc/lame-398-2.tar.gz
- /usr/bin/wget http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz
- /usr/bin/wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
- /usr/bin/wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.2.tar.gz
- /usr/bin/wget http://downloads.sourceforge.net/project/re2c/re2c/0.13.5/re2c-0.13.5.tar.gz
- /usr/bin/wget http://download.m0k.org/handbrake/contrib/xvidcore-1.1.3.tar.gz
- /usr/bin/wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2
- /usr/bin/wget http://downloads.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20080324-2245.tar.bz2
- Extract source binary packages
- /bin/tar xzf a52dec-0.7.4.tar.gz
- /bin/tar jxvf amrnb-7.0.0.2.tar.bz2
- /bin/tar jxvf amrwb-7.0.0.2.tar.bz2
- /bin/tar jxvf essential-ppc-20071007.tar.bz2
- /bin/tar jxvf faac-1.28.tar.bz2
- /bin/tar xzf faad2-2.7.tar.gz
- /bin/tar jxvf ffmpeg-php-0.6.0.tbz2
- /bin/tar zxvf flvtool2_1.0.5_rc6.tgz
- /bin/tar xzf lame-398-2.tar.gz
- /bin/tar xzf libogg-1.1.4.tar.gz
- /bin/tar jxvf libtheora-1.1.1.tar.bz2
- /bin/tar xzf libvorbis-1.2.2.tar.gz
- /bin/tar xzf re2c-0.13.5.tar.gz
- /bin/tar jxvf MPlayer-1.0rc2.tar.bz2
- /bin/tar xzf xvidcore-1.1.3.tar.gz
- /bin/tar jxvf x264-snapshot-20080324-2245.tar.bz2
- Create the codecs directory & import them
- mkdir /usr/local/lib/codecs
- mv /usr/local/src/essential-ppc-20071007/* /usr/local/lib/codecs
- chmod -R 755 /usr/local/lib/codecs
- Install SVN/Ruby (this is for RedHat/CentOS v5.x)
- /usr/bin/yum install subversion
- /usr/bin/yum install ruby
OR (if you are using the cPanel control panel )
- /scripts/installruby
- /usr/local/cpanel/bin/ror_setup
- /usr/bin/yum install ncurses-devel
- Compile and install FLVtool2
- cd /usr/local/src/flvtool2_1.0.5_rc6/
- /usr/bin/ruby setup.rb config
- /usr/bin/ruby setup.rb setup
- /usr/bin/ruby setup.rb install
- Compile and install LAME
- cd /usr/local/src/lame-398-2
- ./configure
- make
- make install
- Compile and install libOGG
- cd /usr/local/src/libogg-1.1.4
- ./configure
- make
- make install
- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
- export PKG_CONFIG_PATH
- Compile and install LibVorbis
- cd /usr/local/src/libvorbis-1.2.2
- ./configure
- make
- make install
- Compile and install Libtheora
- cd /usr/local/src/libtheora-1.1.1
- ./configure –with-ogg-libraries=/usr/local/lib/
- make
- make install
- Compile and install AMRNB
- cd /usr/local/src/amrnb-7.0.0.2
- ./configure
- make
- make install
- Compile and install AMRWB
- cd /usr/local/src/amrwb-7.0.0.2
- ./configure
- make
- make install
- Compile and install Liba52
- cd /usr/local/src/a52dec-0.7.4
- ./bootstrap
- ARCh=’arch’
- ./configure –enable-shared
- make
- make install
- Compile and install FAAC
- cd /usr/local/src/faac-1.28
- ./bootstrap
- ./configure –with-mp4v2
- make
- make install
- Compile and install FAAD
- cd /usr/local/src/faad2-2.7
- ./configure –with-mpeg4ip
- make
- make install
- Compile and install XVIDCore
- cd /usr/local/src/xvidcore/build/generic/
- ./configure
- make
- make install
- Download the latest X264 Snapshot from the subversion
- cd /usr/local/src/x264-snapshot-20080324-2245
- ./configure –enable-shared
- make
- make install
- Compile and install RE2C
- cd /usr/local/src/re2c-0.13.5
- ./configure
- make
- make install
- cp -aP /usr/local/bin/re2c /usr/bin/
- Download the latest FFmpeg/MPlayer from the subversion
- /usr/bin/svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg -r15336
- /usr/bin/svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
- cd /usr/local/src
- /usr/bin/svn update
- Compile and install MPlayer
- cd /usr/local/src/mplayer
- ./configure
- make
- make install
- Compile and install FFmpeg
- cd /usr/local/src/ffmpeg/
This command is one single line:
- ./configure –enable-shared –enable-nonfree –enable-gpl –enable-pthreads –enable-liba52 –enable-libamr-nb –enable-libamr-wb –enable-libfaac –enable-libfaad –enable-libmp3lame –enable-libtheora –enable-libvorbis –enable-libx264 –enable-libxvid –enable-cross-compile
- make
- make install
- export LD_LIBRARY_PATH=/usr/local/lib/
- Finalize the codec setups:
(Make sure these libraries exist on your server in their respective directories. FYI: the number which comes after the extension *.so might differe from one server to another.)
- ln -s /usr/local/lib/libavformat.so.52.18.0 /usr/lib/libavformat.so.50
- ln -s /usr/local/lib/libavcodec.so.51.62.0 /usr/lib/libavcodec.so.51
- ln -s /usr/local/lib/libavutil.so.49.7.0 /usr/lib/libavutil.so.49
- ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
- /sbin/ldconfig
- Compile and install FFmpeg-Php
- cd /usr/local/src/ffmpeg-php-0.6.0/
- /usr/bin/phpize
- ./configure
- make
- make install
Check and see if ffmpeg-php module is saved in
- ls -al /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so
- Install FFmpeg-Php (make sure the local path to your php.ini is correct.)
- /bin/echo ‘extension=ffmpeg.so’ >> /usr/local/lib/php.ini
- Restart Apache to load FFmpeg-Php (This is for RedHat/CentOS v5.x)
- /sbin/service httpd restart
Let’s see if FFmpeg is working. Run the following command:
- php -r ‘phpinfo();’ | grep ffmpeg
If you get a few lines similar to the following:
ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => Dec 5 2009 15:31:45
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc51.62.0
ffmpeg libavformat version => Lavf52.18.0
ffmpeg swscaler => disabled
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
That means FFmpeg, FFmpeg-Php, MPlayer, MEncoder, FLV2tool, LAME MP3 encoder & libOGG are working.
Tags:
Linux Software / Scripts
November 27th, 2009 by
EZ linux ·
1 Comment
To get the files out of a tarball, you can use the following commands:
tar xvf something.tar
If the tarball has also been gzipped (compressed), you can use the following command:
tar xvfz something.tar.gz
If you only want certain directories from the tarball, do this:
tar xvzf something.tar.gz */dir.you.want/*
If you have a .tar.bz2 file, then you need bzip2 installed (/usr/ports/archivers/bzip2), and you issue this command:
tar yxf something.tar.bz2
tar
To tar up *.db in the current directory into a tarball called blah.tar.gz, issue this command:
tar cfz blah.tar.gz *.db
The z option compresses.
listing the contents
To see a list of the files within a tarball, issue the following command:
tar -tzf blah.tar.gz
The -t provides a list. the -z indicates that the tarball is compressed. The -f identifies the tarball.
Here’s an example:
# tar -tzf files.dwhs.tgz
etc/
etc/protocols
etc/aliases
etc/services
etc/hosts
Tags:
Linux Commands
November 26th, 2009 by
EZ linux ·
No Comments
ssh-keygen: password-less SSH login
SSH is often used to login from one system to another without requiring passwords.
This requires you generate your own personal set of private/public ssh keys.
ssh-keygen is used to generate that key pair for you. Here is a session where your own personal private/public key pair is created:
root:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
f6:61:a8:27:35:cf:4c:6d:13:22:70:cf:4c:c8:a0:23 dwhs1.dwhs.net
The command ssh-keygen -t rsa initiated the creation of the key pair.
No passphrase was entered (Enter key was pressed instead).
The private key was saved in .ssh/id_rsa. This file is read-only and only for you. No one else must see the content of that file, as it is used to decrypt all correspondence encrypted with the public key.
The public key is save in .ssh/id_rsa.pub.
In this case, the content of file id_rsa.pub is
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEArkwv9X8eTVK4F7pMlSt45p
WoiakFkZMwG9BjydOJPGH0RFNAy1QqIWBGWv7vS5K2tr+EEO+F8WL2Y/
jK4ZkUoQgoi+n7DWQVOHsRijcS3LvtO+50Np4yjXYWJKh29JL6GHcp8o7+
YKEyVUMB2CSDOP99eF9g5Q0d+1U2WVdBWQM= dwhs1.dwhs.net
It is one line in length.
Its content is then copied in file .ssh/authorized_keys of the system you wish to SSH to without being prompted for a password.
The example shown here generated keys on sodium by user root. If the public key generated, file /root/.ssh/id_rsa.pub, was copied to your account, file /root/.ssh/authorized_keys on dwhs1.dwhs.net, then user root is allowed to SSH into your own account on dwhs1.dwhs.net without the use of a password.
To summarize, a personal private/public key pair is generated using the ssh-keygen command. The public key is then copied onto a remote systems’ .ssh/authorized_keys file. And you can now SSH to the remote system’s account without the use of a password.
Tags:
Linux Tricks
November 24th, 2009 by
EZ linux ·
No Comments
1. Login to your server and su to root, unless you logged in as root already.
2. cd /root (unless your default login folder is already root)
3. pico .bashrc (or use your favorite editor)
4. Scroll to the end of the file then add the following:
echo ‘ALERT – Root Shell Access (YourserverName) on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” you@yourdomain.com
Replace YourServerName with the handle for your actual server for example dwhs4@dwhs.net
Replace you@yourdomain.com with your actual email address for example support@dwhs.net
5. Crtl + X then Y
Now logout of SSH, close the connection and log back in! You should receive an email address of the root login alert a few minutes afterwards.
Tags:
Linux Security · Linux Tricks