Welcome to Vhunk’s Weblog











Here are 15 signs that you are addicted to Linux.

  1. You bring a live CD with you whenever you’ll be using a computer away from your house.
  2. You subscribe to a Linux magazine such as Linux Journal, Linux Mag, or Linux Format
  3. Every time a friend or relative complains about their computer being slow due to spyware, adware and viruses, you tell them to install Linux.
  4. You want a Penguin for a pet.
  5. You understand what the command “mv windows /dev/null” means.
  6. Your home page is http://www.google.com/linux
  7. You subscribe to my RSS feed.
  8. You own a RTFM coffee mug.
  9. You participate in System Administrator Appreciation Day.
  10. You hang out on Freenode.
  11. You are a member of a local Linux User Group.
  12. You have installed Linux on your mom and dads computers.
  13. You know the African definition of the word Ubuntu.
  14. You know who Linus Torvalds is.
  15. You know who Hans Reiser is, and what he is accused of.

Can you think of anymore? Leave a comment and share with everyone.



If you are a hard core systems administrator or Linux engineer you’ll probably recognize most of these Linux command line tricks. The following Linux command line tips are not typically used by your everyday Linux user.

Quickly Find a PID with pgrep

pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout.

pgrep ssh

This will list all PIDs associated with the ssh process.

Execute The Last Executed Command

The heading sounds a bit confusing but it’s exactly what it does.

!!

This will execute the last command you used on the command line.

Execute The Last Command Starting With..

If you want to execute a command a command from history starting with the letter S you can use the following:

!s

This will execute the last command used on the command line that started with s.

Run a Command Repeatedly and Display the Output

watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds. watch is very similar to tail.

watch -d ls -l

This will watch the current directory for any file changes and highlight the change when it occurs.

Save Quickly in VI/VIM

If you’re in a hurry, you can save and quit the file you’re editing in vi by exiting insert mode, holding shift, and hitting z twice.

Quickly Log Out of a Terminal

You can quickly log out of a terminal session by using: CTRL+D

Navigate to the Last Directory You Were In

cd - will take you to the last directory you were in.

Make Parent Directories the Smart Way

mkdir -p /home/adam/make/all/of/these/directories/ will create all directories as needed even if they do not exist. Why waste time doing something silly like: mkdir make ; cd make ; mkdir all ; cd all ; mkdir of ; cd of … you get the point. Use mkdir -p!

Delete the Entire Line

If you’ve just typed a long string of commands that you don’t need to enter anymore, delete the entire line by using: CTRL+U.

Set the Time stamp of a File

touch -c -t 0801010800 filename.c will show the time stamp as 2008-01-01 8:00. The format is (YYMMDDhhmm).

Can you think of any other Linux commands that are less known to the general Linux community?



{June 21, 2008}   Reasons to Switch to Linux

The Linux Information Project has a great write up on 25 Reasons to Switch to Linux.

Businesses, educational institutions, governmental agencies and other organizations around the world are converting1 their computer operating systems from Microsoft Windows to Linux at an increasing pace. They are likewise converting their application programs from commercial software to free software (also referred to as open source software). There are at least 25 reasons for this situation..

Here are a few excerpts from the article :

Because it is licensed under a free software license, Linux (as well as other free software) is available at no cost. It can be downloaded from the Internet for free, and it can be purchased in disk or box form at trivial cost. One copy can be used on as many computers as desired with no restrictions. This is in sharp contrast to Microsoft Windows, which can easily cost US$100 or more per computer.

Linux features superior security, including a very low rate of infection by viruses, trojans, worms, spyware and other malware. This is because UNIX and all of its descendants (including Linux) been designed from the ground up with security in mind, rather than having attempts at security tacked on as an afterthought. For example, users do not routinely use the system as the root (i.e., administrative) user, thereby protecting key system files even in the event of a break-in by a malicious intruder. Also, a robust firewall is included in major distributions and it is enabled by default. Another important factor is the free availability of the source code, which allows thousands of people around the globe to search for security vulnerabilities in it.

Read the entire article here..



While surfing i found a nice Linux Artical Where you are able to turn the lights on or off in your room from anywhere in the world via SSH its it tool c00l…

here it goes…

Introduction:

In this article I will walk you through making a device that controls electronic devices using your computer. This will give you a lot of power. For example, I am able to turn the lights on or off in my room from anywhere in the world via SSH. I know there are a few of these out there but mine is better. Mine doesn’t have complicated schematics with diodes resistors, 12Volt power supplies (where the hell are you suppose to get this from), and transistors. It’s simply a relay wall plug and wire. Below is the schematic. Click on the image to resize it.

What you will need:

Before you get started here is a run down of what you will need. Most of this stuff can be purchased at a local Wal-Mart or Target for a decent price.

  • A Relay. part# G3MC-201PL-DC5 (the most important component)
  • Light Socket
  • Wire
  • Solder Iron
  • Solder Wire
  • Tape
  • Scissors
  • Wall plug. Rip this off any old electrical device. and split the two wires. I used one from an blow dryer that doesn’t work.

Step 1:

The first thing you want to do is take the wall plug and solder one side to any of the relays load legs. Then connect the other wire of the wall plug to the socket. I put tape over the soldered leg to give it that extra hold and because when I solder the other leg it’s important not to get a short.

Step 2:

Now solder a wire to the next relay leg. **Don’t use an extremely thin wire like from your headphones**. Use wire that can handle 120 V AC.

Step 3:

Connect that wire to the other end of the socket. What you should have now is a wall plug with one end attached to one of the relay legs and the other end attached to the socket. Also you should have a wire that can handle 120V AC connected to the other side of the socket and the other relay load leg. This should form a loop. What opens and closes the loop is the relay. When the input legs receive 5 volts it closes the load legs and current flows.

Step 4:

Now solder two wires to the input legs of the relay. These will receive 5 volts from the parallel port and create a short in the load legs closing the circuit and allowing current to flow and thus turning on the electronic component. The circuit is now complete. Connect one wire to the 6 pin the other to the 22 pin

Step 5:

Make some kind of box to hold the circuit. I used the box that my relay came with from mouser.com. Below is what i put together.

Step : 6

Creating the application. Can’t get any easier than this.

LINUX CODE :

#include
#include
#include
#include#define base 0×378 /* printer port base address */

main(int argc, char **argv)

{

int value;

if (argc!=2)

fprintf(stderr, “Error: Wrong number of arguments. This program needs one argument which is number between 0 and 255.\n”), exit(1);

if (sscanf(argv[1],”%i”,&value)!=1)

fprintf(stderr, “Error: Parameter is not a number.\n”), exit(1);

if ((value<0) || (value>255))

fprintf(stderr, “Error: Invalid numeric value. The parameter number must be between 0 and 255\n”), exit(1);

if (ioperm(base,1,1))

fprintf(stderr, “Error: Couldn’t get the port at %x\n”, base), exit(1);

outb((unsigned char)value, base);

}

WINDOWS CODE:
MUST HAVE THIS DLL IN THE SAME FOLDER: inpout32.dll

#include
#include
#include/* Definitions in the build of inpout32.dll are: */

/* short _stdcall Inp32(short PortAddress); */

/* void _stdcall Out32(short PortAddress, short data); */
/* prototype (function typedef) for DLL function Inp32: */

typedef void (_stdcall *oupfuncPtr)(short portaddr, short datum);
#define PPORT_BASE 0×378

/* After successful initialization, these 2 variables

will contain function pointers.

*/
oupfuncPtr oup32fp;

/* Wrapper functions for the function pointers

- call these functions to perform I/O.

*/

void Out32 (short portaddr, short datum)

{

(oup32fp)(portaddr,datum);

}

int main(int argc, char **argv)

{

HINSTANCE hLib;
int value;
if (argc!=2)

{

fprintf(stderr, “Error: Wrong number of arguments. This program needs one argument which is number between 0 and 255.\n”);

exit(1);

}
if (sscanf(argv[1],”%i”,&value)!=1)

{

fprintf(stderr, “Error: Parameter is not a number.\n”);

exit(1);

}
if ((value<0) || (value>255))

{

fprintf(stderr, “Error: Invalid numeric value. The parameter number must be between 0 and 255\n”);

exit(1);

}

/* Load the library */

hLib = LoadLibrary(”inpout32.dll”);
if (hLib == NULL) {

fprintf(stderr,”LoadLibrary Failed.\n”);

return -1;

}
/* get the address of the function */

oup32fp = (oupfuncPtr) GetProcAddress(hLib, “Out32″);
if (oup32fp == NULL) {

fprintf(stderr,”GetProcAddress for Oup32 Failed.\n”);

return -1;

}

/***** Write the data register */

Out32(PPORT_BASE,value);
printf(”Port write to 0x%X, datum=0x%2X\n” ,PPORT_BASE ,value);

/* finished – unload library and exit */

FreeLibrary(hLib);

return 0;

}

Conclusion :

If something is not clear or you need some help you can send me an email at foughtnlost AT gmail.com I want everyone to get this working because in my next article I will go over on how to turn off your lights using a cell phone and fetchmail.



The REAL reason we use Linux

We tell people we use Linux because it’s secure. Or because it’s free, because it’s customizable, because it’s free (the other meaning), because it has excellent community support…

But all of that is just marketing bullshit. We tell that to non-Linuxers because they wouldn’t understand the real reason. And when we say those false reasons enough, we might even start to believe them ourselves.

But deep underneath, the real reason remains.

We use Linux because it’s fun!

It’s fun to tinker with your system. It’s fun to change all the settings, break the system, then have to go to recovery mode to repair it. It’s fun to have over a hundred distros to choose from. It’s fun to use the command line.

Let me say that again. It’s fun to use the command line.

No wonder non-Linuxers wouldn’t understand.

The point with us Linux fans is – we use Linux for its own sake. Sure, we like to get work done. Sure, we like to be secure from viruses. Sure, we like to save money. But those are only the side-effects. What we really like is playing with the system, poking around, and discovering completely pointless yet fascinating facts about the OS.

There are three main reasons Linux is so much fun:

1. Linux gives you complete control

Ever tried stopping a process in Windows and the OS wouldn’t let you? Ever tried deleting a file – and you couldn’t? Even though you had admin rights?

Linux lets you do anything. That’s the great benefit of usually logging in as user. If you login as the root, the OS assumes you know what you’re doing. Once you become root, everything is allowed.

2. Linux isn’t widely used

This is a paradox. We often complain Linux isn’t more widely used. But that’s one of the reasons we use it. It gives us a feeling of being a special clique. Like we’re better than “those ignorant masses”.

If Linux becomes widely used, we’ll probably switch to something else. Or at least develop an obscure distro that only we will use. Because, let’s face it, we want to feel special.

3. Linux is free (as-in-speech)

We can get the source code for all our applications. If we want to know how a certain part of the OS works, we can. This lets us tweak and play with our systems. And we absolutely loo-o-o-ve tweaking our system.

Of course we can’t tell non-Linuxers we use Linux because it’s fun – they’d stick us into a mental asylum quicker than you can say “antidisestablishmentarianism”. So we’ll keep telling them the false yet plausible reasons for using Linux. But deep inside, we’ll know the real reason we use Linux.

And maybe, just maybe, next time someone asks me why I use Linux, I’ll flash a huge smile and answer: “Because using Linux is FUN!”



If you’re just starting out with using Linux then chances are you’ve probably seen or heard a few Linux terms that you don’t recognize. It’s typical that when you ask, or search, for help on the Internet for Linux, you’ll see some of the following terms. I’ve put them in one place for you so that the next time you see a Linux vocabulary word you don’t know, you can check back here.

APT – Advanced Packaging Tool. APT simplifies the process of managing packages on Linux by automating the retrieval, configuration and installation. Generally, you’ll find APT on a Debian or Ubuntu distro.

BashBourne Again Shell is generally the default shell in most Linux distributions. When someone refers to a shell or the command line the Bash shell is usually what they are referring to.

CLI – The CLI is known as the Command Line Interface.  When you open a terminal, or if you do not use a Window Manager, or X11, you are operating on the CLI.

Dependency – A application, library, or development set that a package depends upon to work.

Distro – Short for Distribution, a distro is a set of programs combined with the Linux Kernel to create an Operating System.

GNOME - Can be called a “complete” desktop environment for Linux. Gnome is the default desktop on the popular Ubuntu distribution.

GRUB – Another boot loader for Linux. Allows users to have several different Operating Systems on their system at once, and choose which one to run when the computer starts.

KDE- KDE or the K Desktop Environment, is desktop environment for Linux workstations.

Kernel – The core, or “brain” of Linux. The kernel is what controls the hardware and is what every Linux distro is built upon.

LILOLinux LOader. Similar to Grub, LILO is a boot loader for Linux. LILO usually writes to the Master Boot Record (MBR) on your device.

Linus Torvalds – The man who wrote the Linux kernel in 1991.

Man – Short for manual. If someone says “read the man page” or “rtfm” when you ask a question about a command, they want you to type “man command”.

Root – The superuser account on all Linux systems.

RPM – A package manager, which can be used to build, install, query, verify, update, and erase individual software packages. RPM is used by default on the Red Hat and Fedora distributions.

Sudo – Stands for Super User DO, allows a user to have root access without logging in as root.

Tux – The Linux Penguin

YAST – Stands for Yet Another Setup Tool.  Typically used on the SuSE distro.  Yast is a setup and configuration tool.

YUM - An automated update program which can be used for maintaining systems using rpmYum is also used on Red Hat and Fedora by default.

X / X11- Also known as the X  Window System, X is a windowing system that provides the standard toolkit and protocol with which to build Graphical User Interfaces(GUIs).  KDE and GNOME are built upon X11.

Can you think of any other vocabulary words for Linux newbies that should be on this list?  Please, share your ideas in the comments below.



Alternatives to Mom & Dad’s Windows Applications

Below are a few alternatives to some common Windows applications that Mom and Dad may frequently use. For a more detailed list, see Alternatives to Windows Programs, Open Source Alternative, and The Linux Alternative Project.

Windows: Internet Explorer
Linux: Mozilla Firefox

Windows: MS Outlook
Linux: Mozilla Thunderbird or Evolution

Windows: Solitaire
Linux: AisleRiot Solitaire

Windows: ITunes
Linux: Banshee or Amarok

Windows: MS Word
Linux: OpenOffice.org

What do you need to do?

Step 1. Head over to the Ubunutu download site and download the latest Ubuntu Desktop ISO image.

Step 2. Burn the ISO image to a CD-R.

Step 3. Bring the CD-R to your parents house.

Step 4. Back up any necessary files on your parents computer.

Step 5. Place the CD-R in your parents CD-ROM drive.

Step 6. Reboot the computer.

Step 7. Install Ubuntu by following on screen instructions.

Step 8. Reboot after installation is complete.

Step 9. Enjoy the fact that your parents will stop bugging you to fix their computer. Instead you’ll get calls from mom asking Linux questions – isn’t that awesome?



It’s no secret that tech-savvy computer users typically become the go-to guy for all technical help in their circles. More specifically, Mom and Dad tend to always ask us for help with their computers. If you’re tired of the phone calls from Mom and Dad complaining on how sloooww their computer has become, how fast it used to be, how many pop-ups there are, etc., spending hours upon hours fixing and repairing, re-installing and scanning, then this post should convince you with 5 reasons why your parents should use Linux.

  1. Security
  2. The most obvious and important reason your parents should run Linux is the security the Linux operating system provides. While many of us tech-savvy computer users have little to no problems surfing the web and staying connected 24/7 without running into viruses and spyware, it’s almost inevitable for a non-savvy Internet user [read: majority of moms and dads] to stumble across a virus or malware on a website or in an e-mail. Linux is well known for the safety and security of browsing the web without the worry of the popular viruses that plague a good portion of the Internet. The main reason being that virus and malware developers stick to Windows due to its popularity and worldwide reach.

  3. Cost
  4. Why should your parents have to pay money for an operating system and additional applications when there are hundreds of Linux alternatives that can do the same things they probably need for absolutely free? The GNU General Public License (GPL) gives users the freedom to change and share free software. This is where GNU/Linux derives from. Mom and Dad shouldn’t have to fork out upwards of $300 just for the basics of an OS. Linux is free and widely available, it should be a no-brainer.

  5. Hardware
  6. One great aspect of Linux is that it works well with old hardware. Many times I’ll find that a lot of my friends parents have older model computers. They are brainwashed into thinking that in order to get off Windows 98, or Windows ME, they need to upgrade their whole system so they can install Vista. Linux works great on old machines – don’t even think about installing Vista on your Moms old 386, it just won’t work.

  7. Administration
  8. Administration of a Linux machine involves little to no work. If you chose to install Ubuntu Linux on your parents computer, they most administration they would have to do is click yes to install the updates when the Update Manager prompts them to. As an additional plus, for us savvy Linux users, if we needed to, we can open up SSH with a port forward and log into our parents computers remotely if needed. Additionally, I’ve had Linux computers that have literally sat turned on for years in a closet with very minimal administration. Linux just works.

  9. Dell
  10. You no longer can use the excuse that when you install Linux on your parents computer, it doesn’t work “out of the box”. With the semi-recent Dell and Canonical partnership you now have an option of buying a computer or laptop that comes pre-installed with Ubuntu Linux.



et cetera