Wednesday, November 26, 2008

Terminal Commands (Introduction) Part 1

Introduction to *nix Commands

ls [folder] - lists the content of current folder unless another folder is passed as an argument

cd [folder] - changes directory to supplied folder. Other arguments can be "~" (home folder of user running command) and ".." (move up one directory), both these must be entered without the quotes.

man [command] - will display the manual page for any command supplied that offers manual pages. Will offer in-depth explanation of every flag and argument possible with the supplied command.

rm [flags] [directory or filename] - Commonly used to delete files or folders. To delete a non-empty folder the -r (recursive) flag must be supplied.

su [username] - switches user to supplied username. If no username is supplied it will default to root.

sudo [command] - runs the supplied command as super user (sudo = super user do). This will require a password for an admin account, however, it will cache (store) the password for a short time after the first use. This cached password will not be available anywhere but the original terminal shell in which it was first supplied.

locate [term] - is used to locate files that contain the term supplied. Requires "sudo updatedb" to be run to update the locate database.

grep [term] - program that will search supplied input for term supplied (is often used with piped [see below for explanation] input)

cp [flag] [file] [destination] - copies specified file to destination (or directory if the -R (recursive) flag is supplied)

ln -s [original location] [symbolic link] - creates a symbolic link (such as a shortcut in windows) to files, folders, or programs.

echo [content] - used to echo content (enclosed within quotation marks) to the screen, can be diverted to a file using the ">>" characters and then the path to the file, including the file name. (e.g. echo "test123">>Desktop/test123.txt)

cat [filename] - used to output the content of the file to the terminal (again, can be diverted to a file or to the grep command using aforementioned methods).

mkdir [directory name] - Creates a new directory in the current folder, unless a full file path is supplied for the new directory.

pwd - Is a command that prints the working directory (e.g. if you run it in /home/username/ it will return /home/username/)

Programs are usually installed to either /bin/ or /usr/bin, and almost all programs offer manpages, allowing you to use any program you need to just by knowing ls and man. These commands should exist in all *nix environments (mac, linux, unix), however, there may be slight alterations to how they must be entered.

1. A pipe is the character "|" and is used to divert output of a previous command into yet another command (e.g. 'ls|grep "home"')

Tuesday, November 25, 2008

There is life out there...

Hey to anyone who's still reading this blog,

I haven't been posting much lately because I've been busy with school and personal issues, but I have decided to start a series on terminal commands, useful hints, advanced terminal uses, etc. Anyone is free to comment on this post and offer ideas of terminal uses they think should be covered, or any thing they would like to learn/want to see if it is possible.

I have one PDF written up of basic terminal commands (general starter guide really) and will post it into a new article on this blog in the next few days. Any suggestions for guides can be expressed in comments on this article (I would prefer the guide's comments stay on-topic).

Thanks in advance to anyone still reading,

Sunday, August 31, 2008

More Wallpapers

Well, I was slightly busy over the summer, customizing an openbox and other such things. In the process I designed 3 more wallpapers (yes, I know I only uploaded two, one of them I intend to keep for myself).

Lone Warrior:

Wise Dragon:

P.S. I know the titles suck, I can't help it :P and as always, these are published under the creative commons BY license

Sunday, August 17, 2008

New Monitor (22")

Bought myself an Asus X223W 22" Monitor the other day, and it's great! Clean, crisp picture, DVI connection, and a 2500:1 contrast rate (not the highest, but it's great for what I use it for).

Here are some pics (of the monitor and of the PC setup):

I apologize for the bad quality pic in the dark, but it seems turning off the flash on my camera creates a delay between pressing the button and the camera taking the picture, which is hard to keep steady during that time. Did the best I could folks! :P

Also, I'm in the process of writing myself a website for Linux-oriented content such as videos, downloads (useful tools, wallpapers, themes, videos, etc.), my blog, and whatever else I can think of. Depending on how it turns out I may find a host for it and migrate this over to the new site. If that happens I'll be sure to write a blog entry here. It's hard to judge if this is necessary, as I'm not sure how many people actually read this blog. Lol, oh well.

Have a good summer everyone, mine's nearly over.

Sunday, August 3, 2008

Summer Update

I realize I haven't posted anything new for a while on here. The reason is that I've been on vacation (and still am) in Canada, where the fastest 'net speed I have regular access to is 28,8K, in other words, too slow for intense usage (especially because it's pretty expensive too). However, I have been working on some videos which I'll probably upload to youtube and link to in a blog post for others to view (one is for installing Arch and the basic config - without sound, and I'm working on another which shows how to install xorg, alsa, etc. and configure it properly - it will have sound when it's done).

I will be going back home in about a week, then I'll need to finish some school work, so it may be a few weeks before I get around to uploading the videos.

Have a great summer everyone,

Friday, June 27, 2008

New PC arrived & Built!

Okay, well today the case for the PC (finally) arrived. Shortly after I had a lunch it was built (~1 hour spent on building it), and an hour or two after that XP was installed and fully updated on a 391GB partition (the rest is for Linux when I install it tomorrow). Everything works great, the only slight issue I had was that the PSU had a loose cable that slipped down when the PSU (which had to be attached upside down inside the case) was on, so that there was a clicking noise as the fan hit the cable. I took a pair of tweezers (do NOT try this at home without having unplugged your PSU and let it sit so any excess charge is gone!) and gently stuck the wire under the heatsink within the PSU so that it didn't fall into the fan anymore. Everything is great, except the 80mm fan on the case wall is a little loud, but I'll see if I can't manage it somehow.

Pictures (I'll upload some more later, at a better angle and after I fix up the cable mess):

Thursday, June 19, 2008

New PC has been ordered!!!

Okay, well I just ordered my new powerhouse PC, and I'll be building it together myself, and probably dual-booting Arch and XP (since I do intend to play some games on it :P). Parts:

Case: ATX RaidMax Ninja 918 (no PSU) in black
CPU: Intel Core 2 Duo 2.33GHz 1333MHz FSB S775 4MB 65nm
RAM: 2x1024MB OCZ DDR2 800MHz CL4 EL Rev 2.0 platinum XTC
Graphics Card: 512MB Gigabyte Geforce 8600 PCIe DDR2 128bit 2xDVI TVOut HDCP
Motherboard: Asus P5KPL S775 iG31 FSB 1066MHz PCIe ATX
HDD: 500GB Seagate Barracuda 7200RPM SATA II 16MB cache
DVD drive: Samsung SH-S203D/BEBE SATA black without bulk software
PSU: ATX Xilence Power 500W ATX 2.0

And, of course, once this is built and running I will upload some pictures of it in action. (I'm ordering all this off, it's a German site, but offers good prices and no shipping on purchases of 100€ or more - not sure to where it ships, but since I'm in Germany, it made sense).

Sunday, June 15, 2008

Been Busy Customizing

Well, I had my first few exams on Friday, and so I had a bit more time to relax on the weekend. I spent that time, yup, you guessed it, playing with my ArchLinux install. I decided E17** just wasn't right for me, and went back to good ol' GNOME, and spent the next few hours changing icon themes, GTK themes, small tweaks, etc. etc. This morning I wrote a terminal script (in bash) to print out my theme information, and found one on the archlinux forums too.

** My reasons for switching is that E17 just isn't stable enough for me, the file browser had a few issues, and I couldn't get e_systray working right, so that it made it trickier when I accidentally closed skype, I'd have to kill it using htop or the kill command, which is a bit of a pain. It's a nice WM, and undoubtedly will be great when finally released, just the lack of updates and the instability it brings with it just made it too much of a hastle for me.

The Screenshots:

The terminal on the right has my script, and the left terminal has the script from the archlinux forums. Last screenshot is of my urxvt terminal, and the left two have the .Xdefaults file displayed, which is the config file for the terminal, for those interested, and the right two again are showing the theme info. Ah, just saw that the last line of the file is cut off. It should be:

urxvt*bolditalicFont: xft:DejaVu Sans Mono:pixelsize=11:antialias=true:bold:italic:autohint=true:hinting=true

About the Blog:

I'm open to suggestions on how-tos or OSes/Software readers would like me to review. Either post these in a comment to this thread, or email them to me. Also, comments on any of my posts are useful for feedback, improvement and to give me a general sense of how many people have actually read these posts.


I plan on updating this blog at least once a week, unless I get swamped with work, or, as will happen in the summer, I'm off on vacation, then updates may be a bit slower coming.


Currently I'm still in the process of reviewing Arch (next review will be Ubuntu VS Arch) and I'm busy trying out the new Opera 9.5, so that may end up being reviewed too. As always, I'm open to suggestions.

Saturday, June 7, 2008

Arch Linux - The Third OS (Here To Stay)

An intro to Arch Linux:"Arch Linux defines simplicity as a lightweight base structure without unnecessary additions, modifications, or complications, that allows an individual user to shape the system according to their own needs. In short; an elegant, minimalist approach." (taken from their wiki). Essentially it installs a CLI (Command-Line Interface) and offers little pre-installed apart from core apps required for the system to run. The system is then built up by using pacman (arch's package manager, however, it is unlike yum or yast or apt-get/aptitude since it does not install from binary files like .deb or .rpm, instead it installed .pkg.tar.gz files, which are created using source packages and a PKGBUILD file), and by editing daemons and modules in your rc.conf file, and many other text-based configuration files are accessible. It is also a rolling release distro, which means that the ISOs on the server are updated periodically with updated packages.

Well, this week gave me a few extra hours on Wednesday evening, so I decided to give Arch Linux a try. Burned the ISO I'd used a few times in VirtualBox to a CD and booted to it. First surprise: it was trying to start the wireless network card, but was unable to (broadcom bcm4311 rev 2) and hung at that point until I tapped the power button, it then cancelled that and continued booting. This time I made it to the terminal, and was able to start the setup, and set up my Arch system with a (previously made) 9GB ext3 partition for /, my 20GB /home partition that Ubuntu also uses and the 1GB swap partition I also use in Ubuntu. Installation ran off without a hitch until I reached the package selection screen, where I missed out an important package, which led me to have to re-run the setup after it was complete and to add that one package to my system, however, all in all it was a pretty fast and painless setup, as long as you knew what to enter into the config files (or knew enough to get it to install properly and enable you to fix whatever problems you may have caused with faulty config files, like I did).

I had hooked up my laptop with an ethernet cable on the first boot, it was recognized and activated on boot (due to the fact that I set it up to use dhcp in my /etc/rc.conf file during installation) and began to update my system using
pacman -Su
from a root shell (no sudo available) and I also set up the user account I was planning to use (lswest) using the useradd command, and it automatically began using the /home/lswest folder as it should. After a quick reboot I began to configure my system, first by installing sudo, adding my lswest user to the group wheel and uncommenting the line in the sudoers file to gain sudo abilities, and began to install alsa, xorg, video drivers (Nvidia) and had trouble deciding which WM (Window Manager)/DE (Desktop Environment) to use. I did not want to use GNOME again (DE) or to begin using KDE (DE) and XFCE is just not what I was looking for (DE). Instead I looked at some simple WM interfaces, such as fluxbox/openbox. However, I then remembered Enlightenment 17 (still heavily under development) and decided I'd try it. It was easy to install just a simple
sudo pacman -S e17-cvs e17-extra-cvs
installed a nice default enlightenment 17 interface, and was easily configured into this:

Quick statistics on my desktop:
running e17-cvs (enlightenment 17 from cvs)
theme: night-bling
wallpaper: War of the Depths by Lswest (me) (available on gnome-looks and in the post before this one)
running apps: enlightenment configuration menu, pidgin, xmms.

Also, each of my 8 workspaces (virtual desktops) has a different one of my wallpapers, and I may decide to merge them into a slideshow later on, but so far I have not seen the need. There are a number of things you need to do in config files to set up your Arch system properly (my main problem was remembering what daemons to add to the rc.conf file, or which were modules and which were daemons). However, I now have working wireless (ndiswrapper + bcmwl5 drivers, just like in Ubuntu), wicd, amsn, pidgin, skype, 2.4, e17, firefox, xterm, etc. etc. On a side note: the guides on were very useful, particularly the Beginner's Guide while I was configuring my system, and helped me solve problems that I encountered (often because I had forgotten to add a module or daemon to rc.conf, or had added a module to the daemon array and vice-versa).

In conclusion I'm happy with the system I set up, only missing a notification area (I found one for e17, but it's buggy and does not display properly most of the time) or a window list to tell me when new messages arrive in a chat program (unless they're minimized, then they flash in the list in the shelf), but that may just be some configuration option I missed. Definitely going to keep it around, not sure if I'll completely replace Ubuntu with it yet, though I do enjoy how pacman installs programs from source and the whole package management system (along with the AUR) makes it very easy to install packages or apps that are in development (e17, for example, is a lot easier to install than the installation within Ubuntu or debian/red hat based Linux systems). Of course, the repo ([community]) that contains these apps are handled by members of the Arch community, and there are delays in uploads/updates, but definitely not worth mentioning.

Installation: 3/5 stars

(due to the required amount of knowledge when editing the configuration files during install and at the package selection screen)

Stability: 5/5 stars

(it's been up for a while and no segfaults or so that can be attributed to Arch Linux (there was one on Enlightenment's part, but that's not the focus of this review))

Usability: 4/5 stars

(Easy enough to use once you get over the first hurdles, requires you to be comfortable in a CLI though)

Performance: 4/5 stars

(It's fast, stable and fun to use, but there are a few issues that I've had with it slowing down and with battery usage, may be my fault though)

Overall: 16/20 The installation and required prior knowledge is a set back for users who are inexperienced for the OS, but overall it is a fairly stable and effective system.

Disclaimer: Any and all statements within this review are only my opinion and by no means should be taken as flaming, I readily admit that some of the things that bother me or caused it to get marked down may be my fault.

Sunday, June 1, 2008

Some of my Artwork

Well, I'm a GIMP fan, and I made quite a few wallpapers for myself using GIMP, so I'll post them here for anyone who's interested.

These are all under the Creative Commons BY license.

War of the Depths:

More Blue (imaginative, isn't it?):

Swirling of Hope:

Ebb and Flow of Life:

Simplistic Design (tutorial result):

Ghosts in the Machine:

Turbulence of the Soul:

War of the Depths - More Red:

Unspoken Mind:

Installing Bootloader How-to

I've noticed a lot of people asking about restoring Vista/XP bootloaders, and so I decided to write a how-to for this. Also, I will include a quick how-to on restoring GRUB as well.

For Vista:
Boot to your recovery cd/partition (if you don't have one, or lost yours, you can get a recovery CD from here note: the CD is ONLY recovery options, so no cheap way of getting Vista "This download is available to customers running genuine Microsoft Windows. Please click the Continue button to begin Windows validation. As described in our privacy statement, Microsoft will not use the information collected during validation to identify or contact you." part of the disclaimer for the multi-gigabyte download for the actual program used to create that disk. If you don't agree with it or don't have a genuine windows system, do not use this download.)
After booting to the CD, get to the Recovery Console (it differs for each recovery program, but generally is easily enough found). Once there type
bootrec /fixmbr
bootrec /fixboot
which will restore the Vista bootloader.

For XP:
boot to an XP CD (sorry, no links available :P) and, once the menu loads, hit "R" to enter a command prompt. Once there, choose which partition you want, and enter an admin password (if you have one set).
then type
and the XP bootloader should be restored.

For GRUB restore to MBR:
boot to the LiveCD (this is the easiest way IMHO) and then start a terminal (applications-->accessories-->terminal)and type:
sudo grub
find /boot/grub/stage1
root (hd?,?)
setup (hd?)

where the (hd?,?) and (hd?) corresponds to the output of find /boot/grub/stage1 (first time round the (hd?,?) stands for the drive (hd?) and the partition (,?) at which Ubuntu (or any Linux) is located, and then the second time round (hd?) just stands for the drive, for the MBR).
If you would like a more detailed explanation catlett did a good job with his how-to here and also offers troubleshooting ideas.

How to restore GRUB to a partition:
**DISCLAIMER** This is untested, as I haven't had time to do so yet, but it should work. Any feedback would be great, either by PM on UF or to have a reply posted here.
sudo grub
find /boot/grub/stage1
root (hd?,?)

setup (hd?,?)
(for an explanation of the above code, see the info on restoring GRUB to the MBR, apart from the code marked in bold).
There is only one small variation for this (marked in bold) but it's a significant one. That "?" marked in red should be the same one you used for your "root" command in the line above. It will then install GRUB to that partition.

Now, you may ask, why is this on a Linux blog? Well this is for those people who either decide Ubuntu (or Linux in general) isn't for them, and wish to get back to Vista or XP, or else for those people (like me) who have set up a triple boot system. To set up a triple boot, I found, it works best if you install the XP bootloader (for XP), then the Vista Bootloader (on top) and then lastly, the GRUB which then allows the booting of all 3 systems. The problem I ran into was that i had Vista and Ubuntu installed, so I installed XP, then GRUB, and realized XP bootloader files (which are in the Partition and called the ntldr files) could not boot Vista. I ended up removing Vista then, but that's another story.

Broadcom 4311 How-To (Ndiswrapper in Hardy)

This is a how-to I've come up with on installing a broadcom 4311 card rev 2 using the bcmwl5 drivers, ndiswrapper and a bootscript that enables it (as Hardy attempts to load the firmware from fwcutter first).
sudo apt-get install ndiswrapper-utils-1.9 ndiswrapper-common
download these drivers, bcmwl5 drivers, extract them to a folder then do this:
cd /path/to/drivers
sudo ndiswrapper -i bcmwl5.inf
sudo ndiswrapper -m

sudo modprobe -r b43

sudo modprobe -r ssb
sudo modprobe -r ndiswrapper
sudo modprobe ndiswrapper
and it should work. To get it working at every boot download this script (written by me) and copy the contents of the pastebin script into text editor and save it as, then follow the instructions below.
sudo cp /path to script/ /etc/init.d/
sudo chmod 755 /etc/init.d/

update-rc.d defaults

**Remember: change "/path to script/" to where you have the items saved**
***Installing via apt-get requires an internet connection, such as ethernet***
****each line is one command, so copy and paste it so 1 line is one command****

aliasing how-to

I came up with this solution of easily connecting to networks, and dispensed with a need for any network manager (well, for my home and school networks, otherwise I can just use the terminal to connect to new networks)

what I did:

opened .bashrc with
sudo nano ~/.bashrc
then at the end of the page I added the line:
alias [name of school]="sudo iwconfig essid [essid] key [key] && sudo dhclient wlan0"
so now all I have to do is enter either mis (name of my school) or "home" in the terminal, enter my password, and I connect to the network. I find it a lot more efficient and "fun" :P to do than connecting via the network manager.

also, on a side note:
I also added the line:
alias ls="ls -l --color=always --classify"
to .bashrc so that when I type "ls" it lists it in the long format, colour coded and with classifications. To make these system-wide aliases, add them to the file /etc/bashrc (requires reboot), or for the root user add these lines to /root/.bashrc

This is more one of those "fun to know" kinds of things.

*IMPORTANT* those commands require the quotes to be there, so add the alias lines with quotes around the command


Well, I'm a Linux fanatic and this is my blog. I'll be posting useful how-tos, interesting infos, stories, and reviews on Linux systems that I use/test. Hopefully I'll update it regularly, but I've got exams coming up, and I may not be able to.

A bit about me:
I'm 17 years old, born March 25th, 1991.
I live in Germany and am Canadian/German.
I'm in a relationship with a great girl, and so, that may also be a reason why my updates may be slow in coming :P
I've used Linux since 2003, so about 5 years.
During my time using Linux I've installed Ubuntu, among others, but I always seem to end up at Ubuntu again either due to hardware drivers or other reasons. Planning on installing Arch on my laptop after I finish playing with it in a VM (use VirtualBox for all my virtualization). Of course, the results of that will show up here (eventually). I also help out at UbuntuForums using the name "lswest", so feel free to look me up if you're there too.

Also, this is what my Ubuntu system currently looks like: