Showing posts with label System.Administration. Show all posts
Showing posts with label System.Administration. Show all posts

Monday, August 25, 2008

HOWTO: Easy music sharing (or anything else you want)

This is a quick HOWTO describing an easy setup for sharing files in a home network with no security and no headaches.

There's a popular Ubuntu Howto which uses anonymous FTP and some other stuff, with lots of downloaded scripts. I'll make everything a lot simpler for you than following that one.

Objective: To have music files served through DAAP from a server that everyone can access to add new albums to. There's no configuration on the client and very little on the server. There's no security. Anyone can change or delete files.

Procedure:
Create the directory you want to share music from.
# mkdir /home/Music

You need to install Apache 2 and ZeroConf support for it.
# tasksel install web-server
# aptitude install libapache2-mod-dnssd

Next, you need to enable the DNSSD module
# a2enmod mod-dnssd

Edit your /etc/apache2/sites-enabled/000-default file and add the following two lines to the beginning of the file:
DNSSDEnable On
DNSSDAutoRegisterVHosts On


Add this to the bottom of the file:
<Directory /home/Music>

    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

Alias /Music "/home/Music"
<Location /Music>
    DAV On
    DNSSDServiceName "Shared Music"
    DNSSDServiceTypes _webdav._tcp
</Location>


You can change the name or the directory path if you like. You can even add five or six of these definitions if you want to.
Change the shared directory to be owned by the web server so that there are no permission problems.
# chown www-data:www-data -R /home/Music

Restart the web server. Be careful. Read the output and make sure that it starts correctly.
# /etc/init.d/apache2 restart

Go to Places > Network and find your share there at the top level. You can right-click to mount it ("Connect to this server").

You're finished. No scripts to download. No hacks. Just WebDAV and Avahi.

If you want to server the Music the ZeroConf way to a client, install Tangerine (which comes with Mono and GTK ... What a waste!). I prefer mt-daapd, but it's not available in the repositories anymore.

It uses a graphical configuration client. If you don't want that (I don't), you can create a .tangerine file.

[Tangerine]
name = Shared Music
password_file = /home/Music/.tangerine-passwd
debug = False
max_users = 0
log_file = /home/Music/.tangerine-log
port = 0
publish = True
plugins = file,session
[FilePlugin]
directories = /home/Music

and then start tangerine.
$ tangerine /path/to/.tangerine

Open up your Rhythmbox and look over the music. It may take a few moments to come up.

Happy sharing!

Sunday, August 24, 2008

Easy File Sharing

Let's talk about setting up file sharing on Debian/Ubuntu, shall we?

Since I finished the pre-seeds I was working on, and I'm still on vacation for a few more days, I decided to really get to work on my Debian2Debian project I've been mulling over for a while. It needs simple file sharing.

The concept of the project is that there should be a simple Debian server which works really well with Debian clients, particularly in a home setting. At the center of this is easy file sharing .... Well, not exactly. The server setup is going to be static, so that can be complicated, but the clients need to recognize the shares automatically. So I've had a dilemma for a while.
  • Samba is easily the most elaborate system, and it offers automatic discovery, but scanning the "Windows Network" in Nautilus takes a long time, and I wanted to use something faster and simpler.
  • NFS is has the best pedigree on *nix, but it needs setup on the client (as far as I can tell ... I've been searching on this for a month on-and-off). If I can avoid setup on the clients, that would be best.
  • FTP is scary for me. Sorry. It has an awful history.
  • WebDAV using Apache seems doable, but I'm still looking into it, which is what this post is really about.
Right now, I'm looking at the gnome-user-share and gshare utilities on Gnome for some inspiration. The first seems to fit my bill, and spawns Apache WebDAV on a random port, then updates Avahi with notification. It also has stuff like Bluetooth that I'm not at all interested in, so I'm just going to script something at the server's startup.

The following folders will be shared by the server:
  • Documents
  • Music
  • Pictures
  • Videos
  • Backups
Sounds remarkably like the XDG Folders? Hmm. Could be. I'll look into localization of the sharing later. I may be able to use xdg-user-dirs-update to help me with that.

I need to get DAAP and DAPP on these folders after that. Rhythmbox will then just see and play the Music share. The new F-Spot should identify the Pictures share. How do I seamlessly share the videos? I'm working on that one.

If you want to easily share files with someone else on Debian, Ubuntu, or OS X, install gnome-user-share and configure it at System > Preferences > Personal File Sharing. It's so dead simple that I'm not even going to tell you what to do, I'm just going to give you the screenshot.
When you're finished, put the files you want to share in ~/Public. Your friend/S.O. can see them in Places > Network.

Wednesday, March 26, 2008

Changing the Configuration Situation in Linux

If you're a fairly experience Linux guy, you'll be able to wander around in /etc and find the configuration file you need with no problem. The common ones rarely change position and the formats have stayed relatively stable for years. The first time you run into a configuration file for a program, it may take a little while to work with. You may even need to open the manual on the program to find where the configuration is located in the odd instance where the location isn't obvious. Most use some kind of plain-text shell configuration, but plenty write in XML these days, too, and the comment syntax varies. That's nothing mind-blowing, but it's kind of a pain.

What if the configuration for every program were (Unixly) available in a comprehensible directory structure, kind of the way /proc and /sys work now.

You've got a kernel panic? Try:
echo 2 > /proc/sys/net/ipv4/route/gc_elasticity
echo 1 > /proc/sys/net/ipv4/route/gc_interval
echo 131072 > /proc/sys/net/ipv4/route/gc_thresh

I's that easy to change the kernel's runtime configuration.

Tip: Echoing something into /proc/cpuinfo won't actually give you a multi-cpu setup on your rig! ;)

What if finding out the root filesystem type was available at system/filesystems/rootfs/type? The configuration information for your default site in Apache might be located in daemons/apache/default/.

Does it sound interesting? While I'm on the fence, it's certainly intriguing.

Well, that's the proposal from Markus Raab that appeared on Freedesktop.org's XDG mailing list today. Elektra is the vehicle that's supposed to make this all possible, and he's pushing it for inclusion into the Freedesktop specifications. The upside for this is that the configuration information is not limited to /etc level stuff: if the spec becomes reality, KDE, Gnome, XFCE and other compliant window managers and desktop environments could be configured, too. What to change the current user's wallpaper?

kdb set currentuser/desktop/background "/usr/share/wallpapers/1.jpg"

Does that remind you of GConf? Yeah? I was sure it would. I don't see any real difference, except that we're abstracting out the entire configuration for everything on the machine. GConf has enough detractors that I doubt it's going to pass.

It sure would be a different Linux world, though, wouldn't it?

Friday, December 21, 2007

Dell Moving Forward With Ubuntu 7.10

While I've been pragmatic about Ubuntu 7.10 -- it has many great new features and an equal number of new piquadillos -- I think Dell putting it on their Ubuntu anemic line-up is a good sign of company support for the line.

Most notable in the announcement is encrypted DVD playback via bundling of a proprietary DVD player called LinDVD and the inclusion of a DVD recovery image which doesn't need to take up your precious hard-disk space.
:)

Tuesday, December 4, 2007

Back up your data

Urgent help needed - data retrieval - is the data gone?
Hi everyone

I was trying to install Ubuntu on the D drive of my sisters computer. However when it came to installing Ubuntu from the live CD I stupidly chose guided partition. The partition was aborted (rather late) and I know that one partition (a recovery partition) wasn't deleted.

How much data is retrievable after reformatting a drive (from NTFS to ext3)?
How can I get it back?
Do I need to go (and pay) to a data retrieval specialist?


The Hard drive contains 1 year and a half of my sisters work (doctor researching aids in Africa). It is essential that I try to get this data back...

Thanks for any help


I'll repeat the title of this post. Back up your data. Back up your data. Back up your data.

Always do a backup of important data before repartitioning. Always.

The bad news is that our friend probably overwrote large portions of the data. At least he caught the mistake later on and aborted before the entire process finished. Depending on the program that was used, the remaining data may or may not be usable: if the data was compressed (likely), the achive might not be recoverable.

Best of luck to him.

Always back up before a potentially dangerous activity.

Install SimpleBackup now.

Tuesday, November 27, 2007

The Pain of Loss

Last week, our network at work was down for 95% of the time due to a worm infestation that installed a backdoor and countless other pieces of malware. The worm spread to almost every computer in this location and IT's attempts to eradicate it failed every time. The IT department eventually decided to reinstall every computer in the building (except mine, of course) and restore from backups.

It didn't work. The backups were infected, too.

I just watched as the woman who sits next to me sobbed for 15 minutes because the last few weeks' work (at least -- I don't really know the whole time frame) was completely lost and she's going to have to recreate it, probably on her own time. I guess the oldest backups available may be infected, too

The drama is still unfolding, and she's started crying again.

Depression.

Windows XP + untrained IT staff.

Meh.

The autistic nerd in me is just happy that the pain isn't mine.

Other I' Been to Ubuntu Stories

Related Posts with Thumbnails