Open files as root (the easy way)

1 Comment | This entry was posted on Dec 06 2008

I ran across a couple of tips in Linux to open a file as root without having to use a terminal. The first is a shortcut on your desktop. To make this one just right click on your desktop and then select “Create Launcher…”. When the dialog box pops up you can put in whatever you want for “Name” and “Comment” but for “Command” just put in the following command.

gksudo “gnome-open %u”

Now to open a file as root all you have to do is open the file location and drag the file to that shortcut. The system will probably ask you for your root password and then open the file as root.

A easier way is to browse to ~/.gnome2/nautilus-scripts/ and create a new file called “Open as root”. Edit the file and put


inside the file. Right click on the file and go to properties -> permissons then check the box that says “Allow executing file as a program”. Now all you have to do is right click on a file you want to open as root, go to scripts and click “Open as root”.

I just wanted to pass these along cause I thought they were very helpful.

How I stay digitally organized: media files

2 Comments | This entry was posted on Dec 03 2008

As a follow up to my “How I stay organized post” here is how I keep my music, pictures, and videos organized.
First I need to talk about where/how to store important files like media files. All of my media files are stored in one place as a master and multiple other places as copies. I keep my master copy on my home NAS and then I have secondary copies on my laptop, desktop, and MythTV. I also keep a backup of the master on one of my USB hard drives and a second backup on my webhost (no you can’t have access). This is the ideal way to keep this information backed up for me. If I ever find a file that is labeled wrong I change it on the master copy and eventually it will filter down to the copies. Storing everything in one place has helped my organization habits more than anything.
My music folder is organized with the following folder structure.

In order to keep all of that organized I had to make a standard naming scheme for all my files too. Here is what I chose. My album folders are named %Artist% – %Year% – %Album% and my songs are named %Artist% – %Album% – %Track% – %Title%. I chose this naming scheme so that if a file gets lost somewhere where it does not belong, which they often do with this many computers, I can easily find where it goes. Two extra things that I make sure all my music folders have is every album folder has a folder.jpg file of the album cover art and every artist folder has a copy of the folder.jpg named after each album I have. For example I have the artist Bush. Inside of that folder I have two folders for the two albums I have and two pictures for those albums. This way when I view the artist folder I can see what albums I have without even opening the folder. This doesn’t work so well in OSX or Linux but works great on my Windows machines and Xbox Media Center.
I have used TagScanner to edit all of my songs by hand. Yes it has been very tedious but I have yet to find a automatic tagging system that did well for me. I also use TagScanner and Album Art Downloader to embed album pictures into all of my songs. This took a while but is worth it when you see the album art in XBMC, on an mp3 player, or any other player that supports viewing album art from within the ID3 tags.
My pictures are stored in folders with the “Date (Event)” so Halloween is “2008-10-31 (Halloween)” This sorts my pictures by date taken, and then with a description of what the event was. If the event is multiple days I use the first day for the date and then I have sub folders for day 1, day 2, etc. I keep a few category folders for folders I don’t want to have to sort through every time I view my pictures. Some of the main folders I have are Automotive, Desktops, Misc, Downloaded, and folders for Beth and I. Desktops and Automotive are pretty obvious but Misc is for 1-2 pictures for a event, screenshots, icons, and drawings. Downloaded is for fun pictures online that I have found. :) The user folders are for project pictures and other misc stuff that Beth and I want to keep.
Finally, videos are stored by type. Not filetype but more source type. Movie, TV, Web, Shot are the main categories I have. Most of my shot video is actually in my pictures folder with the event it is tied to.
Once all my media is organized on one source it is fairly easy keeping it maintained (so long as I am the only one writing to the NAS). Got any tips or questions just let me know in the comments.

Well that was stupid…easy MythTV fixes

2 Comments | This entry was posted on Nov 23 2008

Just a real quick tip for anyone having problems watching live TV or recording shows in MythTV. After a fairly fresh install I could not watch live TV. My screen would go black for a second and I would be kicked back to the main menu. I also was not able to record shows. The recording would show up on the schedule but nothing would happen when the time to record would actually come. So my tip is check your log files!!! They are stored in /var/log/mythtv (at least they are in ubuntu). You should have mythbackend.log*, mythwelcom.log, and mythfrontend.log* in that directory. The log files are incremented making the highest number the oldest file and the one without a number your newest file. So check the newest file first.
As for my problem I checked my frontend log first, but I didn’t see much information besides the fact that I changed skins. So I decided to check the backend. Here is what I found.

2008-11-23 10:26:22.432 TFW, Error: Opening file '/media/mythtv/recordings/1941_20081123102621.mpg'.
eno: Permission denied (13)
2008-11-23 10:26:22.436 TVRec(1) Error: RingBuffer '/media/mythtv/recordings/1941_20081123102621.mpg' not open...
2008-11-23 10:26:22.437 TVRec(1) Error: CreateLiveTVRingBuffer() failed
2008-11-23 10:26:22.438 TVRec(1) Error: Failed to create RingBuffer 1

Now this may not be too obvious to most people but take a look at “Permission denied (13)”. DOH! I forgot to give my user permissions to the directory I set up to record my shows in (as well as my live TV folder).

sudo chmod 777 /media/mythtv/*

and now I am able to watch live TV and record whatever shows I feel like.
Just thought I would save you the hassle if this happens to you.

How I stay digitally organized: downloads and files

1 Comment | This entry was posted on Nov 21 2008

I was inspired by download squads post on getting a hard drive organized and I thought I would post how I keep all my many computers organized. I hope to follow this up with a couple other posts about how I keep my cloud life organized and how I keep my media files organized but, first lets tackle local files.
To explain how out of hand my files can get, here are the computers and storage devices I use regularly: work laptop (with 2 OS’s), work desktop, home desktop, MythTV computer/NAS, wife’s laptop, wife’s desktop, numerous memory cards, 2 external hard drives, a home NAS, network drives at work (8), backup CD’s, a original xbox (which stores more than you’d think), and obviously this website/server and more email addresses than I want to admit to (or even know exist).
So lets start with how I keep my files organized on the computers I use the most. My work laptop and work desktop.
The first thing I always try to remember on my work computers is anything and everything on my work laptop and work desktop are counted as files I can lose at any time. I do not keep them backed up as often as I should because I use these computers mostly for work purposes. If I lost my job or either of my hard drives failed all of the files would be gone and I am fine with that because all of my important files are backed up somewhere else. Both of my work computers are running Windows Vista and I had to create some extra folders in my user profile to stay organized.
The first folder I make is install. This is where I keep my most used program installers that are not updated too often. Programs like Firefox, Filezilla, and Pidgin are all updated far too often for me to keep installers for them but more random/large installers I want to keep around for future use so they go in this folder. Inside my install folder I have the following subfolders: Backup, Game, Hardware, Operating System, Software, and Windows Mobile. The backup folder is not where I store backups from the local computer but usually backups for other computers/memory cards. This folder structure is almost identical to one of my external hard drives. The external hard drive keeps a much more permanent set of installers and backups but my laptop is just for programs I install often. The other folders in my Install folder are pretty self explanatory.
The second folder I create is a scripts folder inside my user folder. I have debated naming this projects because it is where I keep scripts/programs I am writing and general tools that I make for myself. For now though I just put scripts in that folder.
The last folder I make is my work folder under documents. This folder is simply for work related documents (pdfs, spreadsheets, etc.). I don’t keep a lot of work documents on my laptop because they are generally stored on my network drives at work. This folder is just for documents that relate specifically to me such as expense reimbursements, system logs, and checklists.
The last set of folders I make are in my downloads folder. Inside downloads I create a Firefox, torrent, FTP, and dropbox folder (the desktop and Starcraft folders in the screenshot are only specific to my laptop and are there for quick access). I then tell each appropriate program to put the freshly downloaded files in the correct directory (dropbox is a writable samba share folder). Once I have all the folders created I add a toolbar to the Windows taskbar for easy access because this is probably my most used folder. This is also usually my biggest place of disorganization because I download things frequently. I have found, however, with this organization it is very easy for me to go through old files and delete them with ease. I used to use Belvedere from Lifehacker but I found I did not like my files moving on their own.
My linux computers/partitions have similar folders in the home directory and my wife’s computers she keeps organized as she wishes but usually keeps important files on the NAS at home. I will go over organizing media files next.

Buying a NAS part III

0 Comments | This entry was posted on Oct 22 2008

Ok, it has been quite a while since my first two articles on this (Part 1 and Part 2) and I wanted to post a little update on my situation. I haven’t worked on my linkstation hard drive because I decided to go a slightly different route. Ultimately, I want something that has some sort of RAID set up for backup purposes but at this time I don’t have the time, money, or space for such a device. Instead I decided to use my MythTV computer as my network storage device on top of its current PVR functions. Because MythTV will be a full computer it will have a lot more features and options I can use to configure and set up the NAS exactly as I want. This will also mean that I only have to have one device on at all times instead of my originally planned 2 devices which will save a bit of money in power bills. I finally have a computer that is going to work for my new MythTV setup (more on that to come) so as I get that configured I hope to post some more how-to’s on my quest for the perfect cheap NAS solution.
Just so I get some of my goals in place here are my current needs for the NAS setup.

    1. Separate users to allow read only access to certain folders and write permissions to others.
    2. At least 500 GB.
    3. Upnp server to allow easy playback on my PS3, XBMC, WMP, etc.
    4. Under $300. While this is still a goal it is going to be quite skewed with my budget for my MythTV computer. I will try to add all the cost up correctly though.

Two more items were on my list from my first posting so I will echo them here as well.

    5. Be able to connect to a ethernet network without adapters. This won’t be a problem at all because my MythTV computer will be plugged into the network at all times.
    6. Low power consumption. While the MythTV computer will draw more power than my original Linkstation, the ability to get rid of the Linkstation in favor for just having one device will defiantly save power over having both devices turned on at all times.

So I haven’t given up on getting my NAS up and running but my plans changed a little. For now the Linkstation still gets used every day and it is helping a lot with temporary storage. I will keep the site update with my install notes and what has worked for me.

Create user template in OSX

0 Comments | This entry was posted on Oct 22 2008

After my last post I realized I have never explained (or documented for myself) how to create a user template in OSX. The best how-to I found was on Jim Epler’s Blog which I found via google. Here are his steps slightly modified

1. Tweak your default account including setting dock, clearing cache, recent items, etc.

2. Restart and login to the machine as admin.

3. Issue the following commands in the terminal:

:~root# cd /System/Library/User\ Template/
:~root# sudo ditto -rsrcFork English.lproj/* English.lproj.bak
:~root# sudo rm -rf /System/Library/User\ Template/English.lproj/*
:~root# sudo cp -R /Users//* /System/Library/User\ Template/English.lproj/
:~root# sudo chown -R root English.lproj
:~root# sudo chgrp -R wheel English.lproj

4. Restart, log in as admin and repair permissions before creating a new account to see if it worked.

Now all your new users that log into the machine (including mobile users) will have these same settings as your template user.

OSX 10.5 keychain and user templates

2 Comments | This entry was posted on Oct 22 2008

We decided to have our Apple computers joined to our Active Directory server so we have a little more control and our users have a little more continuity and features when using different machines. We also finally figured out how to set up a user template similar to Windows default user profile. A problem we ended up with was our user template had a blank password for the keychain access but we need our users to have their keychain password be the same as their login password. If the keychain passwords do not match, the keychain keeps popping up every time they need to use a password stored in the keychain.
To fix this you can simply delete the login.keychain file from the /System/Library/User\ Template/English.lproj/Library/keychains/ folder before a user logs in or you can just deleted the login.keychain from the /User//Library/keychains/ folder after the user has already logged in.
I just wanted to help with this problem before too many people got stuck with this like we did.
Leave me a comment if it worked for you or if you have any problems.

How-to tether Windows Mobile to Ubuntu

7 Comments | This entry was posted on Oct 16 2008

Another random site I found the other day had this little tip on tethering your Windows Mobile phone to Ubuntu.
Seems pretty straight forward. I haven’t tried it yet but I don’t think it would be too complicated.

apt-get install subversion
svn co
cd usb-rndis-lite/
sudo ./
sudo make install

Then you just need to go to internet sharing on your phone and plug it in. Whenever I have a chance to give it a try I will let you know if it works for me.
If you get a chance to try it leave me a comment and let me know.

Ubuntu CPU scaling

0 Comments | This entry was posted on Oct 16 2008

I ran across a good article on how to scale your processor in Ubuntu. For me this was turned on by default and it really helped my battery life on my laptop and now it is nice to know how to configure it.
Here is the link to the full page. I am going to echo the text here just in case the website becomes non-existent like so many good sites do.

CPU Scaling is a feature built into most modern (mobile) CPUs that allows them to scale up or down in how fast they run and how much energy they suck down based on demand. If you have a fairly modern mobile computer there’s a very good chance that your CPU(s) can handle frequency scaling.

Why should you care? Well, you can control this to tell you computer how much power and how fast it should allow it’s CPU(s) to operate. This can save some energy and thus battery life at the expense of a little performance – which is great for extending the use time of your laptop when it’s unplugged.

Can your CPU(s) handle scaling? There’s an easy way to find out. Open up a terminal session (Applications -> Accessories ->Terminal) and type or paste the following into it:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

On my machine I get back

1667000 1333000 1000000

Those are in Hertz, so my machine is capable of 1.66Ghz, 1.33Ghz and 1.00 Ghz.

Now that you know your CPU(s) can handle scaling, let’s see what modes are available. In the terminal, type or paste:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

Again, I get:

powersave ondemand userspace conservative performance

Powersave will keep the CPU constantly at the lowest frequency. Ondemand will set the CPU at the lowest frequency (in my case, 1.00Ghz) until use of the CPU increases, then it will automatically bump it up to the highest frequency (with me, 1.66Ghz). Userspace means that a different program will be used to control the CPU’s scaling. Conservative is where your CPU will go up as needed, starting at the lowest frequency, and then bumping up to the next available until it maxes out. Performance simply sets the CPU(s) at the highest available frequency and keeps it there.

The lower your frequency, the less power you use. So, if you’re bent on extending your battery life to the max, you’d want to keep your CPU(s) at their lowest frequency – but you’ll do this at the expense of computing power. In my case my 1.66Ghz processors would effectively be 1.00Ghz processors.

Now, how do you actively control this? It’s fairly easy. Right click on an empty space in your taskbar (where your applets and such things as Applications, Places and System are located) and choose “Add to panel”. From there, find the CPU Frequency Scaling Monitor. Double click on this and it will appear in your taskbar. Right click on it and choose Properties and you can set various options like have it show your CPU frequency as a frequency (i.e. 1.33Ghz) or as a percentage. If you have multiple CPU’s or a dual/quad core machine you can also choose which CPU to monitor.

To configure this applet to actually allow you to control how your CPU(s) scale, you’ll have to had back to the terminal.

Type this:

sudo dpkg-reconfigure gnome-applets

This will throw up a nifty blue screen asking you to say Yes. Do so. Then it will ask if you want to install cpufreq-selector with SUID root. Say yes. Once you’ve done this, go back to your CPU Frequency Scaling Monitor in your taskbar and left click it. You should now be presented with a bunch of options from which you can choose the one you want. You can also directly set the frequency at which your CPU(s) will run at, which can be handy if you want to scale up or down for a short bit and then manually change it again.

As you can see, I’ve got mine set to Ondemand, allowing the frequency to scale up through three different settings (1 GHz, 1.33 GHz or 1.66 GHz) as needed.

While this will take effect immediately, it will only be in effect until you reboot at which time your default settings will come back. To change the default head back into your terminal and type:


From there head to apps -> gnome-power-manager -> cpufreq. Find the settings policy_ac and policy_battery and change them to whichever setting you want for the default.

For those with multiple cores or processors who happen to be a bit needy in the info department (like myself) you can add an applet for each CPU. Just add as many applets as you have CPUs and then right click on them, choose Preferences and use the drop down to choose which CPU that particular applet is monitoring.

Now you know a lot more about CPU Frequency Scaling then you may have when you started reading this article and you know how to set it on your computer.

All credit goes to arsgeek at Hubpages.
While I didn’t use the applets the whole article is very well written and has lots of information.

Pidgin & Gtalk certificate

0 Comments | This entry was posted on Oct 14 2008

I use Pidgin for my chat client and I also use Gtalk. Usually there is no problem with this but I use Gtalk for my old Gmail account and also for my new email address for this website hosted by Google. I started having a problem connecting to my Gtalk account The problem was conflicting security certificates. Turns out Pidgin wants to keep one certificate per server (or that is how I understand it). I was still able to connect but every time I opened Pidgin I had to click a accept button for Pidgin to know it was OK to accept the second certificate for the connection. Well thanks to Andrei Neculau I don’t have to click that accept button anymore. Google has a second Gtalk server (really just a different address that points to the same server) and Pidgin will gladly accept a new certificate for this second connection. If you are having the same problem just set up one of your Gtalk accounts to point to on the advance tab of the account and you never have to worry about that conflicting certificate again.
Any other Pidgin hacks/tweaks you have just leave them in the comments. I love learning new things.