Linux Common
From Linux Tools
whois from registrar end
http://reports.internic.net/cgi/whois
File system hierarchy
http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
What is a port?
Short answer: A communication channel for computers in networks.
Set time for history command in linux
If you are using a bash shell then using following command you can set the time in history HISTTIMEFORMAT="%D %T "
Kernel Compilation Full Note
http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html
Booting Process
http://www.yolinux.com/TUTORIALS/LinuxTutorialInitProcess.html
Litespeed
http://www.litespeedtech.com/docs/webserver/install/ http://www.litespeedtech.com/products/webserver/download/ http://www.litespeedtech.com/docs/webserver/admin/ http://www.litespeedtech.com/support/forum/ http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:license:all_about_licenses http://litespeedtech.com/support/forum/showthread.php?t=2160
How to configure named on a machine
http://nixcraft.com/getting-started-tutorials/525-ubuntu-linux-setup-configure-domain-name-server-bind.html
Setting Up an NFS Server
http://www.tldp.org/HOWTO/NFS-HOWTO/server.html#SERVERINTRO
FSCK
fsck -pcfv /dev/sdb1
Trace Email Address Source
This tool attempts to locate the source IP address of an email based on the email headers (Where did the email come from) http://whatismyipaddress.com/staticpages/index.php/trace-email-source-IP-address
cPanel theme paths:
/usr/local/cpanel/base/frontend
WHM theme paths:
/usr/local/cpanel/whostmgr/docroot/themes
Disabling mod_security using .htaccess
This should only be used as a last resort, but if you cannot run your site and your host won't adjust their mod_security configuration accordingly you can normally disable mod_security for your site by adding the following to your site's .htaccess file
SecFilterEngine Off
Difference between pop and imap
http://email.cityu.edu.hk/faq/popimap.htm http://saturn.med.nyu.edu/it/help/email/imap/index.html http://www.helpdesk.ilstu.edu/kb/index.phtml?kbid=1172
To find the installed perl modules
http://www.cyberciti.biz/faq/how-do-i-find-out-what-perl-modules-already-installed-on-my-system/
To display the list enter the following command:
$ instmodsh
Output:
Available commands are: l - List all installed modules m - Select a module q - Quit the program cmd?
At cmd? prompt type l to list all installed modules:
cmd? l
Re initialize CPAN
Apparently you start cpan with:
perl -MCPAN -e shell
When you get to the prompt, you enter:
o conf init
and accept all the default values (and pick a few mirrors) rather than playing with stuff you don't understand.
Directory contents listing
This can be done with creating a file called .htaccess with the following contents inside it ========================= Options +Indexes =========================
"403: Directory index forbidden by rule" CAUSE "Directory index forbidden" error occurs if there is no index file in the directory and directory indexing is disabled in Apache configuration. See http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryindex and http://httpd.apache.org/docs/2.0/mod/core.html#options for more information. RESOLUTION
To avoid this error the index file should be put into the directory. Index file's extensions are defined in httpd.conf by means of DirectoryIndex directive, for example:
DirectoryIndex at_domains_index.html index.html index.html.var index.shtml index.php index.htm
see http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryindex for the detailed description.
Or enable directory indexing with "Options +Indexes" directive for the domain by means of vhost.conf or for the whole server in httpd.conf, see http://httpd.apache.org/docs/2.0/mod/core.html#options for the directive syntax.
Restart Apache if you changed any configuration file.
setuid:
Normally, if a person executes an executable (assuming he has the privileges to do so), it will execute under that person's privileges, so the program will only be able to read and write to stuff that the running user can do. When an executable has the setuid bit set, the executable will execute under that priviledges of the owner of the executable, regardless of the user executing it. For example, the "/usr/bin/passwd" executable is owned by root, is executable by everyone, and has the setuid bit set, such that anybody can call it to change their own password, but it runs with the privileges needed to modify the /etc/passwd and /etc/shadow files, which only root has.
When a binary executable file has been given the setuid attribute, normal users on the system can execute this file and gain the privileges of the user who owns the file (commonly root) within the created process.
setgid:
Normally, if a person creates a file, it is owned by that user's user and group. If a person creates a file in a directory that has the setgid bit set, the group of new file will be instead set to be the same as the group of the directory by default. For example, you have a directory that you plan to use to store web pages. You might want to set the setgid bit on it and change its group to "www". That way, whenever someone puts a new page in the directory, it will inherit the "www" group, regardless of the group of their creator. Suppose then the files are given "664" permission; then all the web administrators in the "www" group will be able to modify the files.
sticky:
Normally, if someone has write permission to a directory, they can delete and move files inside the directory. With the sticky bit set on the directory, only the creator of the file or directory inside can delete or move it. For example, the /tmp directory is readable & writable & executable by everyone, so that everyone can access and create temp files inside it. But it has the sticky bit set, so that I can't mess with someone else's temp files.
The most common use of the sticky bit today is on directories, where, when set, items inside the directory can be renamed or deleted only by the item's owner, the directory's owner, or the superuser (Without the sticky bit set, a user with write and execute permissions for the directory can rename or delete any file inside, regardless of the file's owner.) Frequently this is set on the /tmp directory to prevent ordinary users from deleting or moving other users' files.
To set the sticky bit in a directory, do the following: chmod +t data
Group Sharing a Directory (sgid , getfacl and setfacl )
http://www.udel.edu/topics/os/unix/general/groupsharing.html https://help.webfaction.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=130
redirect to another url - no change in address bar
<html>
<head>
<title>Your Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript">
document.write("<frameset rows=* frameborder=NO border=0 framespacing=0 cols=*>");
document.write("<frame name=main src=http://mycutelife.net/"+document.location.search+">");
document.write("</frameset>");
document.write("<noframes>");
document.write("<body bgcolor=#FFFFF0 text=#000000>");
document.write("</body></noframes>");
</script>
</html>
Bypass Authentication Or Access Requirements
http://wiki.apache.org/httpd/BypassAuthenticationOrAuthorizationRequirements
<Directory /home/www/site1/private> AuthUserFile /home/www/site1-passwd AuthType Basic AuthName MySite Require valid-user Order allow,deny Allow from 172.17.10 Satisfy any </Directory>
This will force everyone from the outside to authenticate, but those coming from the LAN IP range would not be required to do so. Apache will let them access the directory without authenticating. You can add other hostnames (local or remote) to the Allow directive to give them access to the directory as well.
redirect all http to https
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L]
Enable access for “webalizer Stats” without login to cpanel.(domain: eukhost.com username: admsup .
Ans: You need to run following commads via SSH as root user.
# cd /home/username/www # ln -s ../tmp/webalizer stats # chown username.username stats # cd ../tmp # chmod 755 ./ # chmod 755 ./webalizer
It will allow http://domain.com/stats/ for viewing stats without logging in to cpanel
Test for open relay
http://www.antispam-ufrj.pads.ufrj.br/ http://www.checkor.com/
Domain Redirection Rule
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ http://www.google.com [R=302,L]
To get the error in screen when a server went down
Add the following to /etc/rc.local setterm -blank 0 Then run the command "setterm -blank 0"
Getting error "The virus database is older than 7 days!" while running clamscan
run freshclam in root
phpBB - Installation, Upgradation
http://mycutelife.net/INSTALL.html
Packages that are needed to install yum
gmp-4.1.4-10.el5.i386.rpm \ readline-5.1-1.1.i386.rpm \ python-2.4.3-19.el5.i386.rpm \ libxml2-2.6.26-2.1.2.i386.rpm \ libxml2-python-2.6.26-2.1.2.i386.rpm \ expat-1.95.8-8.2.1.i386.rpm \ python-elementtree-1.2.6-5.i386.rpm \ sqlite-3.3.6-2.i386.rpm \ python-sqlite-1.1.7-1.2.1.i386.rpm \ elfutils-0.125-3.el5.i386.rpm \ rpm-python-4.4.2-37.el5.i386.rpm \ m2crypto-0.16-6.el5.1.i386.rpm \ python-urlgrabber-3.1.0-2.noarch.rpm \ yum-3.0.5-1.el5.centos.2.noarch.rpm
Installing from RPMS and Yum.
In Linux and other its related flavours, we use rpm (redhat package manager) rpm –ivh To remove it rpm –evh To find whether the rpm is installed or not rpm –qa | grep To install the new package and remove the old version rpm –Uvh To find the last change log entry of a installed kernel rpm –q –changelog kernel | head To check the signature of installed rpm use following command rpm –k Install the new package if earlier version exits and older version will be removed. rpm –F
Now YUM repository made your life easy to install and update packages. Configure centralized yum server and start the show.
To install the packages from a yum repository yum –y intall <package-name> // y switch helps you in resolving dependencies automatically. To check whether the required package is installed on your machine yum –l list | grep
To update all your packages from yum repository yum –y update To check the latest updates use the following command yum check-update
Install ffmpeg
http://www.siteground.com/tutorials/joomla15/joomla_installation.htm
Also you can add a file dag.repo in /etc/yum.repos.d and add the following line
[dag] name=Dag RPM Repository for Centos baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag enabled=1
- yum install ffmpeg*
If the ffmpeg is not installed properly, Please follow the steps givenbelow.
Download the ffmpeg package. Extract it and run ./configure, make and make install. Please note that mount /tmp to exec temporarily with the following command and change back to nonexec once the installation has been completed.
mount -o remount,exec /tmp mount -o remount,noexec /tmp
Another one
1) Install Ruby from the following script
cd /usr/src http://mycutelife.net/download/ruby.sh ./ruby.sh
2) Install FFMPEG with the following script
http://scriptmantra.info/ffmpeg.html
Additional Notes
http://forums.theplanet.com/index.php?showtopic=64541
Replace file contents
The following will replace all \ with empty fields. :%s/\\//g
How to upgrade postnuke
http://www.dotservant.com/knowledgebase/postnuke/upgradepostnuke.shtml
How to enable session variable in php
set session.auto_start to 1 in php.ini
dns report details - Explanation
http://www.digitalpoint.com/lists/77350.html http://www.directadmin.com/forum/archive/index.php/t-2759.html
cpanel
php.ini per dir with php running as cgi
http://forums.cpanel.net/f7/php-ini-per-dir-php-running-cgi-73985.html
