Sunday, January 07, 2007

SAMBA! Part 2, adding shares

This is the second part of the instructions for setting up samba (SMB) windows file sharing on Ubuntu Linux. You can go here for the first part, where we added samba and turned it on.

More instructions can be found here.
Open the terminal, and type this in:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
English translation:
sudo = temporarily give me more user privileges
cp = copy 1 file to another file (in this case, we are copying smb.conf to
smb.conf_backup
so we can revert to the old settings if we need to).

If you did it right, the terminal will not give you any response.
If you want to check it, you can go to /etc/samba/ and make sure the two
files are there.

Now, we want to actually edit the smb.conf file:
gksudo gedit /etc/samba/smb.conf
This is one of the most surprising things about Linux, and I think it's
very telling. In windows, it's kind of every man for themselves -
each software company does things their own way, whichever way is
most cost effective for them.
In Linux, there are some fundamental conventions that programmers follow.
Usually, but not always, there is a small file that gives you tons
of features and minuscule control over every aspect of a program.
It is a simple text file that usually has a .conf extension.
Programmers could trust you to edit the source yourself, since most
programs are open source, but then you would have to redo all your
work every time you upgraded. It's simple, elegant, and very common.
Combined with man, .conf files are one of my favorite thigs about linux.

Find the "workgroup = MSHOME" line under global, and
change MSHOME to whatever the name of your workgroup is.

Find the "; security = user" line under Authentication, and change it to this:
" security = user
username map = /etc/samba/smbusers"
The semi-colon comments out the line so it doesn't work.
We want username authentication to work, and we also want to
map usernames to the smbusers file.

We need to make three changes in the share definitions section:

uncomment the
"[homes] comment = home directories browseable = no" lines
uncomment the "valid users = %s" line
Find "writeable = no" in the Share Definitions section,
and change it to yes.


save your changes, close smb.conf, and type
"sudo testparm" in the terminal.
Sudo testparm will test smb.conf and make sure everything is correct.

If you don't have any errors, you can restart samba with a
"sudo /etc/init.d/samba restart"
init.d is a text file that holds initialization and termination
files for many programs.
The above command basically asks the init daemon to stop and start
samba for you.

A daemon is a unix term for a program that runs unattended.

If you want to change the name that appears in your workgroup for
your new fileserver, open back up the smb.conf file and look
for the "server string" line. Change that line to whatever
you want. %s is the name of the computer you used during install.

Labels: , , , , , , ,

Thursday, January 04, 2007

Convert WMA files to mp3 in 3 easy steps using iTunes!

A friend of mine asked me how to do this today, and I figured I'd share.

Convert WMA files to mp3 in 3 easy steps using iTunes!


I'm not in front of my computer right now (I'm at work, and they frown on iTunes), but if I remember correctly, this is how you do it:

1. Import the song like you normally do
you can go to file - add folder/file to library
This will add the file to your iTunes library as a WMA file, which iTunes handles just fine as long as it doesn't have any DRM (Digital Rights Management) on it. If it does have DRM, it will tell you or it will just fail to import it. If it's got DRM, then it is copyrighted, and I can't help you. I will also remind you that using any of the programs readily available on the Internet by searching google for something like "remove DRM WMA" is both illegal and immoral. It is also a violation of the DMCA, punishable by a prison term of up to 5 years and a fine of up to $500,000 per violation. Every time you make a copy of a song the terrorists win.

2. The default file format in iTunes to convert everything to is ACC. Since we want to change the WMA file to mp3, this is how we do it:
Go to advanced - importing
Change "import using" to mp3 (I usually use the higher quality - 192 kbps option here)

3. Go to your library and find the song you want to convert. Right click on it and select convert.


You will now have two copies of the song, the WMA version and the mp3. If you want to delete the WMA completely, I would listen to the mp3 first to make sure there were no errors.

Someone just pointed out to me that parts of this post are no longer accurate!
Now, if you have iTunes set to import using the mp3 filter, it will automatically ask you to convert a WMA file when you start to import it.

Labels: , , , , , ,

Wednesday, January 03, 2007

Samba! Or, how to install SMB (Server Message Block) (Windows) file sharing on Ubuntu Linux 6.10 Edgy Eft

More information on installing Samba can be found here.

The instructions sometimes tell you to use apt-get, but there are ocassionally bugs going back and forth between apt-get and the Synaptic package manager, so that's the way I am going to do it here. Besides, Synaptic is basically only a front end GUI for apt anyway.

#1
We are going to install samba (which is the linux version of windows network smb file sharing), which we want because we want to share files on the local network.
System - administration - synaptic
We might as well make sure we have everything updated.
reload - mark all upgrades
search for samba, mark it for upgrade, and do the same for SMBFS (samba is the program, and smbfs is the file system for samba). You should already have the samba common files installed, but add them if you don't.

#2
Open your terminal by going to:
Applications - Accessories - Terminal
Now we want to add at least one user to samba:

Code:

sudo smbpasswd -a system_username


English translation =
sudo (give me super user privileges temporarily)
-a add
system_username a username that already exists on your system

When you hit enter, it will ask you for a password. Enter one.

#3
Continuing to add a user to samba:
Code:

sudo gedit /etc/samba/smbusers



English translation =
sudo (give me super user privileges temporarily)
gedit open the program called gedit (which is a simple text editor)
/etc/samba/smbusers open the text file located here in gedit
Put the following line in the file:
system_username = "network username"
so, if your system_username from step #2 is BOB, and you want to use the samba network as BOB, then the line will look like this:
BOB = "BOB"
Save the file, and go back to your terminal

When you restart samba using this command:
Code:

sudo /etc/init.d/samba restart



you should be able to browse the new addition to your network.
Next time, we will actually set up samba to share files with windows machines.

Labels: , , , , , , ,

Monday, January 01, 2007

cool as fsck

This blog is going to be a journal of my trials and tribulations with installing and hosting a website.

I kind of sort of know what I am doing, if I'm going to be honest.
I've installed and run Linux before, but I'm by far not a guru. Hopefully, this will help someone else out. This time I am going to use Ubuntu, because it's user friendly, even if it isn't that old there is lots of help info on the web for it, and I really really prefer a Debian style package management system. I've used Red Hat/fedora (it was my first distro) and Mandrake before, but I prefer Debian/Ubuntu.
There are three reasons I'm doing this:
1. I want a record of what I do to the machine and when I do it (what works and doesn't work)
2. Maybe that information can help someone else out
3. I've always wanted to do a blog, but never really had anything to write about before

I'm also going to write about other miscellaneous things along the way. Hopefully, I can post at least a few times a week!

Labels: , , , , , , , , , ,