June 25, 2010

Magic System Request Keys For Ubuntu

By The Computer Doctor:

I spent a wonderful evening recently with some friends looking at old servers and fixing database reports. I know... I really need to get out more.

During the course of the evening Gene showed us how to force a reboot or shutdown by using the SysRq key and a combination of other keys which were as follows...

Hold down the "Alt" and "Print Screen - SysRq" key and type in the following letters R, E, I, S, U, B Which can easily be remembered with the mnemonic "Raising Elephants Is So Utterly Boring"

As intrigued as I was, I noticed that the screen went black like we were back in terminal mode and I saw a flood of information on the screen and I knew that each of these letters stood for something. After doing a little bit of research online I found the following chart that may help if you need to use the "Magic System Request" in Linux.

0 - 9 - sets the console log level, controlling which kernel messages will be printed to your console so that you don't get flooded.

B - restarts the system without making steps to ensure that the conditions are good for a safe reboot, using this key alone is like doing a cold reboot.

E - sends SIGTERM to all processes except init. This means that an attempt is done to end the current processes except init, safely, e.g. saving a document.

F - call oom_kill(Out Of Memory Killer), which will kill a process that is consuming all available memory.

H - displays help about the SysRq keys on a terminal though in actuality you can use any key except for the ones specified, to display help.

I - sends SIGKILL to all processes except init. This means that all the processes except for init are killed, any data in processes that are killed will be lost.

K - kills all processes on the current terminal. It is a bad idea to do this on a console where X is running as the GUI will stop and you can't see what you type, so you will need to switch to a tty after doing the magic SysRq.

L - sends SIGKILL to all processes, including init. This means that every process including init will be killed, using this key will render your system non-functional and no further magicSysRq keys can be used. So in this case you will have to cold reboot it.

M - dumps memory info to your console.

O - shuts down the system via ACPI or in older systems, APM. As in key "B", using this key alone is like a cold reboot(Or in this case, a cold shutdown).

P - dumps the current registers and flags to your console.

Q - dumps all timers info to your console.

R - takes keyboard and mouse control from the X server. This can be useful if the X-Server crashed, you can change to a console and kill the X-Server or check the error log.
NOTE:- The documentation refers to this key's task as "Turns off keyboard raw mode and sets it to XLATE", but I suppose it's safe enough to assume that it takes back control from X.

S - writes all data from the disc cache to the hard-discs, it is a sync and is necessary to reduce the chances of data corruption.

T - dumps a list of current tasks and info to your console.

U - remounts all mounted filesystems read-only. After using this key, you can reboot the system with Alt+SysRq+B without harming the system.

W - dumps uninterruptable (blocked) state tasks.

Remember that although you can use these letters in any sequence that you wish, there may be unforeseen consequences by skipping some of the letters in the REISU* sequence and skipping straight to the B or O so be careful when using these commands. Also remember that there is a build in reboot or shutdown procedure and it is better to use that then the forced commands with the magic system request keys.

Enhanced by Zemanta

June 17, 2010

Behind The Proxy With Lucid Lynx

By: The Computer Doctor

For the past year I've been enjoying (tongue in cheek) providing software support for a primarily Windows oriented company. Every time I see references to does not work in Linux or no support for Linux it gets my ire and curiosity up (and not always in equal portions).

My original idea was to have a virtual Linux box available so I could test different software packages with WINE but I kept running into the same brick wall... The Proxy.

That's right, a simple proxy was stopping me. I was able to configure the proxy for my browser, but not for synaptic. "So What?" you might be thinking. Well without Synaptic or apt-get in the terminal I can't get updates or other familiar software packages. I know some wise guy out there is saying that I could go get the tar-gz with my browser and compile from scratch, but remember that I'm supposed to be doing software support in a windows shop. Do you think the local IT guy or some MCSE is going to be happy to hear that someone is setting up a Linux box in house?
So down to the nuts and bolts of how I finally set up my Linux box behind the proxy.

What you need to start with:
  1. Oracle's VirtualBox with a new machine setup. I gave it 30Gb hard drive and 768Mb Ram
  2. A Linux OS. I used Ubuntu Desktop 10.04 LTS
  3. The proxy address
After setting up your VirtualBox machine and installing Ubuntu I used these settings to get access to the internet.

Go to System / Preferences / and select Network Proxy.

Inside the Network Proxy settings you want to check the Manual proxy configuration box. Also check the Use the same proxy for all protocols. Fill in the proxy address or IP address. Fill in the port number which will usually be 8080. Now click the close button.After clicking the close button you will get a system question box asking if you want to apply these setting system wide (and you do). When you click on the Apply System-Wide button it will ask you for your password. Just fill it in as many times as it asks you for it and it will eventually end.
The next step is to set up Synaptic. Go to the System menu / Administration menu / and select Synaptic Package Manager.Inside Synaptice you want to click on the Settings Menu and then choose Preferences.
Inside the Preferences menu you want to click on the Network tab. Check the Manual proxy configuration box. Fill in the proxy address or IP address in the HTTP and FTP proxy box and fill in the port for both as well. Click on the Authentication button and fill in your username and password.
REMEMBER: If you network has you change your password occasionally, you will have to come back and change your password here as well.

Enhanced by Zemanta

June 08, 2010

Easy Remote Support

TeamviewerImage via Wikipedia

By The Computer Doctor:

How many times have you gotten stuck trying to support a friend of family member over the phone and no matter what you tell them they can not follow your directions. Or perhaps they are having difficulty with a program and you really need to see what they are trying to describe in woeful futility.

The program that I have been using for over a year now and thoroughly enjoy is teamviewer. With teamviewer you can use the program for free for non-commercial use or purchase one of their business packages and get advanced features.

Teamviewer.jpgImage by pshadow via Flickr

To use Teamviewer you will have already installed the program on your own computer and direct the person that needs support to go to teamviewer.com and click on the "Start Full Version" button on the main page. Direct them to run the program and when it asks if they want to install it direct them to just run it instead. Next they will need to provide the ID and Password that the program gives them. Just enter their ID and click on the connect button, then enter their password and click log on. Next you will see their screen and will have access to their computer.

In addition to remote control of the target computer you will also have a built in file transfer feature and presentation feature.

This program was originally designed for PC's, but now has versions for Macintosh and Linux (Fedora, Debian, Ubuntu, and the tar.gz for compileing) as well as an IPod version.

Reblog this post [with Zemanta]

Backing Up Your Linux Data and Keeping Your Programs Durring Upgrades

Alternate Ubuntu logo. Derived from a GPL logo...Image via Wikipedia

By The Computer Doctor:

As many of you may have read in my past posts, I have always had difficulty with upgrading from one Ubuntu version to the next. With the exception of the transition from Karmic Koala 9.10 to Lucid Lynx 10.04 I have never successfully upgraded using the graphical installer.

So I was left backing up my personal data, installing the new OS, restoring my personal data and then going through the repositories and re-installing the programs that I use the most. What a pain!

Fast forward a few years and we now are blessed to have a great friend home from the mission field who gave us this tip for backing up your data and also restoring data which is particularly helpful when we upgrade the OS.

Step One: The Backup.
If you want to back up all your hidden files, then you'll have to be root to do this.
To become Root in Ubuntu type Sudo and then Enter. Now enter your password when prompted.
Also note that gene is our guru's name and you should replace gene in this example with your own home directory name.
To back up /home/gene, become root, and use this code:
cd /home tar -cvf gene.tar gene
That will create a file in /home with the name "gene.tar". If you have a lot of data, it will be a pretty big file. Hopefully it will be less than 700MB so you can fit it on a blank CD. If not, burn it to a DVD. You can make it a little smaller by using compression - the command for this is almost the same:
tar -zcvf gene.tar.gz gene

Step Two: Restoring The Data Into The Home Directory
After you've installed your new OS, create a user gene. Then you'll have to erase gene's home directory, copy the tar file to the home directory and untar it with this code:
cd /home rm -fr gene cd /media/cdrom cp gene.tar /home cd /home tar -xvf gene.tar
If you used file compression, the command would be:
cd /home rm -fr gene cd /media/cdrom cp gene.tar /home cd /home tar -zxvf gene.tar.gz
I'm assuming in the above that the OS mounts the cdrom at /media/cdrom (that's where Ubuntu puts it). It could be /mnt/cdrom, or perhaps a different location if you used a USB flash drive.

What does this do?
The home directory stores your documents, pictures and music. Equally important are the hidden files in the home directory that stores all of your installed programs and settings. I used to find it amazing that Linux programs could be so small, but now I'm more amazed that Windows programs could be so bloated.
So by backing up this home directory, you are in essence preserving all of your personal data and programs so if anything happens you will just need to install the OS and restore your home directory to get back to where you needed to be.

Reblog this post [with Zemanta]

June 01, 2010

Uncorking the WINE

It is the symbol of notification of error of u...Image via Wikipedia

By The Computer Doctor

Ubuntu 10.04 has been out for a few weeks now and over all I'm mostly satisfied until this past week. One of the programs that I used exclusively in Windows was Full Tilt Poker. Of course if you go to the site you will see that you must have windows and there is no linux support and blah blah blah. Whatever. I know that I can usually get programs to work to some extent using WINE.

Now when I finally got the executable downloaded and tried to run it with Wine I got an error message stating "The file '/home/user/Downloads/program_name.exe' is not marked as executable. If this was downloaded or copied form an untrusted source, it may be dangerous to run. For more details, read about the executable bit."

After researching this issue, it seems that Canonical has decided that if it's not free and open source that they don't want me to install the software. All I could think was "who's bone head idea was this?". I decided to go Linux to get away from counter productive draconian measures that were detrimental to the user.

Now before we all get our knickers in a bunch let me describe multiple ways to solve this manufactured nuisance.

Solution 1. Allow executing file as program
To solve the problem, right click on the .exe file, select Properties, select the Permissions tab and check "Allow executing file as program". Then hit the Close button.

Solution 2. Wine in the terminal
Run .exe from the terminal and you shouldn't see the "Blocked: wine start /unix" message:
code: wine /media/storage/Setup.exe

Solution 3. Custom launcher
Right click on the .exe file, select Open with other application -> Use a custom command and use wine for the command.
To launch an .exe file, right click on it, select Open with wine.
You can also right click on the file, select Properties -> Open With and select wine. The a double click on any exe file will shouldn't show the "Blocked: wine start /unix" message.

Solution 4. Change the default launch command
Edit the default launch command for wine
code: gksu gedit /usr/share/applications/wine.desktop
change: Exec=cautious-launcher %f wine start /unix
to: Exec=wine start /unix %f

So to summarize,
  1. Canonical is trying to make The Computer Doctors life more complicated
  2. Google is your friend
  3. The Computer Doctor finds the solutions and saves the day
Reblog this post [with Zemanta]

Hex Converter

Hex To ASCII Converter

Hex:
Ascii:

 

Integer to Byte converter


This is a tool to practice converting between decimal and binary representations. After you have practiced for a while and feel that you know how to do the conversions, take the quiz.
Decimal number to convert:
Binary representation:


Binary number to convert:
Decimal representation: