Saturday, November 17, 2012

Setting up a Minecraft server

I am going to presume the reader has some technical capability and experience with computers beyond that of the standard user.

A friend at the lab where I volunteer had mentioned he and a friend were into Minecraft. After some prompting I decided to check it out only to find the "free" version was a bit short on time (100 minutes) and wasn't enough to really do anything. This isn't a criticism, merely a comment on my age where I need more time to try things out.

To set up a (free) server simply go to Minecraft's  web site at http://minecraft.net and go to the download section. The server comes in two flavours. Either download the Windows version or the version for every other operating system. If thought about for more than half a second the realisation that the Windows version is likely to be slower and less capable should convince anybody which one to run. Make sure the latest JAVA is installed.

Here is a list of requirements:
  1. A spare machine (it is faster to run the server on a separate machine although a virtual machine will work in a pinch).
  2. Hard drive space to store the persistent world data.
  3. Memory for users and program execution (the more the better).
  4. A network connection (internet may be necessary for installation but the server can be run with only a LAN connection).
  5. Players with client software matching the server version number.
Incidentally, my choice was Ubuntu server (no gui) on a 2GB virtual machine. Short of running BSD on bare metal, this is almost as fast as one can get.

I advise setting up the server in a separate directory on a machine not running anything else. Again for speed. This way the entire directory can be copied from one machine to another without change during scheduled down-time. It is possible to set up the machine to run unattended without a monitor or keyboard depending on what other software is installed. There is a one line script on the download page I mentioned earlier. If the admin so chooses they can install screen and ssh. This way they have manual control over the server from a remote machine.

To set up the server for the first time just run the script they provide and sit back until the world has generated. Once it is done type "stop" then run the script again. It's that simple.

There is a file containing the server options. The admin might want to edit this file and remove the world file then recreate the world with the new options. There is plenty of information about the options and what they do on the net.

I found around by fiddling around with the client software (options only - no hacking involved) I was able to connect to the server instead of playing the demo. This is a good thing for developers. Accessing software on ones own LAN is always desirable. I have found the client software behaves differently on Macs and Linux when unregistered.

If any of the authors of Minecraft read this, they have been in contact with my friend and my efforts are to help him along a little. As of this date he wants to replace some of the code with something better/cleaner/faster/more capable. He will be in touch again when it is done. Hopefully his efforts will make it into a subsequent update.

Friday, August 12, 2011

Burning files to a video DVD in Linux

There are essentially two ways to store video files. The first is to burn them as files and the second is to convert them to a video DVD format and burn them that way. I am going to presume the reader knows enough about computers to realise what hardware is necessary. If this is not the case then it is best to learn more about computers before proceeding.

Installation of the software of choice varies depending on the installed distribution. Some distributions require the user satisfy dependencies where as others will handle the dependencies automatically.

The first method is the simplest. There are several programs which can be used for this purpose. Indeed the user can in the, worst case perform direct writes to the DVD burner. Programs such as K3B and Brasero are up to the task. My personal favourite is K3B because there are more options, such as verification of the burned DVD, and is slightly more user friendly.

Although it is possible to burn files from several different areas across file systems and networks, it is generally a good idea to gather the files into one place. This way it is possible to burn them as directories containing the video files. This is useful if there are a number of unrelated video files going on to a single DVD.

The second method is a bit more involved. It involves transcoding the videos to a form acceptable to DVD players, generating at least one menu (unless only one video is planned for the DVD), and finally generating an ISO image of a DVD containing the altered files. There are fewer alternatives for this method than the first. I have tried two and found the simplest to be a program called DeVeDe.

One of the dependencies is a program called mencoder. This is part of the mplayer program. The mencoder program may need to be installed separately. Other programs will use ffmpeg or transcode for the same purpose.

DeVeDe provides a good amount of compression by itself. It is possible to change the bitrates of the audio and video components of the video file. Most file formats will tell the program the original values for the video. Others will not. Generally it is a good idea not to use values larger than the original values because nothing will be gained by doing so.

The most common settings to change would be the quality settings (this affects the video) and the audio settings (stereo versus 5.1 Dolby). Trial and error on specific players is the only way to determine what the optimal settings are.

Depending on the computer used there are additional settings in the lower left (click the '+' sign) which will allow multi-core extensions to be used. In the same group of settings the user can determine how far along they want the creation of the disk to proceed.

Menu settings are in the middle near the bottom. They are pretty much self explanitory.

There is a lot of general advice. If the target display device is an old style 4:3 TV there are problems with the width of the subtitles in many anime videos. Specifically those which are referred to as 'hard subs' will often go from edge to edge. This is not a problem with the newer 16:9 TVs. The method to correct this is to use mencoder separately to resize the video and put black bars around the border before using DeVeDe. Currently most subtitles are 'soft subs'. This allows the user to manipulate the width of the subtitles. I suggest a width of 80% so the viewer will not lose part of the subtitle to the plastic at the edge of the screen. If the user is like myself (in need of strong corrective lenses) they may want to put a black border around the subtitles for easier reading. The form factor value is a floating point number in the range of 0 to 10. The larger the number the thicker the border. If there are multiple subtitle streams it is best to set the subtitle ID as an extra parameter in the advanced settings.

Some MKV files pose a problem for the July/August 2011 version of mencoder. Although the files will play more or less properly outside DeVeDe, they will not play properly within it. There are two major problems. The first is the subtitles stay on the screen until the next subtitle appears. The second is the audio and video get out of sync. The first is corrected by using the MKV demuxer instead of the default. The second is corrected by telling the encoder not to skip video frames and to correct the synchronisation every '0' seconds.

Here is a sample of what I use as extra parameters in the advanced options for encoding to a 4:3 TV using an MKV file as a source. These need to be done in order.

-sid 1 -subwidth 80 -ffactor 10 -noskip -mc 0 -demuxer mkv

An alternative would be to put the following configuration file into the '~/.mplayer/mencoder.conf' file...


# mencoder configuration file at ~/.mencoder/mencoder.conf

# Subtitle stuff. For 4:3 TV 80% of the screen. 10 pixels around subs.

subwidth=80

ffactor=10

# Uncomment the line below for proper display of MKV subs. Use this here if no menu is planned.

#demuxer=mkv

# Sync audio and video

skip=NO

mc=0


Apart from the demuxer line, the rest don't do any harm to the video.



Saturday, May 21, 2011

An interesting bug/feature of Simply Burns (Mac)

I was having trouble burning some files this afternoon. I thought I wasted four DVDs. It turns out it may be the way the filesystem wants to handle file names at the root level of the disk. By putting the problematic files into a folder and putting the folder at the root level of the disk, the problem was solved.

Must have software for shell users of OS X

iTerm allows the user access to additional features not provided by the pre-installed Terminal program. Such as custom backgrounds, saved settings, middle mouse click copying, and other features available in Linux shells.

I've also found programs from MacPorts (or similar packages) to be quite useful when I need things done very fast. For example ncftp, unrar, and par2. There is also a problem with finding 7zip for the Mac. This can be installed from MacPorts.

Some people advocate gedit (a cross-platform text/program editor). I personally like Text Wrangler.

Something interesting about VirtualBox

I'm not really an expert on most of the things I am testing out so I keep track of the things I learn here.

It seems as though there are at the moment four networking options avail to VMs in VirtualBox. The first is not to allow networking. This cuts off access to ALL networking programs. The second is a NAT. Essentially this allows the VM access to the network with its own pseudo-router serving up a Class B private address. The third is a bridged network. This allows the VM to aquire a DHCP generated IP address from an external router. I haven't really looked at the fourth setting.

To allow access to the CD/DVD burner the CD/DVD needs to be set to passthrough. Unfortunately I haven't been able to get it to work yet.

I tried a webcam recently and although it was recognised there was no video or audio on the screen.

Tuesday, September 28, 2010

FreeBSD 8.0 on an old IBM Thinkpad

This one was some adventure...

I'm going to mention something out of order but it is best to do this first. If anyone wants to get graphics working on this machine they first need to realise xorg (the graphics program) does something nasty with the keyboard. This is not universal across all machines. It turns the numlock on. Not a big thing if you don't need the right side of your keyboard... After much research I found the solution is to install a program called numlockx from /usr/ports/X11. Installing a package from the ports is as easy as "make build" and if it completes successfully, "make install".

The next thing to do is to configure xorg from the root account. This is the sequence for that "Xorg -configure" then "cp /root/xorg.conf.new /etc/X11/xorg.conf". Within that the following lines need to be added to the /etc/X11/xorg.conf file to enable the mouse and keyboard (NOTE: I am using single quotes instead of double quotes because the double quotes are used in the commands) 'hald_enable="YES"' and 'dbus_enable="YES"'.

Almost ready to to into xorg... There are still some things to do first. It is a good idea to enable the sequence in order to force quit xorg. Add this command to the /etc/X11/xorg.conf file... "setxkbmap -option terminate:ctrl_alt_bksp". Finally as a user add the following to the end of the .xinitrc file in the users home directory... "numlockx off".

Incidentally, configuring the sound follows the same procedure as outlined in a previous post.

Although going into Xorg is possible at this point most people prefer to install a more substantial window manager such as Gnome or KDE. These can be found in the /usr/ports directories. My personal preference is KDE. The procedure for KDE 3.x is given in the previous post I mentioned. To start KDE 4.x the following command is inserted into the first line of the users .xinitrc file... "exec /usr/local/kde4/bin/startkde".

At this point the GUI is ready to run. On this particular machine I found it took all day to install Firefox. OpenOffice was a memory hog and wouldn't install. The alternative was KOffice. That worked decently well. I wanted to install some other programs but there wasn't much I could do with a 10GB hard drive... I gave up on it as a lost cause and returned it to the recycling folks.

Sunday, February 07, 2010

Adventures upgrading to OS X 10.6

I discovered some interesting things about the Mac last month. My PC was down for a while until I replaced a hard drive and so I was motivated to do some needed upgrades to the operating system.

The first thing I found was some of the applications I was using ceased to function under Tiger (10.4). They needed Leopard (10.5) or Snow Leopard (10.6).

When I went out to get 10.6 for the machine I found Apple was selling two versions. There was a $200 version and a $30 version. Two friends and the folks at the newly opened Apple Store said I would have to upgrade using the $200 version because I was skipping from 10.4 to 10.6. I asked around to see what the difference in the two versions was. There was something vague about iLife (which I didn't use anyway since I think it's pretty useless). I asked Bill M. from Call-A.P.P.L.E. about this and he said just to use the $30 version. Anything missing would be handled through the update procedure. It turns out he was correct.

After installing 10.6 I found a feature which had been available in Linux for years. This is the use of multiple desktops. They call it "Open Spaces". This feature is immensely useful on newer machines. It helps organise what is happening on the computer. Apparently this has been available since 10.5 but since I skipped that version...

One of the third party programs I was using broke under 10.6. GIMP (a Photoshop alternative) stopped running. After tracking down the problem I came to the conclusion Apple took out the X-tools from 10.6. Guess what GIMP needs to run...

In the process of looking for useful software for the Mac I found a couple of sites which let the user compile *NIX programs from source. I don't have the links handy, only the names. The one I used is Mac Ports. The other is FINK. There is a third but again, I don't have the name handy. I decided to try and install the GIMP from Mac Ports and it failed. However I did manage to compile a news reader called PAN. The thing is it took a long time to satisfy dependencies before it was finished.

Understandably the Mac now has substantially less space on the hard drive.

Labels: , , , ,

Mint Linux

I've been trying out Mint Linux (http://linuxmint.com/) for the last few months. It is a multimedia distro based on Ubuntu. My motivation is I would like to find a usable distro for the "average user". I tried version 7 and was impressed. Version 8 is less impressive but still functional. When the 64 bit version came out I gave it a try and was not impressed at all by the way it handled KDE. Granted both Mint and Ubuntu prefer the Gnome interface, I prefer KDE. Gnome works fine for those looking to give it a try.

As with most modern Linux distros Mint comes on a live disk (CD/DVD). This is to say it will run off the disk and not touch the hard drive on a computer unless the user chooses to do so. The option to install the operating system is available as an icon on the desktop. It's sort of a "try before you buy" situation. The thing the user needs to bear in mind is because it is running off of the disk it will be SLOW. Once installed on the hard drive it is much faster.

This particular disro has a fairly high "wow" factor. Particularly if the user has an interest in multimedia.

Labels: , ,

Saturday, November 15, 2008

Access to OS X pages on personal machines

Those who are considering enabling the web server on their OS X machines should be aware of the location of their web pages.

The system web page is located at /library/web server/documents. The users web page can be found in the sites folder in their home directory.

Access to the system web page is through the name or IP of the computer. The users pages are accessed by the name or IP of the computer followed by the “~/” and the users ID.

Saturday, May 17, 2008

Tried out an interesting program

I saw a presentation on Tuesday at the MUUG (http://www.muug.mb.ca). The topic was on Network Attached Storage. There were two products demonstrated but being a stereotypical Winnipegger I decided to try out the free one. The program is FreeNAS (http://www.freenas.org).

So, what the heck does FreeNAS do? It is in essence an easy way to gain access to massive (by todays standards) amounts of storage. It is a network file server. There are about a dozen access methods the administrator can enable. I've tested three of them to this point and they work. I've tried it from an OS X box where I can access everything easily. I tried it from my fathers XP box where it was less easy (because I know very little about XP - it also insisted on accessing the server by IP address rather than by name). Xubuntu on a PPC worked fairly well, but I wasn't willing to put a lot of time in to it. My Kubuntu (7.10) PC wasn't able to access CIFS (Windows networking) because I didn't have it set up properly, but everything else worked really well.

The setup was remarkably easy. Granted I had to do it a few times because I didn't read the instructions. Just boot from the live CD, install the full system to the hard drive, and set up an IP for the computer. From there login with another machine via HTTP. Configuration is a snap. The part which caught me was I was mounting the OS partition and not the data partition of the first hard drive. It took me four hours to figure that out. From there it was real easy to determine the configuration of the server. Once the server was configured and the partitions mounted it was time to enable the services. Again, very easy.

What I found most impressive was the low system requirements. First off it's because it runs on Free BSD (http://www.freebsd.org). Everything else is very small. Although I allocated 80MB to the system, I think I saw where I might be able to get it down to 32MB. Yes folks I wrote "MB" not "GB". In addition to being able to run on a minimal system there are other benefits to running a PC BSD system. It is perhaps the most stable PC operating system out there. It is very secure. It is very fast (perhaps the fastest there is). Here is the cool part... It bypasses the PCs BIOS and accesses the hard drives directly. This means older PCs are not limited as to the size of hard drive they can use. Finally, any storage drive, if connected properly, can be used on this machine. The administrator is not limited to four IDE devices.

As I can afford them I will be installing large hard drives into the old system I was using. It should prove useful.

Wednesday, March 26, 2008

I switched video cards

I switched video cards recently. I found the Radeon drivers for Linux had been updated and no longer supported my Radeon 7000VE. The symptoms started when I updated my version of Ubuntu. It turns out I was able to get into text mode but no GUI. This was really strange since the card had worked before.

Going back turned out to be an option once. The second time I tried, the operating system wouldn't even install. I expect this sort of behaviour from Microsoft not Linux!

Well after trying several options to get my Linux running it turned out the best solution was to get a new video card. Why not... They are fairly cheap. If you have the money that is... It took me a month to save up the cash. All I can say is thank you to Joanne and Bill for sending me the Mac Mini last summer. I would have been stuck otherwise.

I settled on a GeForce FX5200. As a friend describes it... "A budget card but still nice". The card functions out of the box. There are 2D drivers for it which are nice and stable. I can do just about 90% of what I did with my Radeon 7000VE. Some programs such as WINE whined and partially functioned. Other programs such as Warsow complained there wasn't enough video RAM then decided not to work.

After a month of this my friend Dave C. told me how to install the 3D drivers. After previous problems I got smart and backed up my xorg.conf file. The first time around with KDE it didn't let me install anything. I tried installing the drivers directly from the NVidia site with no joy. They installed but I had the same problems as before. I couldn't get into graphics mode. Dave was perplexed. After a couple of days he came back and suggested I install the Gnome desktop and try it from there. No joy there either. Then he suggested I run some configuration program. This whined and said I was missing something. I installed the missing package and the configuration program worked. I had 3D. Of course I had to log out and restart the X Server.

WINE functioned again. Warsow worked. There were some additional effects on the screen. Not too shabby. I rebooted and guess what? No graphics mode. I backed up the xorg.conf again to a different file. Then I restored the 2D xorg.conf. The reboot worked and I had graphics again. I checked and there was the same problems I had with 2D before. I restored the 3D xorg.conf, logged out, and restarted the X Server. All the 3D stuff came back.

Since I don't use the 3D drivers all the time, I guess I can live with manually switching the configuration file as I need to use it. It would be nice if it worked properly though.

Wednesday, June 27, 2007

Reformatting an NTFS drive in OS X

I was loaned a PC hard drive formatted to NTFS (which is notoriously difficult to remove) a little while ago. The owner had given it to a friend and both said there was nothing on the drive and there was nothing they could do with it. It so happened I was running out of room on the Mac so I went out and picked up an external box which has both Firewire and USB 2.0 on it. As soon as I plugged it in I found the three NTFS partitions. It complained I didn't have permission to do anything with it. Since there was indeed nothing useful on it I figured it would be smarter to reformat it in HFS+ (the standard Mac format).

Hunting for the instructions wasn't all that easy. I had to refer to a web page. There I found the command to perform all sorts of functions related to the hard drives was the "diskutil" command. To properly access it the user/administrator needs to go into the terminal and type the command. From there the program gives instructions on what works and how to do it. Fortunately for me it catches improperly phrased commands otherwise I would have lost the internal drive. To format an external drive use the following command as a guide...

diskutil filesystem_type new_name /dev/disk*

Within a couple of seconds, things are working like a charm.

Labels: , , ,

Wednesday, May 02, 2007

Useful utility in Linux

This may also work in other forms of *NIX. I haven't gotten it to work in FreeBSD though.

The "pstree" command lets the user see their processes in a tree format.

Monday, April 02, 2007

More FreeBSD stuff

First off I wanted to configure my system to use the bash shell. I managed to do that in the last post. Having bash running I wanted to configure it with a bunch of aliases. I found the .profile file controls the text mode shell. Whereas the .bashrc file controls the shell in graphics mode. I have not found where I can set up the aliases for ssh. There are sample files on the net. If they are too hard to find then check out the link to Call-A.P.P.L.E. and take a look at the March or April issue. Do NOT use the .bash_profile file!

The other thing I wanted to do was to configure the sound to work with KDE. The quickest way to do so with the generic kernel under FreeBSD 6.X is to add the following line to the /boot/loader.conf file...

snd_driver_load="YES"

The next time the system reboots the appropriate files will be created and the sound will work. This may be an inelegant solution. If there is a better one, write me at Call-A.P.P.L.E.. It may take a while, but I'll eventually get the message.

Saturday, March 24, 2007

Post install adventures with BSD

Changing the shell:
I like the bash shell. I'm used to it. I run it with Linux. BSD uses a different shell by default. It might be csh or just plain sh. I'm not sure.

I tried the chsh (change shell) command and it wouldn't let me change any information. I did a "man chsh" to see what was up. It looks as though it was deprecated in favour of the chpass command. It's a more powerful command and potentially more dangerous. To change the shell the following command is used.

$ chpass -s bash username

Like the sudo command this needs to be followed up by entering the user password.

Changing the monitor resolution:
Thanks go out to the folks at http://www.bsdforums.org for having this tip on their web page.

As root, perform the following steps. Remember it is case sensitive.

$ Xorg -configure
$ cp /root/xorg.conf.new /etc/X11/xorg.conf
$ xorgcfg -textmode

This was all I needed to convince it my monitor ran at 1024x768. Read the web page and heed the warnings about messing with the card.

Update:
The Screen section of the xorg.conf file needs to be updated so there is a DefaultDepth section and a mode line for the appropriate depth. The modes are the resolutions enclosed in quotes. For example:

mode "1024x768" "800x600" "640x480"

Pressing the Ctrl and Alt keys and the "+" or "-" on the keypad should switch resolutions.

Setting KDE as the default window manager:
The default window manager is (I think) twm. It is really bare bones. To run any kind of application the user needs to type it into one of the three shell windows provided. If one is going to use a gui then why not use a powerful one. The tip for this one can be found on http://www.freebsd.org under the desktop environments page. Enter the following command from a shell prompt.

$ echo "exec startkde" > ~/.xinitrc

Setting up the panel:
This is a little more tricky. Once KDE is running use the right mouse button to select "Configure Desktop". From there hunt around for the location to change the function of the right mouse button. Change it to "Application Menu". From there it is possible to go in and change the settings for the panel to make it visible. Once visible, change the function of the left mouse button back to the way it was.

Misc:
Some applications normally visible with Linux need to be started from the command line. It is possible to add these to the application menu with a bit of effort. Firefox is a good example.

Labels: , ,

Wednesday, December 13, 2006

Reinstall fuse/Ubuntu

I had a reinstall of Ubuntu recently. The update didn't work out too well. Anyhow I was having trouble with fuse. I made sure all the components were installed from the package manager. It still wouldn't work. From there I found issuing the command "sudo mknod -m 666 /dev/fuse c 10 229" would insure the /dev/fuse file was created.

Unfortunately that didn't solve the problem. I asked my friend Scott (one of the developers) if it was likely I missed something. He suggested checking to see if my user were part of the fuse group. It turns out the user had full access to fuse.

From there I did a bit more research and found the /dev/fuse file gets created as needed. Wasted effort earlier? who knows...

Then I decided to get nasty and look up the error message at google.ca/linux. There were two things to do. I first did "sudo modprobe fuse" followed by "sudo modprobe -l fuse" to be sure it was there. Still didn't quite solve the problem. Reading further, I found I had to issue the following command (and will have to do so for each update of fuse). "sudo chmod 4755 /usr/bin/fusermount". That did the trick.

Thursday, November 02, 2006

Datatrain DC619 monitor under Linux

I wanted to do more than 1280x960 on the machine and had a hard time getting it to work. I was editing the refresh rates as well as the mode lines (resolution) in the xorg.conf file. I remembered I had an old file where it said the monitor was made by someone else. It seems this monitor is really a Samsung 17GL.

Anyhow, I set up the monitor settings to that particular set and it works. Since the monitor is a widescreen model I figured I'd make the best use of it I could. Now I'm running 1680x1050 @ 60Hz.