Tuesday, January 27, 2009

Creating Web Page favicon.ico for IE5 or higher.

Some web pages in IE5 or higher and newer versions of firefox have a little icon next to the address or URL of the page. These little icons are called favicons and are placed at the root of your web server where the index file is. The file is called favicon.ico

The icon you create has to be exactly 16 pixels by 16 pixels. There are some alternative larger sizes, but only use these if you've investigated favicon use very thoroughly. The safest route is definitely 16x16. Try to fool the browser with a larger or smaller size and it will usually ignore you. You should also stick with the 16 Windows colors. Again, more colors can be used in sophisticated icons, but 16 is your safest bet.

Use whatever graphics program you desire, some more complex ones will be able to save it directly as an .ico file but if yours does not you can convert your newly created bmp or gif using a program called IRFANVIEW. If your not a fan of installing software you can use this online converter found HERE!

Keep in mind, not all web hosts support .ico files and so if their web server does not serve the file it will not show up no matter how many times you click your heels together and say... "There's no place like my home page, There's no place like my home page..." Well you get the idea...

Good luck!

Saturday, January 24, 2009

Can Linux keep up with Windows 7?

I don't know enough about Windows 7 to comment directly on it's features but if history has anything to say about it it will be riddled with bugs and not easily accepted even within it's own fan base. All things aside, I will give it the benefit of the doubt. Up to this point I have heard good things from the Geeks community and I've also heard some bad things. The windows market share is falling fast as far as desktops are concerned. Enough of a fall in fact that I think the giant that is Microsoft must be at least clenching it's fists and having developer meetings whenever possible. A fly on the wall might hear opening statements similar to "Ok, now everybody stay calm..."

Just like a shiny new vehicle rolling off the production line for the first time, Windows 7 has it's first time appeal. The bug eyed consumer waiting for a product that is more stable and secure than before, but what will they really get? Will it just be Vista with a new paint job and some duct tape to hold the tail pipe up? I hope not.

There are a few Linux desktops that are just too good to ignore. Ubuntu, OpenSUSE, Fedora. Compatibility was always the first question native windows users would ask when a linux geek said "Hey, you should try Linux". The standard answer was always "Yeah, but can it run my windows programs?". Systems such as WINE and my personal favorite, VIRTUALBOX both allow for an easy transition to linux leaving access to the stuff that just hasn't been ported over or won't be. Linux performance is increasing, hardware support getting better and of course Linux is still more secure and stable than any version of windows to date.

If your a gamer... Well progress is always being made but is still rather messy, most serious game developers are including linux in their designs but we are not yet seeing true cross platform simplicity...

I'm not yet convinced that Windows 7 isn't just Vista with a new slip cover over it. Power shell or not I'll gladly take a good 'BASH'ing before submitting to a time and time again proven failure. Windows may be easier to install and perhaps even to use but it isn't my cup of tea. Not when I can do anything they can do at the best price available, FREE! And pardon me if the linux environment actually forces people to use their brain and think about how to run a computer. Instead of laying out some stupified options that don't conform to the users exact needs. At the age of 10 I asked a friend from the Computer Shop of Calgary how to approach the problem of understanding the computer. His response was so simple but true. "Stop trying to understand the computer and start teaching it how to understand you!"

That's all for now, back to gnome I go...
I GNU you'd understand!

Cheers!

Monday, January 12, 2009

Root access to your Linux PBX if you forget your password.

Regaining root access "on a PBX that YOU OWN!"

Warning: It is ILLEGAL to do this on a machine that you do not own, this is intended only for hardware that you own. It is intended for people who are running a PBX system where they have either forgotten the password or were not supplied with it by their former system administrator.

(If you own the hardware, you should you know the password but if you don't for some reason!)

This was tested on the free version of switchvox.

Step 1 - (Using the well known Single User Mode to get a root prompt with GRUB).

  • While booting into the PBX press 'e' as soon as the grub menu appears.
  • Using the arrow keys, choose the line with your kernel. It will look something like "/boot/vmlinuz-2.6.24-23-rt root=/dev/sda1 ro"
  • change the 'ro' to 'rw' then add ' single' to the and of the line. Then press 'enter'

The new line should look like "/boot/vmlinuz-2.6.24-23-rt root=/dev/sda1 rw single"

  • Make sure the kernel line you modified is highlighted and press 'b' to boot the new line.

**IMPORTANT NOTE - As soon as your system is booting and you see the "press I for interactive" press "I" a few times. Soon you should be greeted by a bash prompt. If you get asked for the root password when entering single user mode use 'init=/bin/bash' on the kernel append line which should boot the machine into a bash console where you can get read/write access.

Step 2 - (You should be at your single user bash prompt with # next to the cursor)

  • Try the command 'passwd' If simply using 'passwd' to change root doesn't work and you get an error then you will have to keep reading. If passwd successfully changed the root password then reboot and enjoy your new PBX system.
  • (Assuming passwd did not work) - type 'adduser newuser' and set the password to newuser.
  • Now CD into /etc and edit the passwd file or shadow file if you have one with 'vi /etc/passwd' or 'vi /etc/shadow' if you have a shadow file, that is where the encrypted password is kept.
  • The newuser you created will have a line in /etc/shadow that looks like this;

newuser:$1$GTayGdXe$Nz/jvMC7SImVQCfMuPG.m1:14257:0:99999:7:::

Now just copy the string that exists between the first set of colons in your newuser and put it where the * or string is on the root line. Here are some examples.

Old root string - "root:*:14095:0:99999:7:::"

New root string - "root:$1$GTayGdXe$Nz/jvMC7SImVQCfMuPG.m1:14095:0:99999:7:::"

(Now Save the file)

Step 3 - Reboot the system and log in as root with the password you set for newuser.

That should work just dandy, you can now access your PBX using root!

Special thanks to Douglas for helping me understand how the passwd & shadow file work.

Cheers!

Sunday, January 4, 2009

When setting up a fresh linux distribution it is often easier to just set up an entire hard drive as root partition. That root partition is represented as / in unix like operating systems including linux. The various directories exist usually within root, or /

The / directory or root directory is not to be confused with the root account. The root user's home directory or workspace is actually located at /root

Some other common directories that make up the basic linux directory structure are;

/boot (This is where the boot information is stored, as the name suggests)

/etc (Most programs including system programs keep their configuration files here, some of which can be hand edited with a program called VI, or VIM.)

Within /etc there are a few vital files that linux needs, those are /etc/inittab which is much like autoexec.bat or system.ini in dos/windows environments. It describes what processes are started at boot time.
and of course the all important /etc/fstab which contains information about various file systems for automounting at boot time. If this file did not exist you would have to mount file systems manually.

/bin and /usr/bin are more or less the same idea, they hold the executables such as 'ls' and 'cp' and 'mv' these executables are called from their path to do the various things that one would like to do when in a shell environment. These programs are often called upon by sub routines in programs to pipe or bring information to the program as variables that can be used for data manipulation. It really doesn't make a difference which of these to executable paths you choose to put your programs. When you type a command at the BASH prompt, BASH looks in both of these directories to see if the program exists.

/usr is kind of reserved for applications and their components, the source code, pictures, documentations etc. Even configuration files can be kept here although usually that kind of thing goes in /etc as described earlier.

/usr/doc is self explanitory, if it's not then you really should take up a nother hobby... :)
/usr/share contains config files, photos and other components that may be accessed by all users of the system.

/usr/src usually contains the source code for programs that you install.

/usr/include contains header files for use with C programs at compile time. Most C programs rely on these header files to build programs while you install them on your particular system.

/lib (contains libraries for programs, they can be dynamically linked just like DLL programs are in windows.)

/home (This is where all your users data will be stored. Whenever I format a new hard drive I always put this on it's own partition.)
So you will have a / partition for all the previously mentioned directories, and then you will have a /home that my look something like;

/home/user1
/home/user2
/home/user3 etc...

/var is an important place where files that change on a regular basis are stored. Such as log files etc.

/var/mail obviously for keeping in/outgoing mail for users.

/tmp writable by most programs and users, programs keep temporary files here while they are being executed.

/dev (Here is where all the hardware on your system is stored. The information about how your system can use the hardware is contained in the files.)

/mnt (This directory is for physical devices usually removables like floppy drives, cdrom drives and or usb mass storage devices.) On some more recent systems this is also stored in /media


/proc (This isn't really a directory it contains some information about the kernel and contains a bunch of numbers, each one associated with a process or running task on your system.

/lost+found (When your system crash's, files that were open and not yet properly written to the hard drive are kept here. This way you can restore files that may otherwise not be recoverable when the system powers down.

I know it's not an exhaustive list, but hopefully this gave you some sense of how the linux directory structure is layed out. People often ask me about this and at first it can be a bit confusing...

Cheers!

Friday, January 2, 2009

Chris Pirillo singing...

If your a true geek, then you already know who Chris Pirillo is. On new years eve while hangin' with the good geeks at live.pirillo.com Chris was accepting donations for the IRC network they use. In return he would do some crazy things for us all. So as my request I asked Chris to sing "King of Spain" by Moxy Fruvous. A Canadian singer from Toronto.

And here is what that request looked like :)



Find more videos like this on Geeks!

Thursday, January 1, 2009

Adding a cdrom source to /etc/apt/sources.list

Just a quick response to someone needing help with apt sources. This particular person is using ubuntu 5.04 server edition and since the repos are not maintained anymore he needs to install some packages from the cdrom itself.

To do this is quite simple. First if you don't want to modify your /etc/apt/sources.list the move it with the following command to a backup.

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

Simply make sure the cd you want to add is in the drive then simply execute;

sudo apt-cdrom add

A few moments later the packages on the cdrom will be cataloged and accessable to apt.

Hope that helps!

Sendmail MTA Outbound Mail Problem.

One of the most used mail transport agents, the one that basically built the early years of the Internet was Sendmail. Simple, and Rock solid this has worked for many many years but now It's software that is showing it's age. With the increasing problem of spam default servers like this one are being forced to take a safe approach. In Sendmail's case, a default install on Ubuntu for example is set not to allow external mailing. This is a good idea in a world where a default unsecure setup can leave a person with a serious problem when some script kiddie from another land uses your computer to mass email thousands of people. Quickly your ISP will spot you and you will end up with a blacklisted IP and no internet service at all.

I am not going to elaborate on the securing of sendmail, I would just hope that you would seek out the answers to that yourself. But I do know that to get a mail server up and running quickly you need to be able to get mail flowing out of the lan and into the wan...

Since sendmail is by default configured to accept connection from local system (127.0.0.1). Which would avoid open mail relay problem.

To allow connections from ALL hosts/LAN IPs open sendmail.mc file (login as the root):

# vi /etc/mail/sendmail.mc

Look for line that read as follows:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Comment or remove above line and insert new line that read as follows:

DAEMON_OPTIONS(`Port=smtp,Name=MTA')dnl

Above line will force to accept connection from any host. Save the file. Regenerate sendmail configuration file using m4:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Restart sendmail service :

# /etc/init.d/sendmail restart

"That's IT!" Yup, you've been struggling for days with this problem but it's really very simple when you know where to look eh?
I hope you found it useful...