Site Feed

Tuesday, September 22, 2009

Reset a Frozen SSH Session

I mentioned previously that you can reset a shell by typing "reset."

There is another problem that can cause a shell or xterm to freeze. If you ssh to a remote host, and then logout, sometimes the session will freeze. In that case, all you need to do is type "Enter", "~", "." (Enter, Tilde, Dot with no spaces) to get the console back. That's the Enter key, immediately followed by tilde "~", and then a period "."

[Enter]~.

Also, a convenient way to exit a shell, xterm, or remote ssh terminal is to use Ctrl-D rather than taking the time to type the word "exit."

Wednesday, September 9, 2009

Script to Unlock Firefox

I wrote a script to unlock Firefox on a linux machine. The symptom is when firefox is not running, but it won't let you start because it thinks it's still running. If you have already run "pkill -9 –f firefox", then all you have to do is delete the lock files -- .parentlock, and lock.

This is user specific, so you'll have to find your own home directory under ~/.mozilla/firefox/. Mine is dz4bq7je.scottm on this host.

$ cat ~/bin/unlock_firefox.sh
#!/bin/sh
rm ~/.mozilla/firefox/dz4bq7je.scottm/.parentlock
rm ~/.mozilla/firefox/dz4bq7je.scottm/lock
$ ll ~/.mozilla/firefox/
total 12
drwx------ 9 scottm users 4096 Sep 9 11:25 dz4bq7je.scottm
-rw------- 1 scottm users 1264 Jun 23 2008 pluginreg.dat
-rw-r--r-- 1 scottm users 162 Nov 15 2005 profiles.ini
$

The advantage of this simple script is that you don't have to go looking for directories and files, or remember where firefox puts them. Just remember when it's locked, look for your unlock script.

Thursday, August 13, 2009

How to use BCC in Yahoo Mail Classic

Here is a quick example of how to use BCC in Yahoo Mail Classic.

The idea is similar in many different email programs.


Easy Two Step Process

There are two simple steps to help your recipients avoid getting flooded with spam.

1.) Enable the Bcc feature

2.) Use "Bcc:" instead of "To:" whenever sending mail to multiple recipients.

Screen Shots

Step 1.) Find and Enable the Bcc feature




















Step 2.) Use Bcc:
























That's all there is to it! You'll be saving your friends from tons of unwanted emails by keeping their email addresses private.

For more details on why BCC is important, please see this article:

http://systemnotesorg.blogspot.com/2008/02/bcc-howto.html

Thursday, July 30, 2009

RHCE Flash Cards

I came up with some flashcards based on commonly used redhat linux commands. Here is my working draft.

RHCE-Flash-Cards

These notes should be helpful to anyone working on Redhat Enterprise Linux (RHEL), or preparing for the RHCE exam.

My RHCE Study Guide was hugely popular, but unfortunately it had some potential copyright issues. This group of flashcards has also been released as a quick study guide, or cheat sheet, and contains much of the same original study guide material, but with all proprietary information removed. This 3-page guide is listed as RHCE Flash Cards (condensed version)

How These Slides Were Created

These slides were produced using OpenOffice.org Impress.
  1. Created Slides
  2. Saved as html
  3. Copied contents of html between body tags to .page files.
    • Used a bash shell script with sed, and awk to get the files to appear properly for webgen. See script here—html2page.html
  4. Ran webgen on the directory to generate .html
Also .pdf files were saved from Openoffice.org Writer, which not only is free software, but also allows writing of .pdf files -- also for free. Isn't open source software great?

Let us know what you think.

If you notice any errors, omissions, or potential copyright issues, please comment below, or contact us.

Tuesday, December 2, 2008

Comic - Huge Software Sale

Huge Software Sale


We can't have all work and no play, so a cartoon every once in a while doesn't hurt. While you're having fun, check out http://www.lifeisnojoke.com.


Here are some articles on where to find free software:

opensource-software-for-windows

searching-for-software

Now, some people may not understand that by free, we mean free. Not pirated, illegally copied, or borrowed. Open source software is free to use, copy, modify and distribute.

A small to medium-sized company may have 100 computers, and have to pay $200 for some kind of office software for each machine for a total of $20,000. But if the company chooses to use free software such as openoffice, the price would be $0.00 x 100 = $0.00.

Freedom Fry — "Happy birthday to GNU"

Mr. Stephen Fry introduces you to free software, and reminds you of a very special birthday.






Freedom Fry — "Happy birthday to GNU"


Published on: http://www.gnu.org/fry/happy-birthday-to-gnu.html

Monday, December 1, 2008

Using the Perl Debugger Interactively


Sometimes you might want to test a few ideas to implement into a perl script, but you want to see if it will work before you implement it. The Perl debugger is perfect for that.

What is the Perl Debugger?

Here is an intro from man perldebug :

If you invoke Perl with the -d switch, your script runs under the Perl source debugger. This works like an interactive Perl environment, prompting for debugger commands that let you examine source code, set breakpoints, get stack backtraces, change the values of variables, etc. This is so convenient that you often fire up the debugger all by itself just to test out Perl constructs interactively to see what they do.

For example: $ perl -d -e 42

Using the Perl Debugger Interactively

To invoke the perl debugger, simply use the -d option, and give it any name, such as "1", in this example. Instead of specifying "-e 1", you could specify a filename to have perl debug the file.

In this case, we want to use the debugger interactively, so we type:


perl -d -e 1


Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `perldoc perldebug' for more help.

main::(-e:1): 1

DB<1> print hello


DB<2> print "hello";
hello

DB<3>

Notice that the correct syntax for print is to use quotes, and terminate with a semicolon ";". The debugger is a quick way to verify simple constructs.


DB<4> test=123
Can't modify constant item in scalar assignment at (eval 14)[C:/Perl/lib/perl5db.pl:628] line 2, at EOF


DB<5> $test=123


DB<6> print $test;
123

DB<7>

Notice that a scalar requires the dollar sign "$" character for both assignment and calling the variable. This is different for shell scripts, where assignment requires no dollar sign, and invocation requires it. Here in the perl debugger, it is easy to test simple operations.

Notice also that this works on any OS where perl is installed. I run this on Windows and linux.


Here it is on RHEL 5:

-bash-3.2$ perl -d -e 1

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1): 1

DB<1> print "hello";
print "hello";
hello

DB<2>

So, have fun with the debugger. Of course, as is common in perl, there is more than one way to do things. You can combine options

perl -de 1

And, of course there is always the perl one-liner:

-bash-3.2$ perl -e 'print "hello\n";'
hello
-bash-3.2$