Archive for the ‘Operating Systems’ Category

How To Fix Sound Problems In Ubuntu 7.10 Gutsy on Dell Computers

Wednesday, April 2nd, 2008

Currently, my main workstation at home is a Dell Dimension E520 which primarily runs Ubuntu 7.10, but I also dual boot into Windows XP for my photography hobby. One problem I had after upgrading to Ubuntu 7.10 from the default Ubuntu install which the E520 shipped with was getting sound to work. After trying several solutions in this forum thread, I finally got it working again.

How To Display Which Processes Are Using What Ports

Tuesday, February 26th, 2008

This is just a quick entry on how to see which software is using which ports. This comes in handy when trying to install an application server, web server, etc, and are getting errors like “port is in use”.

Basically in any Unix type derivative such as Linux such (Ubuntu, RedHat, SuSe, etc.), as well as Mac OS X, all that you need to type this at the command line:
[code]
lsof -i
[/code]

I remember there being a couple of commands in Windows which you could do this with, but it’s been so long since I’ve used Windows on a regular basis I honestly don’t remember how to do it. I do know you can use TCPView to accomplish the same thing, however.

News Flash: Apple Finally Released Java 6 for MacOS X!

Friday, December 14th, 2007

UPDATE: I was up too late, and didn’t notice that it’s update 6 for Java, not Java 6. This is just another update for Java 5… *sigh*

I’ve been up pretty late doing a little work and tying-up some last minute Christmas shopping, and out of the blue this Apple update window popped-up:


Java 6 for MacOS X is here!

I’m super glad to finally see an Apple release of Java 6! I’ve been developing with SoyLatte lately and was going to write a quick tutorial on how to get it up and running on MacOS X, so I guess I don’t necessarily need to do that now. Although given Apple’s secrecy about Java releases and the future of Java on MacOS X, it certainly doesn’t hurt to have an alternative around.

I’m still on Tiger– I assume Leopard users are seeing this update too?

Java 6 for Developers on MacOS X: SoyLatte Reaches 1.0

Thursday, December 6th, 2007

For those many of you (including myself) who have been waiting almost a year now for Java 6 to be properly supported on the Mac, the wait is over if you’re a developer– Landon Fuller has released SoyLatte 1.0, which is a port of FreeBSD Java 6 to MacOS X which will eventually end-up as part of the OpenJDK. This seemed to come together very quickly once Leopard came-out and was missing Java 6.

Though Java 6 didn’t provide quite as much new syntactic sugar as Java 5, the performance increases in Java 6 are pretty dramatic. I highly recommend giving Java 6 a look if you’re doing any development which runs on the JVM if you haven’t already switched.

Keep in mind that this is mostly a developers port as it’s not yet integrated into Cocoa, the MacOS X native GUI. Desktop applications will run under X11, but this is the next hurdle to tackle (though it seems to be a pretty big one).

How To Stop The Creation of .DS_Store Files

Monday, August 20th, 2007

At the request of a reader, I went ahead and researched what .DS_Store Files are, and how prevent MacOS X from creating them. In a nutshell, .DS_Store files are created by Finder to store preferences:

.DS_Store (Desktop Services Store) is a hidden file created by Apple Inc’s Mac OS X operating system to store custom attributes of a folder such as the position of icons or the choice of a background image. By default, Mac OS X will create a .DS_Store file in every folder that it accesses, even folders on remote systems (for example, folders shared over a SMB or AFP connection) and even if the user has only customized the appearance of the folder by moving its Finder window. This is in contrast to the preexisting system for the same purpose used in previous versions of the Macintosh Finder, which would merely place a number of invisible files at the root of the volume being accessed (even on alien filesystems), always storing the settings and metadata for all of the folders in the entire volume within this single set of files.

Unfortunately it seems that you can only prevent Finder from creating these files on network shares and not on your local machine. Here’s how you do it:

  1. Open the Terminal application (though I highly recommend using iTerm instead)
  2. Type in the following command:
    defaults write com.apple.desktopservices DSDontWriteNetworkStores true

    and press enter

  3. Reboot your machine so that the changes will take effect

I haven’t found a good way to prevent OS X from creating them on local file systems, but perhaps someone out there has some suggestions? Other than creating a script to delete them and adding it to cron, I’m not sure of a way to at least clean them up in an automated fashion. I did run across an application called DS_Store Cleaner which helps clean-up said files, though.

Interesting Details About the Space Shuttle Operating System

Saturday, August 18th, 2007

One great thing about the blogowebs is that you never know what sorts of posts you might run across, and this post about self-modifying code and the Space Shuttle OS is a prime example of that:

And it reminded me of my days during the early 1990s working as a software engineer on the Space Shuttle operating system (FCOS). Many people don’t know that the Space Shuttle OS implements self-modifying code for the purpose of “fault-tolerance”. The Shuttle computer systems consist of four primary computers running the same software, and a fifth backup computer running different software that is equal in functionality. The goal is to be Fail Operational if one or more computers fail, and Fail Safe if all primary computers fail; this is called a Fail Operational/Fail Safe system.

An interesting read, especially if you’re a software developer who doesn’t work in embedded systems but likes to read about them.

How To Show Hidden and Protected Files in OS X Finder

Monday, August 13th, 2007

One of my few complaints about MacOS X is that at times I feel like it treats you with kids gloves– many options for power users either require some sort of hacking, or simply don’t exist. One such thing which is fixable is getting Finder to show hidden files. It’s a quick and easy process via the command line to fix this:

tobin:~ brandon$ defaults write com.apple.finder AppleShowAllFiles TRUE
tobin:~ brandon$ killall Finder

Now you can actually see all of the directories which start with periods, etc. Enjoy!

How To Repair User Permissions In Mac OS X

Monday, July 2nd, 2007

I’m in the process of setting-up a new Apple MacBook Pro today, and during the process of trying to import and get some old SSH keys working correctly I accidently changed the permissions on my home directory. Even after scrolling back through the commands I used I’m still not even sure how it happened, but nonetheless I had to find a way to fix it.

Anyhow there are several symptoms you’ll see if the permissions are wrong in your user folder such as:

  • If you’re browsing to your home folder using Finder and get a message like ‘The folder “username” could not be opened because you do not have sufficent access privileges’
  • When trying to access your home folder in a terminal, you keep getting redirected back to /

Basically if you can’t access your home directory in Mac OS X, this blog entry is for you. There is a “repair permissions” utility in OS X but it does not repair permissions for user directories, so you have to take care of it manually.

To repair a specific users permissions in Apple OS X, type the following command in a terminal and replace “username” in the command below with the name of the users permissions you need to fix:

[code]
$ sudo chmod -R ug+rwX /Users/username
[/code]

You’ll need to reboot so that Finder will pick-up the permission changes, but that should clear-up any user specific permission problems if you are locked out of your home directory.

Dell Dimension E520 With Ubuntu Linux Review

Monday, June 25th, 2007

As mentioned earlier, I finally broke down and ordered a Dell Dimension E520 with Ubuntu Linux to replace my doddering primary workstation which is four years old at this point. Rather than writing a review right after opening the box, I thought I’d use the new rig for a few weeks and kick it around a bit before summarizing my experiences with the new machine.
Dell Dimension E520 Although I’ve read a couple of reviews of the XPS system here and there, I thought I’d go ahead and post my experiences with the least expensive Dell Ubuntu workstation, the Dell Dimension E520.

The Aesthetics

One thing I noticed as soon as I took the machine out of the box– it’s actually built quite well for an inexpensive workstation. The sides are made from fairly sturdy metal panels, and the general fit and feel was much better than I expected. This is not a machine I would be afraid to put in a car and move across the country with, or use as a doorstop when it gets old.

At the same time I think the majority of Dell’s system designs for the past year or so have been terribly corny and gaudy ripoffs of Apple. I think the only brand identity that Dell has with their hardware is to use a bunch of different colors and grades of material, and then top it off by making sure it says DELL. YES, ITS A MOTHERFUCKING DELL. HEY, LOOK, I’M STILL A DELL everywhere. For the price I can’t complain, but I think Dell could certainly stand to continue to try and make their machines look less like IM IN UR HOUSE LOOKING LIKE UR COMPUTRON, and more like something you don’t mind having on display. I think recent designs of LCD TV’s are a good example of this.

I’d take some photos of the new machine, but with 3 other machines on my desk (a server, my old workstation, and my work laptop) there’s just too much chaos on my desk for such things.

Ubuntu Installation & Configuration

There’s really not much to report here, though it was certainly pretty painless compared to the recent experience I had installing Ubuntu Feisty on a Lenovo T60. When I booted-up the machine some sort of Dell looking screen appeared that I had to agree to, and then the Ubuntu installation started. Admittedly it’s been awhile so I can’t remember every exact detail, but essentially there were only 4 install screens which let me set things such as time zone, keyboard layout, currency, and language preference, and it was pretty much done.

Once it rebooted I was somewhat disappointed– the display did not account for the Dell 2007WFP 20″ widescreen monitor I ordered and would only display in 1024×768. This would be a complete show-stopper for the average computer user, and I couldn’t believe that this wasn’t something which was accounted for in the installation process.

Also missing was the restricted driver for the Nvidia video card. This oversight is certainly debatable, but it also goes to show that there wasn’t much time put into tweaking the shipped version of Ubuntu to be Dell friendly (at least on the Dimension E520). I ended-up having to do the dreadful task of poking around in xorg.conf to get the monitor and video card to play nicely with each other, and now I’m using it in 1680×1050 glory.

After finally getting the resolution tweaked, I got all of the multimedia foo in working order by installing various codecs and applications using Automatix. I also installed VMWare Server and created a Windows XP virtual machine just because I could and also attempt to push the new hardware a bit, but I have yet to really do anything in the Virtual Machine other than get updates installed.

I’m still waiting for the whole Compiz / Beryl merger to happen with an actual release, so I haven’t played with the window effects at all. I did install Synergy which was quite painless and can now use the same mouse and keyboard as well as copy and paste across two other machines. Very nice!

Life With Ubuntu

Being that I switched to using Ubuntu as my primary operating system at home last year, and use it on my work laptop for writing software, I pretty much already knew what to expect. For the most part Ubuntu provides you with ways do do almost everything you can already do with Windows, including:

  • Surfing the internet and using various instant messaging protocols
  • An office suite for Word Processing, Spreadsheets, etc
  • Support for removable media such as USB drives or Flash Memory cards from digital cameras
  • Image editing and photo management
  • Managing your iPod and music library
  • Support for video, music, flash, and more via Automatix
  • The ability to burn CD’s and DVD’s
  • Built-in support for printers and other devices

About the only thing I can’t do with it at the moment is manage my Samsung Blackjack smartphone. I’ll probably keep my old Windows XP box around specifically for this purpose. Otherwise, Ubuntu has been a really great choice for me. In fact, one thing that surprised me is that it automatically installed a driver for and supported an old 3Com HomeConnect webcam I have which is about 7 years old now and almost impossible to find Windows drivers for.

Conclusion

I’m at a point in life where I just don’t have time to build machines from scratch and troubleshoot their idiosyncrasies, so I prefer to buy pre-assembeled machines. I seem to be a repeat Dell customer because their machines are reasonably priced, run quietly, and are generally built fairly well for the money. Also, because they are such a popular platform, it’s fairly easy to find people who have had similar issues as you (especially in regards to Linux issues) by a well crafted Google search.

For a price just a bit North of $1,000 including a nice monitor and free shipping, I’m very happy with my Dell Dimension E520 system and would recommend it to others interested in getting a new Ubuntu system. Just make sure you customize the machine with more than the base options so you’ll be happier with it in the long run, and search online for Dell coupons and try several different ones for the best deal before placing your order. Granted you might want to order a minimum amount of RAM and install your own as it’s quite a bit cheaper to do so.

At the same time, I don’t think Dell did a very good job of integrating Dell specific needs into the install process. I think that Ubuntu Linux is good enough once configured correctly by someone who knows what they are doing for 80% of computer users, and Dell missed a chance to show the general populace that there are choices beyond Windows DRM Dogfood and Mac OS. However, give Ubuntu a couple more years at the pace they’ve been innovating and maybe they’ll take care of it themselves.

Et Cetera

If it’s of any comfort, I have no association with Dell and just wanted to present my honest experience. If you liked the article or also have a Dell E520 and are a new visitor, please come back as I’ll be posting tips and how-to’s for a few configuration issues I came across along the way with this machine and will do my best to keep this post updated. You can also subscribe to my RSS Feed.

How To Display Linux VPS Memory Usage

Wednesday, June 20th, 2007

In my experience, the hardest thing to work around when using a VPS for hosting is limited memory. It’s definitely a challenge to try and tune a database, web server, and application server for load under the constraints of a VPS plan (typically 512 MB or less of RAM). The best solution I came-up with was to use a baseline of about 70% of my guaranteed memory quota when the various servers started up, with 30% of my guaranteed memory free for high traffic situations. This seems to be working for me pretty well so far, especially considering that my memory usage can theoretically temporarily burst to 300% of my guaranteed memory quota.

However hosting in a VPS can present some challenges when trying to determine load and memory usage for your VPS. For instance, when using top, the memory statistics displayed represent the whole server and not your VPS. That said, I’ve only found one way to get an idea of what my memory usage is, how much I have reserved, and how much my VPS is allowed to burst to via command line is this script:

[code]
#!/bin/bash
bean=`cat /proc/user_beancounters`
guar=`echo “$bean” | grep vmguar | awk ‘{ print $4;}’`
burst=`echo “$bean” | grep privvm | awk ‘{ print $5;}’`
priv=`echo “$bean” | grep privvm | awk ‘{ print $2;}’`
let total=guar/256
let used=priv/256
let burst=burst/256
echo “VPS memory usage:”
echo “Used: $used MB”
echo “Total: $total MB”
echo “Burstable to: $burst MB”
[/code]

As far as I know this should work under any Virtuozzo Linux based virtual private server, but let everyone know in the comments whether or not it works for you on your given platform.