Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, July 12, 2010

Speeding up your Updates with Ubuntu and APT Cacher NG

If you are in a building with more than one computer running Ubuntu, you may have wondered why everyone has to download updates separately. The answer is, they don't. Here's how to accomplish it with a tool called apt-cacher-ng.

apt-cacher-ng is a fork of a project called apt-cacher, which in turn is an alternative to apt-proxy which is poorly maintained and upon my testing, was unreliable.

Setting up the APT Cacher Server

Begin by installing apt-cacher-ng from Synaptic Package Manager, or from the Terminal with the following command:

sudo apt-get install apt-cacher-ng

By default, the version of apt-cacher included with Ubuntu does not currently include security updates. We can easily add the security updates in, however, by following these steps:

As root, create a new file called /etc/apt-cacher-ng/ubuntu_security

sudo nano /etc/apt-cacher-ng/ubuntu-security

This file will be a list of mirrors from which the updates may be downloaded. We only want to insert a single line, the location of Ubuntu's official security updates server:

http://security.ubuntu.com/ubuntu

Save and close the file.

Next, edit the file /etc/apt-cacher-ng/acng.conf

sudo nano /etc/apt-cacher-ng/acng.conf

While we're here, you will see a couple of lines like this:

# Set to 9999 to emulate apt-proxy
Port:3142

I recommend that you follow the instructions and set the port to 9999 to emulate apt-proxy. Not only will this make your server compatible with systems expecting an apt-proxy server, but it will also make the port number easier for you to remember.

Next, look for this section:

# Repository remapping. See manual for details.
# In this example, backends file is generated during package installation.
Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian
Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu
Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol

We're going to add one more line at the end of this section to describe the Ubuntu Security repository that we are adding (make sure the following all goes on one line):

Remap-ubusec: file:ubuntu_security /ubuntu-security ; http://security.ubuntu.com/ubuntu

Now, save changes to this file and restart the apt-cacher-ng service.

sudo service apt-cacher-ng restart

If all went well, the server is now working. No you may proceed to setting up the clients. I strongly recommend making the server into a client of its own apt-cacher, as there is no reason for that system to download the updates from the Internet twice.

Setting up an APT Cacher Client

The basic idea of how to set up a client is to change all the lines in /etc/apt/sources.list to point at the local apt-cacher-ng server instead of at the internet servers. I recommend taking an additional step first so that you can easily flex between different servers. We will create a hostname alias called "apt-cacher" that points at your apt-cacher-ng server so you can simply re-point the hostname whenever you want to switch servers.

sudo nano /etc/hosts

We will add our own entry just after these two lines:

127.0.0.1 localhost
127.0.1.1 your-computer-name

If the apt-cacher-ng server is running on the same computer which you are setting up as a client, its IP address will be 127.0.0.1, otherwise, you need to find (or set) the static LAN IP address for your server. I will assume it is 192.168.1.10 in this example because that's what it is in our building here at CCC. The line you will add will look like this:

192.168.1.10 apt-cacher

Save and close the hosts file.

Now we will replace the entries in the sources.list to point at the cacher:

sudo nano /etc/apt/sources.list

The easiest way to handle this will be a search and replace.

First, replace every instance of "us.archive.ubuntu.com" with "apt-cacher:9999" (no quotes on either) If you are using nano, this is accomplished by pressing Ctrl+W, Ctrl+R, then entering the search string and pressing enter, then entering the string to replace it with, and pressing enter again, then when prompted, press "A" for all.

Next, replace every instance of "security.ubuntu.com/ubuntu" with "apt-cacher:9999/ubuntu-security" (no quotes on these, either.) If you are using nano, use the same steps as given above.

(In this example, we won't be handling the partner repository or any third party repositories which you might have installed.)

Save and close your sources.list. Your final sources.list if you are running Ubuntu 10.04 Lucid Lynx will look something like this:

# deb cdrom:[Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)]/ lucid main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://apt-cacher:9999/ubuntu/ lucid main restricted
deb-src http://apt-cacher:9999/ubuntu/ lucid main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://apt-cacher:9999/ubuntu/ lucid-updates main restricted
deb-src http://apt-cacher:9999/ubuntu/ lucid-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://apt-cacher:9999/ubuntu/ lucid universe
deb-src http://apt-cacher:9999/ubuntu/ lucid universe
deb http://apt-cacher:9999/ubuntu/ lucid-updates universe
deb-src http://apt-cacher:9999/ubuntu/ lucid-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://apt-cacher:9999/ubuntu/ lucid multiverse
deb-src http://apt-cacher:9999/ubuntu/ lucid multiverse
deb http://apt-cacher:9999/ubuntu/ lucid-updates multiverse
deb-src http://apt-cacher:9999/ubuntu/ lucid-updates multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu lucid partner
# deb-src http://archive.canonical.com/ubuntu lucid partner

deb http://apt-cacher:9999/ubuntu-security lucid-security main restricted
deb-src http://apt-cacher:9999/ubuntu-security lucid-security main restricted
deb http://apt-cacher:9999/ubuntu-security lucid-security universe
deb-src http://apt-cacher:9999/ubuntu-security lucid-security universe
deb http://apt-cacher:9999/ubuntu-security lucid-security multiverse
deb-src http://apt-cacher:9999/ubuntu-security lucid-security multiverse

After you have have saved your sources.list, run the following command:

sudo apt-get update

This will download the package index from the apt-cacher server. You should see lots of "Get" "Hit" and "Ign" lines coming from http://apt-cacher (and other lines for partner and 3rd party servers) if everything is working right. Remember that the update command will still be running at the normal speed because it has to fetch the indexes from the Internet every time to determine if the cache needs to download any new files. Also, the first time a given package is downloaded will still be at normal speed, as well.

To try it out, run sudo apt-get upgrade to download any available updated packages, or just install a new package of your choice. The apt-cacher should be functioning from the command line tools, from Update Manager, and from Synaptic Package Manager. Just remember not to adjust your repository checkboxes under the "Ubunto Software" tab in Synaptic's Settings:Repositories menu, because it no longer knows which repositories we've enabled (they are visible, however, on the "Other Software" tab, and you may adjust them there.)


How To Switch Locations

If you are using a laptop or netbook, you may appreciate the ability to quickly switch from one loication to another, and even to be able to download updates when you are not near your regular apt-cacher-ng server at all.

I have come up with a strategy to accomplish this. All you need to do (and you must do this while your current apt-cacher-ng server is accessible), is repeat the above steps for "Setting up the APT Cacher Server" on your local machine, then you can simply edit your /etc/hosts file and change the entry for apt-cacher to point at 127.0.0.1 when you're on the run, or back to your server's IP when you are at home or work. Making that one line change will allow you to continue using all of the APT tools smoothly.

There is one disadvantage, especially for netbooks or devices with smaller hard drives, and that is that you will be storing two different caches on your hard drive for files which were downloaded while "on the go", one in the apt-cacher folder, and the other in the system's regular apt system cache under /var/cache/apt

Because of this, you may want to occasionally issue the command:

sudo apt-get clean

This will clean the system cache of installed packages out of /var/cache/apt, saving some disk space. This is generally a good idea to do on any Ubuntu system with disk space limitations, whether or not you are running apt-cacher-ng.

Also, if you ever need to delete the files under /var/cache/apt-cacher-ng, you may safely do so, and apt-cacher will download them again the next time they are needed.

Congratulations on successfully setting up apt-cacher-ng -- I hope! It has saved hours and hours of downloading here in our classroom.

Sunday, June 20, 2010

Using Exclamation marks in Google Command Line

As I found out in my previous post, you can't just add an ! into your post without getting a bash error. You can sort of escape them with a /, but then they both show up (like this: /!), which is silly. You can get around this by first, making sure that you use single quotes around your post and then adding a $ right before the quote that begins your post:

google blogger --title 'this is a blog post' $'this is an exciting blog!'

Tuesday, June 1, 2010

Ubuntu 10.04 Lucid Lynx

We've had the chance to install Ubuntu 10.04 "Lucid Lynx" on several machines now. Except for one particular model of Dell, the experience has been wonderful. The boot time is great--less than 10 seconds on reasonably new hardware. The new default visual theme is refreshing and beautiful. It "just works," which is more than I can say for the aging Windows XP at this time, even when used with older hardware that it should "know about."

In fact, this release has been so good, that I've now reinstalled my personal notebook computer with a fresh copy of Lucid.

There are some downsides, such as the lack of customization in the login screen (a problem that has carried over from the previous release, Karmic Koala) but the trade off for speed and stability is well worth it, and I'm sure the missing options will be reintroduced in time.

For fun, I also tried installing Debian Squeeze, and was not as happy with the outcome. The Ubuntu team really does do a lot of work to make Linux more user-friendly. I also tried Linux Mint 9 Isadora, which is based off of Ubuntu Lucid Lynx, and it seems quite formidable in its own right.

Of note--I particularly like the inclusion of the new Thunderbird 3 email client. It has some amazing features, but its attempt to autodetect the settings for my mailbox was a failure, and I had to manually set the options the correct way--a task I don't think a normal user would have been able to do, since it involved turning off features that were turned on that in past versions of Thunderbird never were turned on. On the positive side, I love the new "Smart Folders" and the improved search capabilities.

Community Computer Center

Susie and I have opened a new business with an emphasis on Free Software. It is called the Community Computer Center, and is a "brick and mortar" store which sells GNU/Linux-based desktop and laptop computers, does computer repairs (including Linux conversions), and teaches a variety of classes from "introduction to computers" up to database design and programming.

We are also making Open Computing into our businesses' official blog, and its posts will be featured on the home page of our site, communitycomputercenter.com

Friday, November 6, 2009

One Thing Linux Doesn't Support (Yet)

Today I got a phone call that helped me realize one thing that Linux can't do, at least not yet:

"Hello Sir, I am calling from [unintelligable speech], to help improve the performance of your computer."

"Ok."

"I will tell you how to do this. The first thing you need to do is turn your computer on."

"It is already on."

"Then I will have you click on Start."

"I don't have a Start button."

"... You have a Macintosh?"

"No, I have Linux."

"Excuse me?"

"I have Linux."

"You have a Linux?"

"Yes."

"I am sorry sir, we only provide technical support for Windows computers. Goodbye."

Thursday, January 1, 2009

My Comprehensive List of Free or Open Source Software for XP

I received a brand new hard drive (400GB SATA) for Christmas this year (thanks Mike!), and so I am spending today reinstalling my main computer with Windows XP Pro. Unlike most Linux distributions, Windows is devoid of any useful programs after it has been freshly installed (no, I'm not saying that windows is a linux distro). As I reinstall all of my old programs, I'll be keeping track of them here for future reference, and maybe some passer-by (that's you) will find it useful.

I got tired of adding text and links about halfway through - I will update tomorrow or so.

The Operating System:


Windows XP Pro

Much better than XP Home, if you are going to use your computer in any custom way, or on a network. I'm not even going to go into Windows Vista here.

Debian, Etch

Debian will be installed as a dual boot on my 80GB drive... I've only used Mandriva and Ubuntu/Xubuntu thus far, so this will be exciting.

Appearance:


Royale Noir XP Theme

Download the Royale Noir theme and follow the instructions. This will give you a darker (navy or black) version of the Windows Media Center theme. Or, you could set the theme to Windows Classic and forget about trying to look snazzy.

Desktop Wallpaper

Go visit Smashing Magazine and download a desktop wallpaper. They scour the web for amazing wallpapers so you don't have to. It doesn't matter what you pick as long as it isn't the default 'blissful hill'.

Internet:


Browsers

As a web developer, I install every browser, but only really use Firefox. Opera 9 seems comparable, but it comes down to 1) extensions and 2) familiarity. Chrome isn't ready for consumer use yet, Internet Explorer 6 is a dinosaur, and Internet Explorer 7 is slow / annoying to use. I let Windows install IE7, and then install multiple IEs in order to get IE6. This lets Microsoft update IE7 for me, so I have the latest version for testing. Safari is fast, but I don't like the User Interface - it's too hard to find the features I am looking for (without even knowing if they exist).

Browser Plugins

Flash and Shockwave, Acrobat Reader, Quicktime (skip if you plan on installing iTunes), Java, Real Player or you can install Real Alternative which lets you play the RM files without the terrible media player!

Pidgin

Pidgin is an all-in-one Instant messenger. I like it for the custom smiley themes and plugins. I used to use Trillian, but it conflicted with my computer for some unknown reason. Astra looks awesome, but it's been coming soon for at least two years, probably more. Digsby looks kind of cool, and if Pidgin ever fails me, I'll try it out.

mIRC

mIRC is the best IRC client that I've tried. The UI is simple yet powerful. Lots of bells and whistles if you want them. And no fluff graphics either. I turn the theme to dark as soon as I install it.

Thunderbird

Thunderbird is better than Outlook Express. There might be a better free email client, but this one is good enough for me. I don't like the default theme, so I install Azerty Mail instead.

Azureus

Azureus (or Vuze) is a pretty good P2P app. Vuze sucks, change it back to the classic mode. Useful for downloading the latest Linux Distributions.

eMule

eMule is good for downloading old, hard to find programs.

LimeWire

Limewire is great for getting viruses and spyware!

AVG 8

Before installing Limewire, make sure you have some basic anti-virus protection. Unless someone out there knows of a better free anti-virus, I am currently recommending AVG-Free. Avira is also good, but has pop-up advertisements. Clamwin sucks, as does Avast.

Spybot S&D

Spybot's most useful feature is the teatimer system change monitor. This alerts you to changes to your registry, startup, browser, context menus, etc. Better than Vista's watch-dog because it actually tells you what is happening, and saying no lets the program continue to run as if it HAD made the change rather than just stopping the program from running altogether. I use this for programs like quicktime that want to add a startup entry so that it will load faster. Since I only use quicktime once every couple months, this is hardly a good use of my start-up space.

FileZilla

This is a great program, but I have not had good luck with version 3.x. I can only assume that it DOES work for most people or they would have fixed the issue already (disconnects every few minutes). If you can find version 2.x, it's pretty darn good.

Firefox Add-ons:


Camifox theme

There are a lot of good themes for Firefox, but Camifox is nice and simple without looking ugly.

Add to Search Bar

This lets you add any search box to the firefox search in the upper right-hand corner, instead of relying on the ten or so default ones.

Cookie Swap

Cookie Swap lets you quickly switch between named sets of cookies so that you can use multiple accounts with the same service without re-logging in all the time.

Edit Middle

An AwesomeBar hack.

Enter Selects

AwesomeBar Hack

Favicon Picker

Lets you change or add a favicon to any of your bookmarks.

Flash Block

Special mention to this extension for older computers that can't handle the amount of flash that some websites use. Or, if your eyes can't handle it!

Foxmarks

Useful if you have more than one computer, dual boot, or have ever lost all your bookmarks when your HD crashed. It synchronizes all of your bookmarks with their server, so that when you add a bookmark it is added to all of your computers.

Go Parent Folder

Lets you go to the parent folder after searching for a bookmark in the organizer.

Google Notebook

A notetaking thingy - there are some problems with it, but I haven't gotten around to trying any of the other similar extensions yet.

Google Toolbar

Essential for the 'Go to Next Search Word' buttons. I can't use the web without them.

Hide Unvisited

AwesomeBar Hack

HTML Validator

A Web Dev tool that tells me how many errors a web page has.

Old Location Bar

AwesomeBar hack - Tries to make the AwesomeBar just be a location bar, it isn't quite sufficient, and I'm not sure if it helps or hinders more ...

OpenBook

Lets you customize the add bookmark dialog.

Organize Status Bar

Firefox 3 didn't have the same status bar layout as FF2, this will let you move things around however you like.

ScribeFire

A quick blog editor.

Show Keywords

AwesomeBar Hack

Smart Bookmarks Bar

Transforms your bookmark bar into a list of single icons. This is where the favicon picker comes in handy.

Tagmarks

I haven't tried this one yet. It lets you add little icons to your bookmarks, visually placing them into categories for you.

Unsorted Bookmarks Folder Menu

This places your unsorted bookmarks in a folder that is accessible from the bookmarks menu.

Web Developer

By far the most useful extension that I have installed. It is the swiss army knife of web development tools.

Applications:


Open Office

Open Office is free and comparable to Microsoft Office. Writer is AWESOME! much better than Word for pretty much anything.

Google Earth



Edit Pad



Graphics and Design:


Paint.NET

Paint.NET is a free photo editor along the lines of Photoshop.

Picassa



Inkscape



Pepekura



SketchUp



Audio/Video:


CDex



Winamp



Streamripper

Streamripper rips individual songs from streamed internet radio stations. If you use the WinAmp version, make sure to get a custom skin for it, the default one is (was) terrible.

iTunes



Cool Edit replace



DivX



Step Voice Recorder



Video LAN



Switch Sound Converter



Tools:


Sequoia View



WinRar



TweakUI



For good measure, here's a list of the proprietary/non-free programs that I use:

Photoshop 7 or CS3
Flash
InDesign
Adobe Acrobat
Microsoft Publisher
Nero 6
FolioBound VIEWS (if anyone knows of a good replacement, leave me a note!)
PowerDVD (same for PowerDVD)

Saturday, June 28, 2008

Ubuntu Hardy Heron is Unstable

I've been running Hardy now for quite a while, and I've come to the conclusion that it isn't stable. I will probably be downgrading to Gutsy very soon, however much I dislike the idea of doing so. To me, downgrading doesn't feel like I'm being part of the solution, but rather that I'm just bypassing the problem.

Here are the things I've been having problems with so far in Hardy. And, for the record, I've tried all of these things with compiz disabled as well, with no improvement:
  1. On occasion (sometimes as frequently as once an hour), gnome-terminal will open with a blank (frozen, not invisible) window, there will be a grey bar where the menus should be, and I have to terminate the process. I've tried waiting it just stays there blank. Once this happens, nautilus, gedit, and even some of the file-related dialog boxes, and possibly the pop-down calendar from the gnome panel all crash in the same way, creating a blank box, and in the case of anything associated with the gnome panel, freezing the panel entirely. Restarting GDM doesn't help. I've tried everything. There seems to be nothing logged showing that there was any problem. Rebooting is the only solution.
  2. Firefox 3. Not only is it annoying (due to AwesomeBar), but it feels less polished than Firefox 2. My Firefox 2 did crash every once in a while. I finally decided to reinstall Firefox 2, and give it a try. Firefox 3 unfortunately did things to the configuration which makes Firefox 2 suck as well, since it tries to run off of the same settings. I deleted the extensions.rdf file and start FF2 and everything seems almost OK. But, if I ever run FF3 again, it ruins FF2 (removes all extensions, mostly.) This means I cannot ease into FF3 while still using FF2 for my day to day work. I will thus be uninstalling FF3.
  3. Random lock-ups. I haven't had this problem as much as some people have been reporting, but I have had some unusual lock-ups. One of them involved my screen suddenly appearing scrunched left-to-right and streched up-and-down with big black bars on either side and everything completely frozen (including the mouse pointer) requiring a hard reset.
  4. Thunderbird is barely usable. I use Thunderbird with an IMAP account. Previously, it has worked like a charm, but now all of a sudden, it routinely crashes without an explanation. It seems to crash in two different ways. The first way will be, while checking my inbox, new messages will appear, but the program is still catching up (not usable yet), and all of a sudden the entire program will just disappear. Messages, and the main window, poof, they're gone. No word as to why. This happens about 1 in 5 times that I open Thunderbird. The other one happens about 3 out of 5 times that I open thunderbird, and it involves clicking on my Inbox and the program immediately going comatose. When compiz is on, the window dims to a dark gray to show me that the program isn't responding, and no matter how long I wait, it never wakes back up. I have to kill the process (or click the X and force quit it) in order to try again. Yes, that adds up to 4 out of 5 tries that Thunderbird doesn't work. Every once in a while I am lucky and it will work, in which case it is usually stable for the entire session until I close it.
I'm a web developer. Browsing the web, using SSH through a terminal, and checking my email are nearly all that I do on my computer, and Hardy Heron isn't ready for ANY of those tasks. Gutsy Gibbon worked perfectly with all of them. I will probably be moving back to gutsy, but I'm afraid of what a downgrade might involve as far as my user configuration files are concerned. I guess I will be making backups before downgrading.

Sunday, May 4, 2008

Using a dark theme in ubuntu

After installing a dark theme on my "new" laptop the other day, I've been adding quite a few tweaks in order to make it render correctly with the rest of Ubuntu 08.04 - Hardy Heron.

Theme installed: Darklooks - you can find it in Synaptic Package Manager (gnome-themes-extras).

Edit the theme file:

cd /usr/share/themes/Darklooks/gtk-2.0/

edit gtkrc, changing lines 181 and 182 from:

bg[NORMAL] = @tooltip_bg_color
fg[NORMAL] = @tooltip_fg_color


to:

bg[NORMAL] = @tooltips_bg_color
fg[NORMAL] = @tooltips_fg_color


This will keep the theme from crashing, I have yet to change the notifications and tooltips to be a dark color rather than yellow.

Enable the darklooks theme for gnome.

You can test it by opening firefox. If you have done the last step correctly, the theme should stick. Otherwise, it will revert back to a blocky theme.

Now for specific Apps, these tweaks are not theme specific - they should fix most dark themes.

The biggest concern for most people will be Firefox:

First, make a backup of your .mozilla profile folder (in your home folder)
uninstall firefox-3, and then install:

firefox-2
firefox-2-gnome-support
msttcorefonts

Why are we doing this? Firefox 3 has automated gtk integration - but, all those large dark widgets on top of light colored sites ... not very pretty. Firefox 2 has a way to get around this, but as of this post, Firefox 3 has disabled that option. You can write to your nearest Firefox developer and ask for this to be added back in!

Once you have firefox 2 up and running, merge your profile data back into your new .mozilla folder (bookmarks, add-ons, etc)

Go into the firefox preferences Edit > Preferences , and choose the Content tab. Click on the Colors button, and make sure 'Use System Colors' is unchecked. Save your changes and close that window. Next click on the Advanced fonts tab, and change the monospace font size to 14. Save and close all the way.

Download this archive, and extract it to a convenient place.

go to: /home/**/.mozilla/firefox/**/chrome , replacing the ** s with your user name and the correct profile code.

If you want to keep the ugly firefox 2 widgets, move the 'userContent-restore to firefox defaults.css' file into this folder, and remove everything after Content.

If you want prettier widgets, move the 'userContent.css' file into the chrome folder. You will not need to change its name. Next, go to /usr/share/firefox/res , and make a backup of your forms.css file. This folder belongs only to root, so you may have to do this in terminal.

sudo mv forms.css forms-backup.css

or some other such name. DO NOT SKIP THIS STEP! you should always make a backup when changing system files. Now, move the form-widgets folder, again using the terminal:

sudo cp -r where/ever/you/extracted/the/folder/form-widgets /usr/share/firefox/res/form-widgets

You should be done! You can use this page to test with.

If you know css, you can edit any of the .css files to change anything you like. You can also change the way the widgets look by opening them in your favorite image editing program.

These are the web pages that I visited in order to put all of these files together (along with a lot of my own tweaking):

Firefox Widgets
Instructions for FF3 I found this after I uninstalled FF3, according to a comment, it only works for FF2 ...
the stylish style referenced above
the unhelpful mozilla page
specific Darklooks theme problems
ubuntu forum thread with some helpful links
a possible fix for the auto complete bar in FF3
some good info

Things to fix still:

When you search for a word, it still uses a minty green color
The address bar on a secure page clashes, but is readable.
In the built in firefox boxes with hint text (like the search bar on the top right), the text is too dark to read easily.

One more thing! If you want to, you can install the stylish firefox extension, and then install a dark google theme, that way it will feel more like the rest of your desktop.


Open Office:
I haven't opened up anything but Writer, so, I don't know what else needs fixing yet.

Download this archive (7.7mb) and move the images_tango.zip file into /usr/lib/openoffice/share/config/ Don't extract it.

To change the icon theme so that it matches better (unless you like orange of course), go to the Tools > Options menu. Under the OpenOffice.org section, choose View. Change the icon size to small (if you think they are too large), and set the style to tango.

Next, to change the page background color from dark gray to white, choose Appearance from the left. Change document background to white, and font color to black. As you run into any other glitches, you can change them here.

Pidgin:
First, make sure you are running the new pidgin, it should be 2.4.1 or higher. If you have Hardy Heron installed, you are good to go.

In the Tools > Plugins menu, turn on 'Conversation Colors' and set Sent and Received Messages to #ADADAD (you can go lighter or darker, at your preference).

Next, turn on the 'Pidgin GTK+ Theme Control', and set the hyperlink color to #576BBE , the Sent Message Name color to #8496DD , and the Received Message Name color to #EA987D . Again, you can change these as you like, but this is a good starting place.

If you have a smaller screen (1024x768), you won't be able to see the save or close button. Click tab until you get to the re-read gtkrc files, then click tab again, and push your [ENTER] key.

Gedit:
Open Gedit, \go to the Edit > Preferences menu, and choose the Fonts and Colors Tab. Change the theme to Oblivion. This theme is not ideal, color wise, but it's readable!

Terminal:
Open up your terminal, go to the Edit > Current Profile menu, choose the Colors tab, you can try using the colors from the system, or change the scheme white or green on black. Whichever suits your fancy. You can also change the colors individually if you like.

That's it for now, as I use the theme, I know I'll run into more things that need fixing, and I will either add them to this post, or make a new one.

Thursday, March 13, 2008

Desktop Diet!

A great presentation by Rasterman, the head coder of Enlightenment.



I tried out E17 the other day, and it's not as good as I hoped it would be. Ah well!

Sunday, December 2, 2007

Happy Linux Thoughts

I'd just like to post a link to a great linux blog:

HappyLinuxThoughts

Monday, September 17, 2007

Linux Blog Online

I'd just like to tell everyone about this blog - it's informative, interesting and funny!

enjoy!

Monday, July 23, 2007

Scrambled Xvnc Keyboard Mapping on Ubuntu Feisty

This is just a bug workaround:

If you log in through Xvnc (I use it with xinetd) and see the gdm screen, log in to gnome fine, but then after that your keyboard comes out scrambled, here's a quick and dirty fix (you'll have to do this from a console that is working, maybe SSH?):

sudo mv /usr/share/xmodmap/xmodmap.us /usr/share/xmodmap/xmodmap.us.bkup

Of course, this only works if you were using the US keyboard layout. This is not ideal, but it gets the job done in this particular case.

The fix for this is apparently already in the upstream code and should be available in the next gnome update from Ubuntu.

Monday, April 23, 2007

Getting rid of the tooltips in the Gnome panel

Tooltips in the panel seem pointless to me, they hardly ever tell you more information that you can already gather by just reading the menu entry. If you are using Compiz or Beryl and have menu effects turned on, all those tooltips popping up and sparkling everywhere could get old very fast.

Here's how to get rid of them:

Open a terminal and type gconf-editor. This should open the Gnome Configuration Editor. Navigate to Apps > Panel > Global and uncheck tooltips_enabled. Enjoy your tooltip-free Gnome Panel!

Saturday, February 24, 2007

Watching Television on the Internet

After making the switch to Desktop Linux, I have finally got around to figuring out what to do for entertainment. Getting DVD media to play was a breeze, perhaps because it seems to be the first thing anyone asks after getting their OS up and running. Of course, we should do our best to push for open formats to replace DVD, but in the real world a little bit of "closed media" is likely to keep people from actively using Open Source everything-else. If a computer can't fulfill the basic human need for entertainment, it won't last long.

My next place to turn was to Television programs. There are a few series that I have enjoyed in the past, and I just gave away my 23" television to free up some space in the apartmet, leaving me with a 13" TV that I have decided only to use for 8-bit Nintendo. Television over the Internet would be a sweet alternative. Some shows are available for "free" viewing on their official websites, others are not.

The shows I think I'm interested in viewing right now are: 24 (Fox), LOST (ABC), The O.C. (Fox), The Office (NBC), Prison Break (Fox) and Veronica Mars (CW).

I will chronicle my level of success in this endeavor here:

I asked my brother "So how does one watch TV on the Internet?" and off the top of his head he referred me to ABC's website. I want to say "well done" to ABC for their episodes available online. They have done a decent job and it seems like Flash player is all that is required, making it a trivial matter to watch their content in Firefox on Linux. This takes care of my need for LOST, and opens up the possibility to some new programs which at the moment don't look very compelling for me, but may be possibilities. The first episode I watched had the same commercial played in every single break. I wonder about the effectiveness of this, and would have rather seen three separate commercials, even if they were all for the same product, simply because watching the same thing three times within an hour is not more productive than seeing it once.

Next I turned to Fox. Obviously I'm a fan of Fox, I have my eye on three of their shows, and I have purchased more Fox DVD box sets than any other show. In fact, it may well be true that every DVD box set I own is produced by Fox. The programs they put out seem to be of a high quality. I looked up the web site for Fox, clicked on Prison Break, and saw an inviting link that I may be able to watch full episodes for free. It directed me to a MySpace page belonging to Fox, which was a bit surprising: I thought MySpace was home to teenagers, not corporations. I observed right away that the site wasn't as clean and streamlined as ABC's, but then I got confronted with a major problem:
We're sorry, but only the following operating systems are supported at this time:

Microsoft Windows 2000/XP (not Vista)
(Intel) Apple Macintosh OS X or later
(PPC) Apple Macintosh OS X or later

Please check back soon for support for other operating systems.
It seems that Fox also has its programs available on iTunes, but I hear they will only play on the newer iPod devices, and the free iTunes software is only supported on Windows and Macintosh. I read an interesting article about "DVD-Jon" and some of his buddies writing some software that would let you purchase songs at the iTunes store using Linux, but I think it only worked for music, and furthermore, it was abandoned and does not work with the current iTunes Store. I would pay Fox directly to watch these shows if I could. So it sounds like I may have to wait until the current seasons of 24, The O.C., and Prison Break are released on DVD (if they are.)

NBC doesn't offer any apparent way to play full episodes from their websites, and if they are offering them for viewing in other venues they are not making this obvious by advertising them in any way. They do seem to offer short video clips and deleted scenes, etc., but I'm not one for spoilers. I will investigate at a later time to see if they offer them through another outlet, but except for my academic curiosity to investigate this at a later time, they would have lost my viewership.

The CW has a full episode feature, which links to this page, but the center area of the page just remains a white box and selecting a series from the right-hand list doesn't seem to do a thing. Right clicking on the white reveals that it is a Flash player. I don't know why it is broken, but I will presume they aren't supporting the Linux version of Flash (I don't know how that is possible), but I will give it another shot later in case they are just temporarily down.

So it looks like ABC wins. Stay tuned for an upcoming article on why even their solution isn't the best choice and why Television producers need to make some decisions in the upcoming years.

Monday, February 5, 2007

Why do we sudo in Ubuntu, and who is Charlie Root?

It is a tradition in Linux and other Unix-like operating systems to have a superuser account named root. root is named such because "he" has full access to everything in the filesystem from the root directory "/" on down the line (whereas most ordinary users only have limited access with full access in their home directory alone.) root has a home directory too, named after himself, found at /root, not to be confused with "/" which is also called the root directory. :-) You'll notice that on most systems his home directory is not in the same place as the other user's home directories (usually /home/yourname).

In some Linux distributions, you log in to the root account frequently to perform administrative tasks on the machine, but in Ubuntu and a few other modern distros, this is not the case. Instead, we use a tool called sudo.

sudo means "switch user and do." There is another command called su (switch user), which can be used to switch to another user and open a shell, which is great if you know their password (which su prompts for), but on Ubuntu you aren't supposed to know the root password. That's right, that is how it is designed, and you should not change it unless you have a really good idea of what you are doing. The reason you don't know the root password on Ubuntu is that you don't need it at all because the admin group to which all "Administrator" users belong is listed in the sudoers list (/etc/sudoers) If I needed to change the owner of a file (hypothetically called myfile), and I need root access in order to do this, I would type:

sudo chown jeffd myfile

I will be prompted for a password. This is not the root password, but your own password. It is requested as a security precaution before proceeding to run the program with root access. After entering the password, the command "chown jeffd myfile" is executed as root, after which control returns to your ordinary user (subsequent commands are not executed as root, although if you sudo again within about five minutes, the Ubuntu defaults are set to not ask you for the password again.)

So what if you need to do several commands as root? In all the other Linuces, you just log into a shell as root. Well, if you really want to do this, you can either type sudo bash (to open the bash shell) or sudo su root (to open root's default shell). Either way, you will enter your own password and then be presented with a root shell prompt. When you are done with the shell prompt, type exit to return to your own shell. Do not forget this step! It is never a good idea to run applications or compile things as root. You should perform these tasks as your own user. In fact, some newer Linux software is designed so that it will actually refuse to compile or run as root, giving you a gentle slap on the wrist.

Again, please do not change the root password. Doing this will only weaken the security of your system, and make it easier for you to get into bad administrative habits.

If you are using gnome and would like to launch a graphical application as root you use gksudo instead of sudo, but it works the same way aside from its name and the way that the password prompt appears in a window.

Oh, one last thing: I mentioned Charlie Root in the subject. This is the full name sometimes given to the root user, when a first and last name are required (for example, in the address headers of administrative emails automatically generated by the system and sent to the root account.) I think this name is only used on BSD Unix systems, (FreeBSD, OpenBSD, and NetBSD), so you may not ever see it in Ubuntu, but because I was familiar with administering FreeBSD servers, it is still the name I affectionately call the root user by. Here's some more Charlie Root trivia.

Linux Kernel Modules

This brief post is designed to explain what a Loadable Kernel Module is.

In the beginning, there was the Linux Kernel. Linus Torvalds designed it so that the code you needed to operate the base devices on your system would be compiled into the kernel, after all, as Open Source Software, everyone had the capability (if not the skill) to recompile the source as needed.

Around 1995, Loadable Kernel Modules (LKM's) were introduced into Linux. While not entirely synonymous, these are about the closest things in Linux to what windows users would know as Device Drivers (something like Windows .vxd's)

An LKM is a separately compiled piece of source code, which is linked against the kernel you are running so that it is "pluggable" and can be enabled or disabled even while the base Linux kernel is running. To see what Kernel Modules you have installed you can type lsmod at a shell prompt. Here's what I see on my Dell Inspiron 6000 notebook (this list is a little long, but just skim it quickly so you get the idea of what is there):

Module Size Used by
binfmt_misc 13448 1
rfcomm 42260 0
l2cap 27136 5 rfcomm
bluetooth 53348 4 rfcomm,l2cap
xt_limit 3840 2
xt_pkttype 2944 1
xt_tcpudp 4480 28
ipt_LOG 8320 11
xt_state 3328 6
iptable_mangle 3968 0
iptable_nat 8964 0
iptable_filter 4224 1
ip_conntrack_irc 7920 0
ip_nat_ftp 4736 0
ip_nat 19884 2 iptable_nat,ip_nat_ftp
ip_conntrack_ftp 8816 1 ip_nat_ftp
ip_conntrack 53088 6 xt_state,iptable_nat,ip_conntrack_irc,ip_nat_ftp
,ip_nat,ip_conntrack_ftp
nfnetlink 8088 2 ip_nat,ip_conntrack
ip_tables 15204 3 iptable_mangle,iptable_nat,iptable_filter
x_tables 16132 7 xt_limit,xt_pkttype,xt_tcpudp,ipt_LOG,xt_state,i
ptable_nat,ip_tables
speedstep_lib 5764 0
cpufreq_userspace 5408 0
cpufreq_stats 7744 0
freq_table 6048 1 cpufreq_stats
cpufreq_powersave 2944 0
cpufreq_ondemand 8876 0
cpufreq_conservative 8712 0
video 17412 0
tc1100_wmi 8324 0
sbs 16676 0
sony_acpi 6412 0
pcc_acpi 14080 0
i2c_ec 6272 1 sbs
i2c_core 23424 1 i2c_ec
hotkey 11556 0
dev_acpi 12164 0
button 7952 0
battery 11652 0
container 5632 0
ac 6788 0
asus_acpi 17688 0
ipv6 271136 18
sg 37020 0
sd_mod 22528 0
lp 12964 0
tsdev 9152 0
psmouse 41352 0
usb_storage 74816 0
libusual 16912 1 usb_storage
serio_raw 8452 0
snd_hda_intel 20244 2
snd_hda_codec 164480 1 snd_hda_intel
8139cp 24960 0
8139too 29056 0
ati_agp 10636 0
agpgart 35016 1 ati_agp
shpchp 42144 0
pci_hotplug 32828 1 shpchp
parport_pc 37796 1
parport 39368 2 lp,parport_pc
usbhid 45280 0
pcspkr 4352 0
mii 6912 2 8139cp,8139too
snd_pcm_oss 47232 0
snd_mixer_oss 19328 1 snd_pcm_oss
snd_pcm 84356 3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
snd_timer 25348 1 snd_pcm
snd 58116 10 snd_hda_intel,snd_hda_codec,snd_pcm_oss,snd_mix
er_oss,snd_pcm,snd_timer
soundcore 11232 1 snd
snd_page_alloc 11528 2 snd_hda_intel,snd_pcm
evdev 11392 1
ext3 142344 1
jbd 62100 1 ext3
ehci_hcd 35208 0
ohci_hcd 22788 0
usbcore 134656 6 usb_storage,libusual,usbhid,ehci_hcd,ohci_hcd
ide_generic 2432 0
ide_cd 33696 0
cdrom 38944 1 ide_cd
ide_disk 18560 3
atiixp 7824 1
generic 6276 0
sata_sil 11016 0
libata 74764 1 sata_sil
scsi_mod 144392 4 sg,sd_mod,usb_storage,libata
thermal 15624 0
processor 31560 1 thermal
fan 6020 0
ehci_hcd 35208 0
ohci_hcd 22788 0
usbcore 134656 6 usb_storage,libusual,usbhid,ehci_hcd,ohci_hcd
ide_generic 2432 0
ide_cd 33696 0
cdrom 38944 1 ide_cd
ide_disk 18560 3
atiixp 7824 1
generic 6276 0
sata_sil 11016 0
libata 74764 1 sata_sil
scsi_mod 144392 4 sg,sd_mod,usb_storage,libata
thermal 15624 0
processor 31560 1 thermal
fan 6020 0
fbcon 41376 0
tileblit 3840 1 fbcon
font 9344 1 fbcon
bitblit 7296 1 fbcon
softcursor 3328 1 bitblit
vesafb 9244 0
capability 5896 0
commoncap 8704 1 capability
(END)

To activate a compiled module that isn't showing on this list, the tool modprobe is used. For example, while I was getting my proprietary wireless card working, I had to run:

modprobe ndiswrapper

To remove a module, you can use:

modprobe -r ndiswrapper

Or, alternatively: rmmod ndiswrapper

That being said, you probably shouldn't be adding or removing modules if everything is working fine, unless you have a very good reason to do so.

The very brave and memory-thrifty user might scour the list analyzing the sizes and if a module is unused and unneeded, remove it. For example, since I don't plan on using any bluetooth devices whatsoever, I might remove bluetooth, l2cap, and rfcomm, which are all related to bluetooth. (I looked them up on Google to make sure.) But, since I'm not really that adventurous, and don't know if there are any side effects, I'm not going to do that. :-)

Some modules of note in my list are snd_hda_intel & snd_hda_codec, which make my particular variety of sound card work, and... hmm, It's gone now. I could have sworn ndiswrapper was in my list, as I jumped through all sorts of hoops to get my wireless networking working with it, but I don't see it now. The network card is working, though, so I'm not going to touch it. None of the other modules I have installed are of particular interest to me: They have been doing their job, and I haven't had to even know they are there.

Well, I hope this was a little helpful in understanding what LKM's are and how to manage them.

Saturday, January 27, 2007

Converted from Windows XP to Ubuntu Linux

I'm now running Ubuntu Linux 6.10 (Edgy Eft) on my Dell Inspiron 6000 notebook computer. I have named this computer Mercury (as opposed to Pericles, the Ubuntu web server that I've been writing about thus far.)

There were a couple pieces of hardware that I had to tinker with in order to get it working or optimized:
  • Wireless: BCM4318 AirForce One 54g 802.11g Wireless LAN Controller
  • Graphics: Intel Mobile 915GM/GMS/910GML Express Graphics Controller
Here is a list of the software I'm running on the system so far. This list isn't exhaustive, but basically includes things I frequently use and things that I had to deliberately install:
  • Gnome (desktop environment)
  • Mozilla Firefox (web browser)
  • Evolution Mail
  • Kopete (with MSN, Google Talk, Yahoo! Messenger, AIM, ICQ, and IRC connections.)
  • Tomboy Notes (a Wiki-like sticky note applet)
  • gnubiff (a tray notification tool to make a penguin dance if I have any email.)
  • xmms (music player)
  • Totem xine (movie player)
  • Codecs for virtually all Windows and Macintosh audio and video formats and full DVD playback.
  • wine (a windows API replacement layer to support a few windows apps that I still use.)
  • VirtualDub (a GPL'ed video manipulation program for Windows. I run this through wine.)
  • Internet Explorer 6 (I use this to test the websites I develop for my business. It also runs through wine, and I installed it using the very convenient IEs4Linux script.)
  • vmware player (I have it set up to boot off of a 6GB raw SCSI partition, with the MBR and other partitions mapped to zero so they cannot be affected by the virtual machine. I use this to run a few design tools that I don't have functional Linux equivalents for yet.)
  • Compiz (eye candy for Linux.)
I will be following this up with a series of posts to explain how I have already (or will yet) accomplish any non-trivial configuration tasks.

Monday, January 8, 2007

Ubuntu Edgy Eft Xvnc Disconnect Problem

Diagnosis of Problem:

I installed the Automatic Updates on Ubuntu Edgy Eft recently, sometime around January 06 (2007-01-06), and after a reboot, my Xvnc running through xinetd stopped receiving connections. It disconnects immediately after connecting, or immediately after receiving the password. Log files turn up almost nothing, there is a "xinetd[nnnn]: warning: can't get client address: Transport endpoint is not connected" error showing up in /var/log/daemon.log and /var/log/syslog and upon telnetting to the vnc port I received nothing but RFB 003.008 (the usual VNC protocol greeting) followed by an immediate drop of the connection. xinetd does pass the connection to VNC, we know this because the greeting is given, but an examination of the running processes will not show Xvnc in the list because it closes immediately after opening.

Running Xvnc server manually with the appropriate options and connecting to it with vncviewer resulted in a gray screen (so-called "root-weave") with an X or a watch cursor on it, and the gdm (Gnome) session never starts.

The Solution:

Temporary solution: This happened because of an upgrade in the vnc4server package. Run synaptic package manager, search for vnc4server, click on it, go to Packages, Force Version and choose the previous version. Downgrade to the previous version and you should be alright for now. Wait until the next version comes out before you attempt to update this package again.

How I Found the Solution:

It took me many hours, but I found the answer on https://launchpad.net/ubuntu/+source/vnc4/+bug/78282

The person who first reported the bug incorrectly listed the date of the upgrade as 2006-01-06 (happy new year feranick).

I hope this helps! Drop a comment to let me know if this post eased your pain.

Wednesday, December 6, 2006

Migrating MySQL Data

Its time to migrate a copy of the MySQL data so that I can begin testing the websites running on Pericles in a closed environment before I let this out into the wild.
sudo /etc/init.d/mysql stop

The data lives in /var/lib/mysql

I'm cool with that, but I'm going to replace it with my existing data, so first I'll rename it to preserve the original:
cd /var/lib
sudo mv mysql mysql-original
sudo mkdir mysql
sudo chown mysql.mysql mysql

Next, I unpack my MySQL backup, which was archived from my replication slave a couple days ago. Since I'm going to make this into the new master, I'll first use this data as a testbed and afterwards I'll replace it with a fresh copy when I'm really ready to switch masters. My data is currently about 1 gigabyte, which shrinks to 111 megabytes when compressed, so it takes about five minutes to copy and longer to unpack. I should point out that innobase and myisam data on Linux and Windows are "binary compatible" so they can be copied directly across the board, but you need to make sure your mysql configuration files have the same innodb settings in them, or else. Oh yeah, I should also mention that the MySQL version numbers are both very close, and up to date, so the fields in the user tables and so forth are the same format. I wouldn't recommend migrating a MySQL 4.0 database to a MySQL 5.0 environment using this technique because the user fields changed a bit.

I deleted the master.info file so that this server won't try to connect to the replication master like the replication slave from which it was copied was programmed to do. I'll configure it to be a replication master once I do the real thing.

I had to change my bind-address=0.0.0.0 in /etc/mysql/my.cnf in order to get the MySQL to bind to all network interfaces (I need to be able to connect from several networks.) This is ok, because the mysql users table has restrictions on which users are allowed to connect from which hosts. I wanted to change it in /var/lib/mysql/my.cnf which seemed to be recommended by the heading in /etc/mysql/my.cnf, but copying the cnf file and changing it there did not make any difference, so I resorted to changing the /etc/mysql/my.cnf version of the file.

Starting up MySQL I see this:
error:  'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

Now I need to add back in the debian-sys-maint user that I lost by overwriting the user tables. This is easy, because they leave the random password sitting unencrypted in /etc/mysql/debian.cnf

I did this by logging into MySQL from the command line interface as root, and executing the following commands:
USE mysql;
CREATE USER 'debian-sys-maint'@'localhost';
UPDATE user SET password = PASSWORD('PasswordCopiedEarlier') WHERE user = 'debian-sys-maint';
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost';
FLUSH PRIVILEGES;

I now stopped and started the MySQL server:
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start

This worked like a charm; I no longer see the error message, which means debian-sys-maint can do its magic.

Converting Hardcoded Pathnames

The next step on my adventure with Pericles is to convert all of the hard-coded pathnames from F:\Web to /var/www (as well as any other hardcoded paths I find.) I've been pretty careful not to use hard-coded names in unnecessary places, putting most of them in simple configuration include files and so forth, because I knew from the beginning that this day would come.

I typed grep and it turns out that I have a convenient version of Turbo grep (comes with any Insprise/Borland product of the last decade), but GNU grep should work just as well. The syntax for turbo grep that I'm using is:

grep -di "f:" *.ph*>hardcoded

I'm using *.ph* because I am searching all *.php and *.ph files. I typically use *.ph for include files instead of *.inc, the -di means search subdirectories and ignore case, and I keep my data and web files on the F: drive. I'm redirecting the output to a file named hardcoded so that I can use it as a checklist. I'll do the same thing again but, like this:

grep -di "c:" *.ph*>>hardcoded

To get all references to anything on the C: drive (I know I refer to an executable font conversion tool from one place, for example.) and the double angle brackets mean to append the result to my previous file instead of overwriting.

Now that I have my checklist, here's the plan:

I want to convert all the code while still on the Windows box to support Linux based on a single configuration change. I will make an include file with one function in it that takes any path given as a parameter and if it starts with /var/www, to convert it back to F:/Web. This will allow Linux to be the native language with a "patch" for Windows support. This should have been part of my plan from day 1 (two years ago), but it didn't occur to me. The idea is that I can replace this function with an "identity" function such as: function linpath($a) { return $a; } in order to use raw Linux paths instead of Windows.

I will also do similar adaptations on a situational basis as I run into any F: or C: references that can't be solved with the above include file.

I anticipate some difficulties with file permissions since Apache on Linux is more secure than Apache on windows. My main resolution to this will be to consolidate the affected items that need to be accessed into consistent areas that the Apache process has access to read. If I have any chroot issues, I can overcome them with the use of mount --bind as explained in my article on setting up FTP.

This path translation will probably be the most tedious task in the Pericles project. I'll report back when I have finished.

4:18 P.M. - Upon more deliberate consideration, I have determined to abandon this undertaking and instead to change the paths manually. Why? There only seems to be about one per website, with an odd exception here or there. The trouble crops up when deciding exactly how to include the file with the path mapping function without using a path for itself. Furthermore, even if I install it into the default includes path, it seems silly to include a file only to help correctly include another file. May as well just change them when the time comes.