Archive for the ‘ Linux ’ Category

Dropbox + eXtplorer: A better web interface

Ok, so I found myself online at a workstation without admin access the other day and needed desperately to edit a file on my Dropbox account, it was just a plain text file and the edit was only small, so I set about finding a way of doing it, and came up with this as a temporary solution until Dropbox have a fully functional, released API…

preview image

P.S. The error was actually caused by a non-standard character in the filename (+). I’ll be filing a bug with eXtplorer for that :)

Documentation (Wiki) can also be found here.

NOTE: Replace [user] with the username under which the Dropbox folder is located.
NOTE: Replace [FQDN] with either your IP address or the hostname (or FQDN) which you’ll be using to access the interface.

NOTE: This HOWTO assumes that you will be running apache as the user ‘apache’ and that you have already set up your Dropbox account syncing to your /home/[user]/Dropbox folder

To get Dropbox running with apache and extplorer you need to get the following packages:

yum install php httpd

Make the VirtualHost director and get permissions / groups correct:

mkdir /var/www/dropbox
chown apache:apache /var/www/dropbox
usermod -aG [user] apache
usermod -aG apache [user]

Now create and populate an apache virtualhost config file:

vim /etc/httpd/conf.d/dropbox.conf

Populate it with the following text:

NameVirtualHost *:80
    <VirtualHost *:80>
        DocumentRoot "/var/www/dropbox"
        ServerName [FQDN]
        <Directory "/var/www/dropbox">
            allow from all
            Options +Indexes
            AuthType Basic
            AuthName "Dropbox"
            AuthUserFile /var/www/passwd
            Require valid-user
        </Directory>
    </VirtualHost>

Now add a username / password to access your interface via HTTP auth:

htpasswd -cm /var/www/passwd yourusername
chown apache.apache /var/www/passwd

Make sure that apache has full group access to your Dropbox folder.

chmod g+x /home/[user]
chmod g+rw /home/[user]/Dropbox
find /home/[user]/Dropbox -type d -exec chmod g+x {} ;

Download the latest version of eXtplorer from http://extplorer.sourceforge.net/

cd /var/www/dropbox
wget http://heanet.dl.sourceforge.net/sourceforge/extplorer/eXtplorer_2.0.1.zip
unzip eXtplorer*.zip

Check we haven’t made any mistakes and set the services up:

service httpd configtest
service httpd restart
chkconfig httpd on

You can now log into http://[FQDN] using a browser and the default credentials (admin/admin) and set up your user, pointing the user’s “Home directory:” at /home/[user]Dropbox. Once you have set up your user you have the choice to remove the HTTP authentication which we included in the VirtualHost configuration above. Simply comment out (or delete) the following lines from your /etc/httpd/conf.d/dropbox.conf file:

AuthType Basic
AuthName "Dropbox"
AuthUserFile /var/www/passwd
Require valid-user

That’s it, you’re done!

Yum restore script

Ok, so I’m about to do a reinstallation of Fedora (I made a boo-boo which would be easier to fix by a re-install than go through manually and try to fix). I have backups, but not of the lib folders etc, I do however have backups of the uber important folders e.g. /etc /home /root etc. Anyway, I want to do a minimum-fuss reinstall, and decided to write a wee script which would take a list of all my currently installed packages and make a nice simple exectuable bash script so that once I’ve set up the repos on the new system I can simply execute this script, it’ll install all the packages I have now, then I can just restore my /etc/directory on top and hey-presto, I’ll be back to a nicely functioning system.

So without further ado:

#!/bin/bash

INSTALLED=/tmp/yum-installed

LIST=/tmp/list

EXECUTABLE=/home/rob/yum

USER=rob

GROUP=$USER

UNATTENDED_INSTALL=yes #yes/no

cat /dev/null > $EXECUTABLE

sudo yum clean all;sudo yum list installed | awk -F' ' '{print $1}' | sed 1d | sed 1d | sed s/.i386// &> $INSTALLED

exec 3< $INSTALLED

while read <&3

do

echo -n "$REPLY " >> $LIST

done

exec 3>&-

# Create the yum installation script file

if [ $UNATTENDED_INSTALL = "yes" ]

then

OPTION="-y"

fi

echo "#!/bin/bash" >> $EXECUTABLE

echo -n "$REPLY " >> $LIST

echo "sudo yum clean all;sudo yum install $OPTION `cat $LIST`" >> $EXECUTABLE

# Set correct perms

chmod +x $EXECUTABLE

chown $USER.$GROUP $EXECUTABLE

# Cleanup

rm -f $LIST

rm -f $INSTALLED

Obviously edit the vars at the top to suit your setup etc - then just sudo (or execute as root) the $EXECUTABLE

Songbird sings

So, as I wrote in my last entry I installed Fedora 10 on my main desktop earlier in the week and I have to say, I can really see it staying there. The reasons behind my switch over from Windows are too numerous to detail – predominantly Fedora 10 will be used as the bedrock from which RHEL 6 will be carved, moulded and created and I’ve been stuck in RHEL 5 land for a long time without keeping up with the changes that have been going on in the world of Fedora. The past few Fedora releases have been a little shakey (imo) however Fedora 10 got some special love with regard to bug tracking and resolution. And it shows with reviews coming in from left right and centre praising the release.

The main reason I can see myself sticking with linux this time around is due to the fact that there are now real, viable alternative apps for the “killer” apps which I use on a Windows desktop – the best example of this (as you’ve probably guessed already from the title) is Songbird. This is the killer app for me when it comes to music management on linux. As much as I hate Apple I have to admit, I do use iTunes on Windows to organise all my music. The last time I tried Fedora 9 I gave Songbird a spin, which back then was still in ‘beta’, i.e. pre-version 1.

songbird

As you can see Songbird v1 is very much like iTunes, from a layout perspective, however it far far excels, as it’s based on the Mozilla platform, it gains from the inherent web-based functionality which comes with including a web page rendering engine. The result is a completely integrated audio application. The best function (imo) is the ability for artist info to be displayed in the window, along with youtube videos, news and photos. Also Songbird takes the best from Firefox in that the application is highly extensible – for example the album art carosel you see at the top of the window is an extension, you can either choose to install it, or not. Customisation is key, and Songbird use it very very effectively. Songbird has all the functionality of iTunes and then some. I should probably add that I don’t have an iPod and don’t use Songbird to sync an iPod, however there is an extension available which will do that very thing. For more info you might want to read their version 1 release blog post which details the major features / improvements made recently.

Being cross-platform, I’m 100% certain that I will not be switching back to iTunes, since I’ll be able to simply port everything between OS’s. Sterling work Songbird – keep up the awesomeness!