Posts

Showing posts from June, 2012

How To: Update Your Ubuntu GNU/Linux sources.list the Geeky Way

Image
Here's my geeky tip for updating your /etc/apt/sources.list on Ubuntu GNU/Linux.

This tip is especially useful around April/October when the new Ubuntu releases are freed into the wild and the main servers are very busy.

I know what you're saying: This can easily be done from the  Ubuntu Software Center via the edit > sources menu. Yes, this is true, but now that's not a very geeky (or terminal-fast) thing to do, now is it? Besides, I like it better when I can initiate the sources update myself with sudo apt-get update, vs. having the software centre do it on exit.

To change your sources.list package server setting from the command line.

1.) Open the Terminal. Simply hit CTRL+ALT+T.

2.) Run this command to update your sources.list file:
sudo sed -i.backup 's/us.archive.ubuntu.com/mirror.anl.gov/g' /etc/apt/sources.list
3.) Run this command to see if your change took effect (you should see mirror.pnl.gov instead of us.archive.ubuntu.com on update).

sudo apt-get u…

How To Use xargs To grep (or rm) a Million Files

Image
Sometimes even when a tidbit of technology one is studying is already very well documented, one still seeks to test it out for oneself to get a solid sense of the true behaviour of the subject. Plus, if you're like me, writing about a particular subject has the added benefit of committing it to memory.

And so it is for the reason of teaching myself that I document these already well-known points about grep and xargs.

Of course, as a side-effect, if another out there ends up learning from my writings too, that would be perfectly fabulous in my eyes as well.

Basically, the question in my mind is this: How do I successfully grep(search) for something in a directory that contains hundreds of thousands, or perhaps more individual files?

To illustrate an example: Using the grep command by itself to search through hundreds of thousands of files provides the following result on my Ubuntu 12.04 GNU/Linux system. The below directory contains 200,000 files.

$ grep 'rubies' * bash: /b…

Ubuntu 12.04 GNU/Linux + HP 8100 or Ricoh Aficio MP 3500 = Printing Success

Image
Here's a quick write-up on my real-life experience with adding the HP LaserJet and Ricoh Aficio MP 3500 as printers in Ubuntu GNU/Linux.

I chose to make a note of this simple task because I was tripped up by it at first. The problem? The default setting caused nothing but garbage at the printer. After some simple trial and error, I figured out that I needed to switch the driver settings as noted below.

Ricoh Aficio 3500 Driver:
Ricoh Aficio MP 3500 PXL

HP Laserjet 8000 series Driver:
HP Laser Jet 8000 Series pcl3, hpcups 3.12.x

Adding a printer in Ubuntu GNU/Linux 12.04 is really easy, simply follow these steps:
 Click the Power icon > Printers > Add + Expand the Network Printer section > click AppSocket/HP jetDirectEnter the hostname|IP Address for the printer, Click Forward (and pause as the system will attempt to detect the printer)Select the printer from database(or leave as detected) > click ForwardIf not given the selection to select the specific driver, accept …