Wednesday, January 17, 2007

Install FTP Server

It's been awhile since I've done anything (don't ask), but today I'm going to install the ftp server.
I've got two reasons for this:
1. FTP is a cool little internet protocol that nobody really thinks about much anymore,
2. it will require me to think about security, port forwarding, and connectivity early, and
3. it will make things easier when I'm designing the site, or if i want to make changes at work, etc

First, since it's been a week, I'm going to manually check for any updates using synaptic:
System - administration - synaptic
hit reload and then mark all upgrades (this goes and checks the repositories for newer versions of the programs you already have)
When you hit apply twice, you will download and install all available upgrades.

To install proftpd, just search for it and mark it for installation. A warning will pop up telling you to install a few other programs, just go ahead and install them too. Proftpd will not work without them.
We are also going to install gproftpd while we are at it so we can use it to configure proftpd.
After you start to install these two programs, a dialog will come up and ask if you want to run proftpd as standalone or inetd. Standalone means just what it says, but inetd is something very interesting:
inetd means InterNET Daemon, and what it does is listen for requests for each program, and start them only when they are needed. Otherwise, if you have a computer running the apache webserver, proftpd, and SSH, all three programs (and others) would all be running at the same time. inetd runs by itself and just calls the others when they are needed.

Before we get started adding users and groups, lets decide where we want to store our ftp files.
Lets make a new folder under /home
cd /home
sudo mkdir FTP-shared
CD stands for Change Directory
SUDO gets us temporary privledges beyod what we normally have as a regular user
MKDIR stands for MaKe DIRectory

First, we need to set up a new user:
lets go to system - administration - users and groups

Second, lets add a group called ftpgroup by going to manage groups and adding it

third, lets hit add user.
In the new window, we have some options let's use these for the sake of argument:
Username: idiot
real name: idiot
type in a password for idiot and then again to confirm
under the user privledges tab, make sure nothing is checked
under the advanced tab, make sure the home directory is /home/ftp-shared
lets set the shell to something non-existent like /bin/false, and
lets set the main group to ftpgroup

Labels:

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

The Internet as the Wild West

I'm not sure when people will realize that software companies, microsoft, and the governments of the world really are failing to protect everyone on the internet.

I'm always amazed when people on Slashdot or that I talk to bemoan the existence of vigilanties on the internet. Don't they realize there is no law in cyberspace?
The internet today is the badlands, the American west in 1850.

Yes, technically the law applies.
No, it is not enforced.

I'm not actually arguing there should be more law enforcement online. One of the magnificent properties of the internet is that it is not owned by anyone. An American non-profit does technically "control" it, and there are companies that own the backbones, but it is in their interest to leave the internet alone. And that's the way it should be.

Right now, there is some law enforcement online, but only when what happens affects real people in the real world. Do cops prowl kids chat rooms looking for child molesters? Yes, but that is a real world harm (just about the worst I can think of). Do cops care if someone releases a worm or hacks into your companies server? Do they actually ever do anything? No.

Until that day arrives (if it ever does), I will support any responsible action taken to defend internet users who are not as security consious as they should be.

Labels: ,

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: , , , , , , ,

Tuesday, January 02, 2007

Install Day!

Right now I'm installing Ubuntu 6.10 (Edgy Eft).
My hardware is what is left over from my latest desktop build, most of the parts used to be in my old main desktop running windows XP.

These are the parts:
AMD Athlon XP 1800+ (1.533 mhz)
motherboard with an Nvidia chipset
766 MB ram
2 hard drives:
40 GB (boot, swap, /)
80 GB (storage)
Nvidia GeForce MX 64 MB video card


Old used parts, yes, but I don't mind. I'm doing this on the cheap.

That's pretty much all that's on the agenda for today, put the damn thing together, install Ubuntu Linux, and update!

This is how I updated:
Open Synaptic package manager
System - Administration - Synaptic package manager
Put in password
go to Settings - Repositories
Make sure universe and Multiverse are checked
(this will enable you to get all the update goodies, including updates and programs that might have more restrictive licenses than the GPL)
Hit reload
Hit mark all upgrades and then apply

It might just be a habit left over from working with windows machines, and you certainly don't have to do it, but at this point I like to do a reboot.

That's it for day 1.

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: , , , , , , , , , ,