Oct 25 2005

How to setup a backup email server

Tag:markmaldony @ 19:17

Setting up a backup email server to queue email.

Ok here is the situation, I have penguincares.no-ip.org that has a
sendmail server that accepts all my incoming email and works fine.

I am trying to setup a backup email server so I can collect mail on another
server while my server is down. This other server should be able to queue the
mail for me and try to send it periodically to see if my server has come back online.

Continua”How to setup a backup email server”


Oct 21 2005

Linux Basic System Administration Stuff

Tag:markmaldony @ 15:26

Starting X11
Presumably your machine is already running a desktop interface. The following command runs a script to start the X-windows system.

# startx starts X-Windows system (typically its already running), (startx runs a script to start the X system)

The initialization script for X is .xinitrc found in /etc/X11/xinit/. If edited by root, changes are system-wide.

Changing the system date or time
# date -s 05/15/00 changes the system date to May 15, 2000 (ie mm/dd/yy).

# date -s 20:30 changes the system time to 8:30 PM (ie 20:30 on a 24 hour clock).

Managing Applications: Using rpm, glint, and xrpm
rpm, glint, and xrpm are all different ways to install, update, or remove software. More obscure applications often come as tar files, but the most common applications can be found in this special format (.rpm files) which makes them easier to deal with. rpm stands for Redhat Package Manager.

Continua”Linux Basic System Administration Stuff”


Oct 21 2005

Basic Linux Commands

Tag:markmaldony @ 15:24

Intro
As the title suggests, this section contains the essential commands needed to have a basic proficiency working in a Linux environment. For all intents and purposes, you can’t do to much damage using these commands. In cases where you could screw things up for yourself, any potential hazards have been pointed out…I hope…

Initially, a few definitions and some background would be worthwhile. Linux is essentially a UNIX based operating system for PC’s. The project was designed by Linus Torvalds in Helsinki, Finland in 1991 and released over the internet. Since then several variations of the Linux operating system have been developed, including SuSE Linux, Slackware, Debian, and Redhat. Everything included in this summary is a bit slanted to the Redhat distribution, but most commands should work fine on any Linux distribution.

Continua”Basic Linux Commands”


Oct 20 2005

Bash Tips and Scripts from the Penguincares Team

Tag:markmaldony @ 14:46

Here are a bunch of Little Tips and Scripts I have found online or that I came up myself. I can’t remember them all the time so I will keep updating this page for future reference.

Continua”Bash Tips and Scripts from the Penguincares Team”


Oct 19 2005

Linux cheat sheet

Tag:tepezcuintle @ 15:50

Here’s a command reference card for some regularly used unix commands, tested on linux but should hopefully work on most unix command shells.

General help
[command] –help - gives syntax for using that command
man [command] - brings up the manual page for the command, if it exists
man [command] > file.txt - dumps the manual page(s) for the command into ‘file.txt’
whatis [command] - gives a short description of the command.
help - gives a list of commands (GNU Bash).
help [command] - gives extra information on the commands listed above.

Continua”Linux cheat sheet”


Oct 19 2005

In Unix, what is the find command, and how do I use it to search through directories for files?

Tag:tepezcuintle @ 15:46

To use the find command, at the Unix prompt, enter:
find . -name “pattern” -print Replace “pattern” with a filename or matching expression, such as “*.txt” . (Leave the double quotes in.)

Options
The general form of the command is:
find (starting directory) (matching criteria and actions)
The find command will begin looking in the starting directory you specify and proceed to search through all accessible subdirectories. You may specify more than one starting directory for searching.

There are several options for matching criteria:

Continua”In Unix, what is the find command, and how do I use it to search through directories for files?”


Oct 19 2005

A quick guide to writing scripts using the bash shell

Tag:tepezcuintle @ 3:03

A simple shell script
A shell script is little more than a list of commands that are run in sequence. Conventionally, a shellscript should start with a line such as the following:
#!/bin/bash
THis indicates that the script should be run in the bash shell regardless of which interactive shell the user has chosen. This is very important, since the syntax of different shells can vary greatly.

Continua”A quick guide to writing scripts using the bash shell”


Oct 18 2005

Preventing shell users from becoming root

Tag:markmaldony @ 20:05

Here is the problem.

You have an SSH server and you have given access to SSH to certain users you want those users be able to access their shell accounts but also you want to prevent them from running.

su -l root

or becoming root.

Here is the solution: The first thing is to give yourself permission to become root because once you enforce this rule even your account will be locked out if you do not allow your account to become root.

Continua”Preventing shell users from becoming root”


Oct 15 2005

htaccess Tips and tricks

Tag:markmaldony @ 15:09

[code lang="html"]

htaccess Cheatsheet

Enable Directory Browsing

Options +Indexes
## block a few types of files from showing
IndexIgnore *.wmv *.mp4 *.aviDisable Directory Browsing

Options All -IndexesCustomize Error Messages

ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /servererror.htmlGet SSI working with HTML/SHTML

AddType text/html .html
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
# AddHandler server-parsed .htmChange Default Page (order is followed!)

DirectoryIndex myhome.htm index.htm index.phpBlock Users from accessing the site

order deny,allow
deny from 202.54.122.33
deny from 8.70.44.53
deny from .spammers.com
allow from all
Allow only LAN users

order deny,allow
deny from all
allow from 192.168.0.0/24Redirect Visitors to New Page/Directory

Redirect oldpage.html http://www.domainname.com/newpage.html
Redirect /olddir http://www.domainname.com/newdir/Block site from specific referrers

RewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block\.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2\.com [NC]
RewriteRule .* - [F]Block Hot Linking/Bandwidth hogging

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]Want to show a “Stealing is Bad‿ message too?

Add this below the Hot Link Blocking code:

RewriteRule \.(gif|jpg)$ http://www.mydomain.com/dontsteal.gif [R,L]Stop .htaccess (or any other file) from being viewed


order allow,deny
deny from all
Avoid the 500 Error

# Avoid 500 error by passing charset
AddDefaultCharset utf-8Grant CGI Access in a directory

Options +ExecCGI
AddHandler cgi-script cgi pl
# To enable all scripts in a directory use the following
# SetHandler cgi-scriptSave Bandwidth

# Only if you use PHP

php_value zlib.output_compression 16386
Password Protecting Directories

Use the .htaccess Password Generator and follow the brief instructions!

The CheckSpelling Directive

From Jens Meiert: CheckSpelling corrects simple spelling errors (for example, if someone forgets a letter or if any character is just wrong). Just add CheckSpelling On to your htaccess file.

The ContentDigest Directive

As the Apache core features documentation says: “This directive enables the generation of Content-MD5 headers as defined in RFC1864 respectively RFC2068. The Content-MD5 header provides an end-to-end message integrity check (MIC) of the entity-body. A proxy or client may check this header for detecting accidental modification of the entity-body in transit.

Note that this can cause performance problems on your server since the message digest is computed on every request (the values are not cached). Content-MD5 is only sent for documents served by the core, and not by any module. For example, SSI documents, output from CGI scripts, and byte range responses do not have this header.‿

To turn this on, just add ContentDigest On.

[/code]


Oct 10 2005

How to use the Up2date Command with Redhat Boxes

Tag:markmaldony @ 18:10

Linux / Unix Command: up2date

NAME
Update Agent - a program for updating packages on Red Hat Linux
SYNOPSIS
up2date [OPTION]… [PACKAGE NAME]…
up2date-nox [OPTION]… [PACKAGE NAME]…
DESCRIPTION
Update Agent provides a complete system for updating the RPM packages installed on a Red Hat Linux system. Both command line and graphical interfaces are included.

Continua”How to use the Up2date Command with Redhat Boxes”