Blogs


 

I have always noticed that when people ask the question 'How do I figure out how much hard drive space I have left' as it relates to the Linux / *nix shell, people always respond telling people to use the following command:

df

Output:

$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb5             56870784  22222576  31759324  42% /
...
/dev/sda1               252960    122460    130496  49% /media/sda1
/dev/sda3            1441394492 1372242748  69151740  96% /media/sda3

In the above example, everything is hard to read since it's in units of one thousand bytes. On some systems this defaults to multiples of 512 bytes unless you specific the -k option. I'm surprised that they don't mention that if you add one simple switch (-h for human readable), you can make the output much easier to read on most systems:

df -h

Output:

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb5              55G   22G   31G  42% /
...
/dev/sda1             248M  120M  128M  49% /media/sda1
/dev/sda3             1.4T  1.3T   66G  96% /media/sda3

In the above example, you can see that I've used 1.3 terabytes of my main system drive, leaving me with 66 gigabytes free.

Side Note: You can also find out what file system type you are using by running the following command:

df- T

And it will produce the following results:

Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/hdb1     ext3    19228276  14737848   3513680  81% /
tmpfs        tmpfs      383960         4    383956   1% /dev/shm
(The second column is the type)

You can use the following command to remotely start music playing on XBMC. The examples below were sent while I was SSH'ed into the XBMC machine. As you'll notice from the music paths, I am using some of the 'special' paths which call up the LastFM tags of Rap and Alternative.

Start the LastFM Rap tag playing:
xbmc-send -a "PlayMedia(lastfm://globaltags/rap)"
Start the LastFM Alternative tag playing:
xbmc-send -a "PlayMedia(lastfm://globaltags/alternative)"

To play a tag that contains a space in it's name, you must URL encode the space in your request (eg. replace all the spaces with %20). For example:

Start the LastFM 'Classic Rock' tag playing:

xbmc-send -a "PlayMedia(lastfm://globaltags/classic%20rock)"

I should note that each LastFM request is mutually exclusive of the other. Meaning each time you send a new PlayMedia request, the old genre/tag will stop playing and the new one will start playing.

I'll add to this later when I start documenting some of the various URLs and functions that can be used to start playing music. A list of functions that can be sent can be found on the XBMC wiki.

After running an upgrade 'sudo apt-get upgrade' and 'sudo apt-get install xbmc' to get my system up to date (to the latest SVN) I started getting the following error:

XBMC needs hardware accelerated OpenGL rendering.
Install an appropriate graphics driver.

Please consult XBMC Wiki for supported hardware
http://xbmc.org/wiki/?title=Supported_hardware

The first time I had this happen to me, I spent a number of hours trying to figure out how to get my system back up... but by 3 am I gave up. The next day, I reran the XBMC Live installer and got my system back up. This time, I didn't want to have to redo all the changes I made, so I wanted to fix things. I did a bit of research and this time I tried to directly install the nvidia drivers right away before mucking around with my configuration.

See below for some short instructions on how to upgrade your existing XBMC Live installation to the latest SVN version. These instructions should also work for regular XBMC Linux users as well. It is particularly important to update your XBMC to the latest SVN version if you plan on using some of the latest and greatest plugins and skins. For example, after I installed the Aeon65 skin I noticed that the skin would crash when I would go to certain views... many of the people on the forums recommended upgrading to the latest XBMC build so I did exactly that...

It's relatively easy to setup samba shares on XBMC Live, but it does require bashing out some commands on the shell. First, you'll need to install samba using apt-get:

sudo apt-get update
sudo apt-get install samba

Then, you'll want to configure your shares by editing the the file named smb.conf, placed in the /etc/samba/ directory. For example, I added the user folder and media folders to be available shares by running the following command:

sudo nano /etc/samba/smb.conf

Scroll down all the way to the bottom of the file, then paste in the following (use right click in Putty to paste something from your clipboard):

[xbmc]
 path = /home/xbmc
 public = yes
 guest only = yes
 writable = yes
 browseable = yes
 force user = xbmc
 inherit permissions = yes

[media]
 path = /media
 public = yes
 guest only = yes
 writable = yes
 browseable = yes
 force user = xbmc
 inherit permissions = yes

After that, restart the samba server using:

sudo /etc/init.d/samba restart

Update: It looks like this has changed in the more recent versions of Ubuntu that the XBMC Live distribution is packaged with (10.04). You can restart the samba service using the old method:

sudo service smbd restart
sudo service nmbd restart

Note: I updated the samba configuration above to include the 'force user' and 'inherit permissions' features as I was having trouble with newly created files not getting the right permissions and logging into samba.

Also, when accessing the shares from Windows, if you left the default security options you can use the account 'guest' with no password to access the shares. Otherwise, you can play with the settings to force a local linux account to be used in order to access the shares.

Subcategories

By default, my latest blog posting will show below. A list of links to more of my blog postings follows just below the full-text blog article.

About Me

Josh Lyon Profile Picture

Name: Joshua Lyon
Birthday: August 8, 1985
Location: Valley Ranch (Irving), TX
E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
ProfilesGoogle, Twitter