Adding Color to Bash List Command Part II

I previously blogged about how to add color to the ‘ls’ command utilizing an config file and alias.  I then stumbled across a nugget of wisdom from a Foresight Linux user on the developers mailing list who gave a handy command that remedies some problems with missing color in a terminal.

On some distributions, the system-wide /etc/DIR_COLORS* files are removed or not present.  This results in no colors being given inside of a terminal when looking for color directories and filenames.  If you find yourself in this boat, try the following command to re-populate this setting:

devnet-> cd ~/
devnet-> dircolors -p >.dircolors

This should create a default profile for colors for your session if it hasn’t been done or was accidentally removed.  For more information on the dircolors command try ‘man dircolors’.  Please also note that dircolors command uses the environmental variable LS_COLORS to set your session.

For more information on LS_COLORS and how it pertains to the terminal/shell/cli/prompt, there are a few blog posts that do an excellent job explaining here, here and here.

Adding Color to Bash List Command

One of the things I love is being able to enter into a directory via terminal, list the contents, and quickly see which ones are executable or not and which ones are directories or are not directories IN COLOR (not everyone is perfect right?).  This is specifically handy as I move through working with Slackware based distributions like the one I’m using now, Zenwalk Linux 6 and the /etc/rc.d/ directory.  Most of the Red Hat based distributions out there that I’ve used have this set automatically…so I’m used to it.  When I opened up a terminal in Zenwalk I found no color. A quick investigation of ~/.bashrc showed me that there are aliases set to display color…instead of ls I’d just use the letter L; 2 l’s for another option, 3 for another.  It’s interesting, but not normally how I do business.  See bashrc below:

devnet[~]$ cat ~/.bashrc
alias lll="ls -al --color"
alias ll="ls -l --color"
alias l='ls --color'<br />alias search='find . -name'
alias aterm="aterm -fg white -tr"
alias version='cat /etc/zenwalk-version'
alias dh='df -h'<br />export PS1='\u[\W]\$ '
export PAGER="most"<br />devnet[~]$

I don’t use those aliases much…others of you might do the ‘ll’ or ‘lll’ but it’s just not part of my routine.  So, I added in just after line 4 in the code above:

alias ls='ls --color'

You can do this a few different ways…with any command line editor like emacs, vi, or nano/pico. It’s really up to you. The easiest way for new users is to use a text editor:

devnet[~]$ mousepad ~/.bashrc

This will launch the mousepad text editor in XFCE. If you’re in Gnome, try gedit. If KDE, give kwrite a try. You should see something like the following window pop up for editing:

bashrcYou should see in the picture above, I’ve added in the alias needed to make me comfortable.  After that, File >> Save.  You’re set!  Except, you may notice that when you type the command ‘ls’ there are no colors.  So what gives?  Well, we haven’t loaded our ./bashrc since we changed it.  You don’t have to logout and back in to get things to work though…you can do this right from the terminal:

devnet[~]$ exec bash

Now try giving the ‘ls’ command a try again and you should see that it is in color.  I know a lot of the more advanced Linux guys out there are probably saying, “why’d he waste a post on this!  It’s easy” and you’d be right for a majority of users out there…I hope that this post finds some new user out there that may be stuck for an answer on how to do this.  One final note on this as well: You will have to do this as the root user and change /root/.bashrc in order for your root user to also have color.  Thanks for reading!

Laptop Multimedia Keys and PCLinuxOS 2009

I installed PCLinuxOS 2009 recently on a Dell D630 Latitude and was disappointed to see that I couldn’t get the hardware volume (up/down/mute) buttons didn’t work out of the box.  I thought a bit about kmilo, a program that was previously used for laptop buttons (thinkpad buttons though) and I searched around a bit inside the KDE Control Center for keyboard shortcuts to see if I could assign the keys manually.  However, I couldn’t find any volume setting inside this menu.

Then, it hit me, I had remembered seeing volume settings before…inside kmix; there is an area for assigning global shortcuts for volume and mute!  This should work for anyone running KDE 3.5.8 and above (I think).  Left click on Kmix in your tray and choose the mixer button.  From there, choose Settings >> Configure Global Shortcuts.  Now assign the volume up, down, and mute keys manually by clicking in the blank and pressing the hardware button.  This should work for a majority of people out there.  For me though, this didn’t work.  When pressing the keys, nothing happened.  I thought I was doomed.

I researched a bit more and found that installing a program called keytouch would allow me to, at the very least, program my keyboard in any way I wanted to program it.  I opened Synaptic and installed keytouch and keytouch-editor.  After install, I went to Kmenu >> System >> Configuration >> Hardware >> Keytouch.  It prompted me to choose my keyboard.  Since it didn’t have the Dell D630, I chose the closest thing which was the Dell D800.  I closed the application and now the volume buttons and mute button works!  Keytouch also has the ability to manually edit and also to import keytouch ‘schemas’ to give maximum flexibility.  Hopefully, this helps some of you out there that cannot get your multimedia keys working in PCLinuxOS and KDE to work!

Host Your Own Domain and Webserver


This article is from 2006!  The information here may not be the most current.  You can visit an updated version here!

Doesn’t sound like anything new right?  Well, some people may not know of this method.

Normally, to host your own webpage you would need to spend around 7 bucks to purchase a domain.  Next you would need a hosting plan that usually runs around 3-15 dollars per month to serve up your web pages.

What most don’t realize is that you can skip these steps all together…you don’t need to get dedicated Windows or Linux Hosting (this blog is hosted on dedicated hosting…but started out in my apartment!) to serve pages up to your friends and family.  You absolutely do not need to get domain name services through a provider.  You can even host your own webserver using a dialup connection (that’s right…I said dialup) although. I don’t recommend it (but I’ve done it using 56.6kbps).

Why would you want to do this?  My reply…to stay connected to friends and family…perhaps throw up a gallery so that your grandparents can see pics of your new dog/car/tinfoil hat.  Sure, you could waste my time with MyWaste..er..space and be barraged daily by advertisers and solicitors…or you could roll your own web host, install a gallery or website, and provide media to your friends and family without costing yourself a dime.  That’s right, NO COST (except time spent getting it running).  Just remember, your website might not survive a digging or slashdotting if you run it yourself.  Keep that in mind :)  So without more chatter, let’s get to the meat and potatoes of things:

Do you cringe at the thought of buying a domain and putting up with the headache of trying to make sure your IP address is up to date with your domain?  Do you hate the 40 dollars you spend on DNS service each year to resolve your IP address to your hostname?  Read on and learn the the flat-broke-and-busted way of maintaining a fixed hostname for your IP…even if you have dialup.

I’ll divide this up into 2 sections.  The first will deal with Linux.  The second, Windows.  This is only something that I’ve found easy to do and the price is just right (it’s free).  The only thing that I recommend is a dedicated internet connection (cable, DSL) but even this is not necessary as dialup can be used.  I recommend that you use the Linux way of doing things since it is more secure and doesn’t require a restart every time you patch it.

*note: I’m assuming that you aren’t behind a firewall/proxy of any kind and that your ISP doesn’t block port 80 traffic.  If your ISP blocks port 80, see the appendix at the end of this article.

LINUX

No matter what version of Linux you run, chances are that you’ll be able to install the apache webserver.  This is good news as over half the websites of the world are run by the extremely efficient and speedy apache. I’m not going to address the specifics of how to set up your website…only how to get it a fixed address without buying a domain.  So, you have your pages dropped into your webservers public directory…good.  Now, how to resolve your IP…lets say it is…25.24.4.166 (for our example) and you want it to have a host.name.com to bind to.  Easy to resolve.  Go to http://www.no-ip.com/index.php and sign up.  You can get a site from noip that is like yourname.theirdomain.com/.net/.info.  They have cool names like sytes.net and servebeer.org…even workisboring.com

You’ll be able to choose your own top level name…for instance, Ithink.dnsiskinky.com could be your new domain name.  Next download a client from the download tab: https://www.no-ip.com/downloads.php

The linux client is a tar.gz source and is simple to install. Follow the instructions when installing.  You may have to install compilation tools (devel packages like GCC) to install the client.  You now are the proud owner of yoursite.theirsite.com and your IP will ALWAYS update (as long as noip.com is up) each time you log on/sign on/beam up or whatever it is you do.

How does this help you?  Well, if you’re like me, you have a dynamic IP address.  If you connect to the internet via cable, dialup, or dsl…you also have a dynamic IP address.  Dynamic means that it will change from time to time without warning.  So by binding yoursite.theirsite.com to your IP address…you don’t ever have to worry about what IP address you have anymore.  Instead, you’ll always be able to connect using yoursite.theirsite.com.  You can host a webserver using Apache and a virtual host (also known as a Virtual Private server or VPS Hosting) in this style as well (look for another how-to on this subject later) so that everyone can visit a shiny website at yoursite.theirsite.com.

Read more

Customizing PCLinuxOS 2008 Minime

Putting it Together

Build Your Own PCLOS

So, HowtoForge has a perfect desktop for PCLinuxOS 2007…how about something similar for 2008 MiniMe? I won’t go into near as much detail as they do there but I’ll go over how I get my desktop up and rolling after a fresh install of PCLinuxOS Minime 2008.

MiniMe is the lesser known offspring of PCLinuxOS 2007 that ships with a 2.6.22.15 kernel and is a minimalistic installation of the KDE desktop 3.5.9. Texstar provides this distribution for those wanting to remaster their installations…it’s a base for other remastered projects like PCLinuxOS Gnome. Remastering and the Make LiveCD wizard enable users to customize their distribution and make a bootable backup CD with all their customizations OR release their own customized distribution. You can also use the Make LiveUSB wizard to create your very own thumbdrive PCLinuxOS.

I found it strange that no one had written anything about MimiMe-to on getting PCLinuxOS 2008 MiniMe up and running as a desktop replacement so I decided to give it a go. The aim of this article isn’t to copy Howtoforge’s great series on perfect installations…but to show how I get PCLinuxOS 2008 Minime up to a perfect installation for me. This means all web video, audio, fonts, and tools I need are installed. So let’s get at it.

What Do We Need?

First and foremost, do a complete upgrade of your fresh installed system. Open Synaptic >> Reload >> Mark all Upgrades >> Apply. It’s going to take a while to get all the updates you’ll need. Do NOT enable the testing repository until after you install your graphics driver at the end of this article…just perform a straight update from main.

Now let’s start installing stuff that is needed on a daily basis. I’m more of a lightweight type of guy so I don’t need robust office applications so my tastes may not line up with yours. Please substitute applications where you see fit…the repositories most likely have them.

To give a brief, high level overview of my daily use applications:

  • firefox3
  • Opera
  • K3B
  • konversation
  • pidgin
  • skype_static
  • koffice
  • gimp
  • Amarok
  • claws-mail
  • kdeaddons-kate
  • kdeaddons-ark
  • kdegraphics-ksnapshot (for taking screenshots)

Those are the high level applications I use on a daily basis to get things done. Whenever you are prompted to mark other packages for install, go ahead and and choose “mark”. Click apply and let the your daily use applications install.

Read more

KDE: Right Click, Extract Here

I’ve been hunting for a post on how to have KDE “extract here” like Foresight Gnome edition does (it’s really handy to one click extract archives). Post after post found via Google did nothing at all to help me out. Most tried to have you read how to do this manually by creating your own service menu and they would use xterm to extract. I wanted to use ark…mainly because it’s there and it’s a gui.

Then I decided to search KDE-Apps.org and viola! I found it. A handy little tool that allows you to right click on any archive and “extract here” with Ark. Here’s how to install it.

Read more