Thursday, May 31, 2007

Use CheckInstall Instead of Make Install

Did you ever look for a binary, and as a last resort download the source to compile yourself?   Of course you were disappointed that the program would not be part of your package management system.

Usually you have to run something like this:

  ./configure
  make
  make install

An easy way to create an .rpm or .deb file from source is to run checkinstall instead of "make install" during the standard install from source.

http://freshmeat.net/projects/checkinstall -- CheckInstall Freshmeat Page

http://checkinstall.izto.org -- CheckInstall Home Page

CheckInstall keeps track of all files installed by a "make install" or equivalent, creates a Slackware, RPM, or Debian package with those files, and adds it to the installed packages database, allowing for easy package removal or distribution.


Wednesday, May 30, 2007

Don't Torrent That iTunes Plus Song...

Sure, you can now download music from the iTunes store without DRM but that doesn't mean you should just willy nilly start sharing that music with your friends. For one thing, it's illegal. For another, your account information is embedded into that m4a music file. Don't believe me? Try this yourself.


The site is mostly for Mac users, but the strings command works in linux, and cygwin for Windows. This link has interesting comments as well.



read more | digg story

Tuesday, May 22, 2007

Blogger Digest: Using VNC And Redhat Linux

VNC is an excellent way to remote control linux and Windows machines. Here is a description, and links to the programs.

Blogger Digest: Using VNC And Redhat Linux

Monday, May 21, 2007

Did you know these basic Firefox Tips?


You May know those BIG things But Did you know these? Excellent list of easy firefox tips to implement -- e.g., press Esc to stop animated gifs from moving...


# To quickly find any word in a web page type /word it will highlight the word and press Ctrl+G to “Find Again” that same word again

# If you wish to remove an item from your Address Bar Drop down menu,Highlight it without clicking and use Shift+Delete.

# To stop animated gifs from moving, press the ESC key.



read more | digg story

Wednesday, May 16, 2007

RHCE Study Notes - HTTP

These RCHE study notes were designed to be brief reminders of what you should already be familiar with. This topic covers HTTP server configuration.

One thing to be aware of when working with Apache and the 2.6 kernel is SELinux.

Overview of SELinux

SELinux, is a Mandatory Access Control (MAC) security system for Linux based on the domain-type model. It was written by the NSA (http://www.nsa.gov/selinux/ ) and is comprised of a kernel module (included in all 2.6 kernels), patches to certain security related applications, and a security policy.

More info: http://www.redhat.com/magazine/001nov04/features/selinux/

Study Notes

Here are the brief steps from my RHCE study guide to help you remember the steps to configure a virtual host, and configure permissions.

* HTTP/HTTPS
install httpd, check context with ls -Z
  Q: Create a virtual host www1.example.com w/ subdirectory /var/www/html/www1
  A:
   1) install httpd, modify /etc/httpd/conf/httpd.conf file
    <VirtualHost 192.168.0.1:80="">
    ServerName www1.example.com
    DocumentRoot /var/www/html/www1
    </VirtualHost>
   2) chcon -R --reference /var/www/html /var/www/html/www1
   3) service httpd restart
   4) chkconfig httpd on
  Testing
   service httpd configtest
   ls -Z /var/www/html/www1

The important things to remember are "chcon" to change the context, and "ls -Z" to check it.

Tuesday, May 15, 2007

How to Use Peer to Peer Safely

About P2P

P2P software is free, and legal to install and use, but it does make sharing of copyrighted material easy to do, and that is not legal. Are people still using P2P software after Napster got shut down? Yes, they certainly are. Free music downloads? Free software? -- well be careful about copyrighted materials, but the technology is interesting nonetheless. One of the best ways to get a large file, such as a linux iso file, is to use bit torrent.

Dangers

What are the dangers, and inconveniences of using peer to peer file sharing software such as Limewire, eDonkey, Azureus, or Bittorrent?

1.) The content quality is only as good as how trustworthy the peers are
2.) Some content is copyrighted, and may be illegal to share or download on this type of network
3.) Content may contain viruses, trojans, and decoys
4.) Excessive traffic may cause your ISP to limit your bandwidth usage
5.) Some downloads may take days to complete
6.) There may be pornography disguised as something else
7.) Some software may take up resources on your computer

Protocols

If you must use Peer to Peer file sharing software, try the File Donkey or Bit Torrent protocols. The products listed have legitimate uses, and are available on different platforms -- e.g. Linux, Mac, and Windows, but not all programs are listed here.

File Donkey

Has the advantage that things are easy to find, but downloads may take a few days.

http://sourceforge.net/projects/emule - eMule

Bit Torrent

Has the advantage of the fastest possible download, but finding torrent sites may be a challenge. Often used for large files, and recent releases.

http://www.bittorrent.com/ - Bittorrent

http://azureus.sourceforge.net/ -- Azureus

Azureus implements the BitTorrent protocol using java language and comes bundled with many invaluable features for both beginners and advanced users

http://aresgalaxy.sourceforge.net/ - Ares

Ares is a free open source file sharing program that enables users to share any digital file including images, audio, video, software, documents, etc.

Ares also has a good list of p2p risks:
http://aresgalaxy.sourceforge.net/p2prisks.htm

One of the most popular Bit Torrent sites has been http://www.suprnova.org -- Supernova, but now they started charging, so you'll have to decide if it's worth it. There are plenty of torrent sites you can find with a Google search.

Gnutella

Older, popular network, but there may be lot's of junk files, and downloads can be very slow. Also, some clients such as limewire are often considered to be resource hogs.

If you want use a gnutella client, such as limewire, consider using Creedence to identify junk files.

http://www.limewire.com/ -- Limewire

http://sourceforge.net/projects/credence/ -- Creedence

Credence is a decentralized system for identifying spam and decoy files in peer-to-peer networks. Credence is a complete Gnutella client, built on LimeWire, that lets you vote on objects and filters junk files from your search results.

Older gnutella client software either had spyware and adware built-in, e.g. Bearshare, Kazaa, or the network got flooded with spyware and adware, which caused the software to be blamed.

Privacy Protection

If you are afraid of being tracked for using a P2P network, you can block sites by using software such as PeerGuardian -

http://phoenixlabs.org/pg2/ -- Peer Guardian

PeerGuardian 2 is Phoenix Labs’ premier IP blocker for Windows. PeerGuardian 2 integrates support for multiple lists, list editing, automatic updates, and blocking all of IPv4 (TCP, UDP, ICMP, etc), making it the safest and easiest way to protect your privacy on P2P.

Also, make sure you have antivirus and anti-spyware utilites installed, if you are running Windows connected to the internet.

Monday, May 14, 2007

Fresh release: Vim 7.1

After one year and five days of waiting: a brand new Vim release! This is a stable version. There are many bug fixes and updated runtime files. No amazing new features. Upgrading from a previous version is highly recommended...

Note that Vim works on Linux, Windows, Macintosh, and other systems. This is an excellent free editor with syntax highlighting that is great for programming, text manipulation, and HTML editing.

If you plan to be a sysadmin, you have to learn vi. I use it for scripting, text editing, and blog posting, among other things.


read more | digg story

Saturday, May 12, 2007

How to Hide Files and Directories in Linux

In Linux, directories are not accessible until the device is mounted. This is usually done at startup by the mount command which uses the /etc/fstab file.

Files that start with a dot "." are hidden, but not completely (you can do ls -a to see the files). An example is the ~/.bashrc file. You can also hide files in a directory name that starts with a dot, e.g. ~/.ssh

Now for the real trick

Entire directories can be hidden, simply by mounting another device on top of the directory. The original files will still be in tact, but not visible until the device is remounted.

First, find a device that is available to mount (boot is nice, because it is usually small).

$ mount
/dev/hda1 on /boot type ext3 (rw)
...
etc...


Then make your stealth directory, copy files to it, and mount a directory over it.


$ cd /mnt
$ mkdir stealth
$ touch /mnt/stealth/somefile.txt
$ ls /mnt/stealth/
somefile.txt
$ mount -t ext3 /dev/hda1 /mnt/stealth
ls /mnt/stealth/
config-2.6.9-5.EL initrd-2.6.9-5.EL.img message System.map-2.6.9-5.ELsmp
config-2.6.9-5.ELsmp initrd-2.6.9-5.ELsmp.img message.ja vmlinuz-2.6.9-5.EL
grub lost+found System.map-2.6.9-5.EL vmlinuz-2.6.9-5.ELsmp


Then simply unmount when you want to access your original files


$ umount /mnt/stealth/
$ ls /mnt/stealth/
somefile.txt


Enhance your Website with Google Gadgets

Google has some excellent webmaster resources, and some fun and useful gadgets that can be quickly added to a website or blog. Just as with any good design, remember not to over do it.

http://www.google.com/webmasters/gadgets/

Here is what Google says about their gadgets:

------------------------------------------------------------------------------
Enhance Your Own Website

Add Google Gadgets to your webpage

You can now use Google Gadgets to make your webpages even more interesting and useful to your visitors. For instance, you can add your city's current temperature or a quote of the day to your own page. Just pick the gadget you want from our directory of "Google Gadgets for your webpage," customize that gadget, and copy-and-paste the HTML into your page's source code. Then, reload to see the gadget on your page.

Find gadgets for your webpage.

------------------------------------------------------------------------------

If you want to find something about cooking, recipes, or healthy foods, you can browse through the lifestyle category.

http://www.google.com/ig/directory?source=gghp&cat=lifestyle

Of course readers of http://systemnotes.org would probably be more interested in technology, or tools.

Check it out; it's a lot of fun, and you may find some useful gadgets for your readers.

Wednesday, May 9, 2007

Top Free Web Site Analysis Programs

There are two basic categories for web site tracking.

1. Online (Embeded Tracking Code)
2. Log Analysis (Software)

Onine

This type of analysis has the advantage that nothing needs to be installed on the web server. The disadvantage is that every page requires modification. That is not much of a problem for blogs, or generated content, but it can be tedious to modify a large number of pages by hand.

Google analytics is free, very simple to use, and produces excellent reports. Here are the instructions from their site:

https://www.google.com/support/analytics/bin/answer.py?answer=27323&hl=en_US

How do I track a new website?

There are two simple steps required to start tracking a new website: the creation of a new website profile, and the addition of Analytics tracking code to all of the pages you wish to track.

Create a new profile

1. From the Analytics Settings page, click Add Website Profile
2. Select Add a Profile for a new domain
3. Enter the URL of the site you will be tracking, making sure to select either http:// (most common) or https:// (secure site) from the drop-down list
4. Click Finish. The Tracking Status page appears, containing the tracking code necessary for the next steps

Add the tracking code to your pages

The code contained in the text box on the Tracking Status page must be copied and pasted into all of the web pages you will be tracking. It should be added immediately before the </body> tag, and can be added by hand or through the use of templates or includes, if available.

Log Analysis

Log analysis is a method of generating reports based on the logs that are produced by a web server, such as Apache, or IIS. This usually requires that sofware be installed on your web server. You web hosting company may or may not offer access to such a tool. If you manage the server yourself, it is not very difficult to set one of these up. Once the program is in place the reports are automatically generated.


I have had good success with Analog on both Apache and IIS.
http://www.analog.cx

It took a little bit of study to figure out what it does, but once you understand the format, and get it configured, your work is done. It generates nice reports on traffic, where visits came from, etc.

Some newly popular programs can be found on Freshmeat.net. e.g.

http://awstats.sourceforge.net

http://www.mrunix.net/webalizer

A freshmeat browse on the catetory Internet::Log Analysis, produces results of some of the more popular free web server log analysis programs.

http://freshmeat.net/browse/245/

Use Text Instead of Graphics

Sure we all want a nice looking website, but that doesn't mean you have to use lots of graphics and flash animation. It turns out, you'd be much better off using text instead of graphics. Here's the proof...

Use text instead of graphics on your website

Nowadays, it seems that every site owners knows how his site should look like: visually appealing, with a large amount of graphics (or even Flash) and, of course, with plenty of images of people, preferably women, preferably barely clothed (or naked).

But reality is that what works isn't what people, who barely know anything about web design, think to work.

read more | digg story

How to Copy and Paste in Linux and Windows

This is a very simple topic, but sometimes little tips can save you a lot of time.

Windows & Linux

First select the text, or item, or location to paste to:
Copy = Ctrl-c, or From the "Edit" menu, select "Copy"
Cut = Ctrl-x, or From the "Edit" menu, select "Cut"
Paste = Ctrl-v, or From the "Edit" menu, select "Paste"

You can copy and paste text, graphics, files, etc. In Windows, you can copy and paste files within Windows Explorer, or you can drag and drop them.

Linux

All of the above, plus:

Copy = Select text with the mouse
Paste = Click the middle mouse button

vi

If you want to copy and paste in vi, that's another topic. To copy a line in vi, type yy (yank line), and then p (paste after), or P (paste before). To copy a word, use yw (yank word). To copy five lines -- 5 yy, or five words -- 5 yw, or to paste something five times 5p.
Here are some good tips on vi http://www.vim.org/tips/tip.php?tip_id=312 .

By the way, vi is available for Windows, and is free to download and use -- http://www.vim.org. Vim is excellent for looking at and editing HTML or other code, because it has color coding and syntax highlighting.

Copy and Paste Between Linux and Windows

If you want two have monitors on your desk, you can share the keybord and mouse using an open source program called synergy. http://synergy2.sourceforge.net

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems without special hardware. It's intended for users with multiple computers on their desk since each system uses its own monitor(s). Just move the mouse off the edge of a screen to move to another screen; keyboard and mouse input is then redirected to the other screen. Synergy also lets you cut and paste between systems and it makes screen savers activate/deactivate in concert.

Cygwin and Windows Command Prompts (topic added Dec, 2007)

Another question people may have is how to copy text from a cygwin window, Windows command prompt, and ssh session such as putty. The typical Windows method of copy / paste is to either use ctrl-ins (copy) and shift-ins (paste), or ctrl-c (copy), ctrl-v (paste), but in command prompts it is different. Here is the trick:

1) Select the upper left corner of the command prompt window (left or right-click)
2) From the menu, select Edit
3) From the submenu, select Mark
4) Then use the mouse to highlight the area to be copied from the command prompt window
5) Press Enter to copy it to the clipboard
6) Now go to another application and paste it.
Note: to paste text into a command prompt, use the same upper left menu, and select Edit, Paste

Monday, May 7, 2007

11 Things I can do in Linux that I can't do on Windows

1. Update every single piece of software on my system with a single action. This is one of the main reasons I run Linux. Sure, Windows has Windows Update, but that only updates the operating system, Office, and a few other things. For every Linux distribution I've used (Gentoo, Red Hat, Suse, Ubuntu), updating is simple.



read more | digg story

Saturday, May 5, 2007

"Web 2.0" in just under 5 minutes. - video

"Web 2.0" in just under 5 minutes.

This is a slightly revised and cleaned up version of the video that was featured on YouTube in February 2007.


Link: http://youtube.com/watch?v=NLlGopyXT_g

Top 7 Things System Administrators Forget to Do

Out of the plethora of chores that we do each day, which ones make up the top seven activities of forgetful system administrators? To begin, you might ask yourselves if the answer is quantitative or qualitative. Let's think about it for a minute.

  1. Forgetting to Delete a Former User's Account

  2. Forgetting to Regularly Search for Rootkits

  3. Forgetting to Use a Trouble Ticket Tracking System

  4. Forgetting to Set Up Technical Documentation and Creating a Knowledge Base

  5. Forgetting the Risks of Flash Memory Drives

  6. Forgetting to Manage Partial Root Access

  7. Forgetting Courtesy




read more | digg story

CSS Reset Reloaded

Eric Meyer, CSS Guru gives us a run down on some extreme CSS Reset. Think of these as a starting point for creating your own defaults, in addition to being a way to illuminate the nature of browser defaults. Simply the act of taking those defaults into consideration and thinking about them closely puts you ahead of 99% of your peers.



read more | digg story

Absolutely HUGE List of Color Related Sites!

Someone put together a list of just about every color related resource (worth mentioning) in the known universe. Designers rejoice!

http://www.colorschemes.org



read more | digg story

10 Reasons Why It Doesn’t Pay To Be “The Computer Guy”

Scroll down for the top 10 list.



From http://www.lifereboot.com


read more | digg story

Thursday, May 3, 2007

Using the Bash History

The command history is stored in ~/.bash_history. The history typically contains the last 500 commands typed at the shell prompt.

You can view the history by using the history command.

history | less

Then you can search for a command.

e.g. what was the name of that directory I created yesterday? Oh, yeah, I can search history for the mkdir command by using the slash.

/mkdir

You could also use grep, but with less, you can see the surrounding commands, as you often want to see the sequence of what was done.

History Shortcuts

  • !! - Executes the last command

  • !902 - Executes command number 902 (from the history list)

  • !service - Executes the command whose string matches the most recent history entry

  • Up / Down - The most common shortcut is to simply use the up and down arrows to scroll through the bash history.


Example
If you recently restarted the network service, and then wanted to restart it again, you might do something like this;

service network restart
ping somehost.example.com

You see that the network is unreachable.

Then you remember that you misconfigured something, such as gateway so you modify it:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Now, rather than typing the entire command again "service network restart", you can simply type:

!serv

A similar shortcut can be used when you forget to type sudo.
e.g.

$ mkdir /root/test
mkdir: cannot create directory `/root/test': Permission denied
$ sudo !!
sudo mkdir /root/test
$

Or, to change the previous command, while keeping the parameter, use "!$"

e.g., change cat to vi, but keep the rest of the line
$ cat /etc/resolv.conf
search example.com
nameserver 192.xxx.xxx.xxx
$ vi !$
vi /etc/resolv.conf


see also http://systemnotesorg.blogspot.com/2007/03/unix-linux-command-tips.html

Wednesday, May 2, 2007

How to Turn on IP Forwardarding

IP Forwarding
  • Effectively makes a Linux box act as a router

  • Is usually used with two network interfaces (one internal, and one external)

  • Can be used with firewall services and is often used for NAT


Steps to Turn on IP Forwarding


 1) Modify /etc/sysctl.conf
     vi /etc/sysctl.conf
     add this line:
     inet.ipv4.ip_forward=1
 2) Make the Change Active
     sysctl -p
 3) To View Current Settings:
     sysctl -a | grep ipv4


More info can be found on the redhat site:
https://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/security-guide/s1-firewall-ipt-fwd.html


We'll leave firewall rules for another topic...