Tuesday, July 07, 2015

Compiling and Running Quake2 in a modern browser window in Mageia5

Slashdot ran a story about getting Quake2 running in a browser windows. That is very cool.

There were installation instruction at quake2-gwt-port except the instructions were not for "Linux" but only for Linux distros that provide apt-get (probably Ubuntu). That is not cool at all.

While it would have been possible for them to write their HOWTO instructions in a generic way (provide a list of all dependencies, provide links to source code for needed apps not included in every Linux distro, etc.), they just assumed that everybody uses Ubuntu. Bad. Bad. Bad.

Here's what I needed to do to get it compiled and installed on my Mageia5 system. Read those Ubuntu-ed instructions first for the details. You should be using sudo to run commands that need root privileges. (All the following commands are written on one line even if they appear to be on multiple lines.)

$ sudo urpmi mercurial ant gcj-tools javacc lame vorbis-tools
 
$ hg clone https://quake2-gwt-port.googlecode.com/hg/ quake2-gwt-port


$ cd ~/quake2-gwt-port


$ sudo ant run
 

This will install the original Quake II demo resources, build the client and server code, then run the server.

Play Quake2 in your browser with: http://localhost:8080/GwtQuake.html

It seems to run just fine in Firefox (as well as PaleMoon, QupZilla, very slow in Arora, not at all in Dillo) window. It doesn't run in very old versions of Firefox or possibly other browsers because of the opengl requirement.



Sunday, June 21, 2015

Easy Upgrade from Mageia4 to Mageia5

Back in the early days of Linux, the changes to the Operating System were so dramatic that even when updating withing the same distro, in-place point release updates were problematic enough and it was always recommended that a major version release be done from scratch. There were just too many major changes to the underlying subsystems and package naming conventions. Doing an in-place update was just asking for trouble.

Modern distros have matured quite a bit, although there are occasionally some major subsystem changes being made. Yet it's never been easier to do an in-place major version upgrade.

I just did the upgrade on several Mageia4 systems and the results were consistent and satisfactory, not to mention simple.

Step 0.

Always backup critical information. Have a Mageia4 recovery disc on hand.
 
Read the Release Notes and the Errata for Mageia 5.Other than updated applications, teh biggest change is support for UEFI. Review the Mageia 5 Documentation about the installer.

You can always download an ISO image to do the upgrade rather than do an in-place installation if your Internet connection is slow. DO NOT attempt an upgrade from the Live ISO image as it will overwrite your existing system.


Upgrade From GUI

Step 1.

$ sudo mgaapplet-upgrade-helper --new_distro_version=5

Done.


Upgrade From CLI

Step 1.

Fully update the packages you now have installed.

$ sudo urpmi --auto-update --auto -v


Step 2.

Remove all the existing Mageia4 repositories.

$ sudo urpmi.removemedia -av

Step 3.

Add the Mageia5 repositories. (All on one line.)

$ sudo urpmi.addmedia --distrib --mirrorlist 'http://mirrors.mageia.org/api/mageia.5.i586.list'

Note: for 64-bit systems, substitute x86_64 for i586.

Step 4.

Update the packages

$ sudo urpmi --replacefiles --auto-update --auto -v

Step 5.

Reboot. You'll be using a new kernel, new glibc and so on.

$ sudo shutdown -r now

Step 6.

Run the package update command from Step 4 again. It should return with no packages needing updating.

Done.  But . . . .

Do Some Checking.

$ cat /etc/redhat-release
$ cat /etc/issue

Those commands should return the information that you are running Mageia5. I did have an issue on one machine and $ sudo urpmi mageia-release-common fixed it. You can also manually edit those version files in /etc to change the version number.

Dynamic DNS Without a special ddns client

There are several Dynamic DNS clients available for Linux. I have never had them work satisfactorily with my DNS provider ZoneEdit.

It is possible to use wget to send the current IP address to ZoneEdit (all on one line, of course).

$/usr/bin/wget -O - --http-user=USER_NAME --http-passwd=PASSWORD 'http://dynamic.zoneedit.com/auth/dynamic.html?host=DOMAIN_NAME.COM'

This can be run as any user.

I have found it useful to use cron to run it. Instead of a specific time, I just use the macro @daily in my crontab.

NOTE: ZoneEdit is migrating to a user key rather than a password and, while they are maintaining backwards compatibility for now, you should migrate as soon as practical.

Thursday, May 21, 2015

DOS Apps and Games

Old Apps at http://www.oldapps.com/ provides old versions of popular software.

The 6.0 DOS version of Norton Commander can be downloaded at http://myoldsoftware.blogspot.com/2009/04/norton-commander-60.html

DOS shareware versions of Doom and Hexen are here: http://www.doomworld.com/classicdoom/info/shareware.php

Other classic PC games may be available from here: https://archive.org/details/classicpcgames

Software for MS-DOS machines that represent entertainment and games at https://archive.org/details/softwarelibrary_msdos_games&tab=about

 Free classic games on DOS Games Archive at http://www.dosgamesarchive.com/

Thursday, December 04, 2014

HOWTO Install the ownCloud Server on Mageia5

It appears that "the cloud" is the popular buzzword now. All cloud computing is is a remote file server where you can store, access, share and manipulate your files. While several commercial services are available, it's possible to create your own cloud service using the ownCloud software. As with any powerful server software, it's not out-of-the-box easy, but with some preparation and understanding, it's not that difficult. Most of this HOWTO is Mageia-specific; a lot of the configuration details are enumerated at the ownCloud website documents.

We're installing ownCloud on a minimal Mageia4 virtual machine using VirtualBox just to go through the process. There is no X-server, so it's all done on the command line.

Mageia5 documentation, installation discs and Errata can be found here.

Part One -- Installing the Apache Webserver

We must begin by installing the Apache webserver. It's certainly possible to use alternative webservers, but Apache is most common. Getting a working Apache webserver is pretty straightforward.

1. Install Apache and some other related modules we'll need. Eventually, you'll want to configure ownCloud to use SSL, so install that module now.

$ sudo urpmi apache apache-mod_ssl

Note that we don't install apache-mod_dav since ownCloud supplies its own DAV module.

2. Use drakconf on the command line and choose the selection that allows you to configure the firewall to allow the web server (and the ssh server for system administration via ssh).




3. Set inint to run the webserver on startup.

$ sudo chkconfig httpd on

4. Start the webserver.

$ sudo service httpd start

5. Check to see that the webserver is working by pointing you browser to the server IP.  I used the text-based lynx browser since there is no X-server on this machine.

$ lynx localhost

And it works!

Part Two - Install Useful Dependencies

Use urpmi to install the following apps. The ownCloud documentation explains why they are useful. You might as well do it now.

imagemagick
php-fileinfo
libreoffice-writer
php-exif
php-imagick
php-bz2
php-mcrypt
samba-client
davfs2
ffmpeg


Part Three - Install ownCloud

By default, the Mageia package installs ownCloud in /use/share. There's nothing wrong with that although some people prefer it to be someplace else and, with some care, you can move it wherever you like. What's important is that the user apache own all the files and directories associated with ownCloud. We do that by using:

$ sudo chown -R apache:apache /usr/share/owncloud

NOTE: When upgrading using URPMI, the file ownerships are changed but can be easily fixed as shown above.

It's also necessary to provide an initial configuration file. The easiest way to do that is to copy the example they provide. That leaves us with a pristine example file to examine if we need.

$ sudo cp /usr/share/owncloud/config/config.sample.conf  /usr/usr/share/owncloud/config/config.conf 

When we run ownCloud the first time, it will strip out all the comments and fill in some of the values during its initial setup.

Part Four - Setup ownCloud

Before you access the admin part of ownCloud, you must be logging in from an authorized fully qualified domain name (FQDN). This is allowed by editing config.php to add your FQDN. If you are assigned a dynamic IP address, you must use a dynamic DNS service to get access; it's a security feature.

Once that is out of the way, access the admin pages by pointing your web browser to http://your.server.address/owncloud.

The complete configuration is actually a little more complicated that this and I'll be adding links to documents that provide details, but essentially this is what you need to to do to get ownCloud running on Mageia4. It's just not as simple as "urpmi owncloud".

NOTE: In an older installation of ownCloud, I had some difficulty getting ownCloud 6.x to run reliably, but Mageia5 now offers version 8.X. If you need a version newer than Mageia provides, you can simply download the latest tar.bz2 package from the ownCloud site and replace the contents of /usr/share/owncloud, making sure to change the ownership to apache:apache as noted above.

Friday, October 10, 2014

Watching Netflix on Linux Without Ubuntu

Ubuntu has just announced that you can use Ubuntu to watch Netflix. They make it seem like Ubuntu is something unique and Ubuntu is the only way you can watch Netflix on Linux.

I use the Mageia distro of Linux, so that Ubuntu-specific mojo won't work for me.

Thankfully, it's not Ubuntu, but the beta version of the Chrome browser that has implemented DRM extensions for HTML5 video (along with a recent version of the NSS library, which Mageia has). All one need do is spoof the User Agent in Chrome to make Netflix think it's serving the video on a Windows platform and you are watching Netflix!

1. Download and install Google Chrome beta from here.
2. Install the User-Agent Switcher from here.
3, Configure the User-Agent Switcher to spoof the user-agent as Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36 by adding it to the Chrome profile like this:



4. Log in to your Netflix account and enjoy the show.
5. No Ubuntu needed, just thank Nathan VanCamp.

Monday, August 04, 2014

HOWTO Configure a Headless Transmission Torrent Server for Mageia5

This will describe how to install and configure the Transmission torrent application on Mageia5 in a headless configuration, how to make it automatically download torrents by placing a .torrent file in a particular directory and admin the client remotely using both a cli (command line interface) and a GUI (graphical user interface) application.

Transmission has both a Homepage,  a Wiki and a Forum, so there's no lack of help and support. But as for installing it as a headless server on Mageia, all we found were HOWTOs for Debian/Ubuntu systems.


We're assuming that you have Mageia4 installed and have configured your user to use the sudo command.


INSTALL
Begin by installing the transmission daemon and the command-line client.

$ sudo urpmi transmission-daemon transmission-cli

This installs  transmission-daemon, transmission-cli and transmission-common (which is mostly the documentation). All the binaries will be found in /usr/bin. The transmission package also installs a Java-based web client at /usr/share/transmission/web/index.html.

CREATE A USER
For transmission-daemon, all settings are kept in $HOME/.config/transmission-daemon. We want to create a user named "transmission". Other distros make the "home" directory something like /usr/share/transmission or /var/lib/transmission; it can really be anything you want. For us, creating /home/transmission has a special benefit.

$ sudo adduser transmission
$ sudo passwd transmission


Having a password allows us to use scp to remotely send a .torrent file to /home/transmission/ on our remote server and the torrent will automatically start when we have properly configured the transmission-daemon to do so.

OBTAIN AN INIT.D SCRIPT
There is an Debian/ubuntu-specific init.d script available from the Transmission site, but it won't work for RedHat-derived distros like Mageia.

You can download an init.d script useful for RHEL and Fedora (and Mageia) written by Jason Friedlan. It's located at his website; you'll need to copy and paste it into a text editor.

We'll need to make some changes for Mageia:

- TRANSMISSION_HOME=/var/lib/transmission
+ TRANSMISSION_HOME=/home/transmission


Save the script as transmission-daemon, change the ownership to root and make it executable, then move it it /etc/init.d.

$ sudo chown root:root transmission-daemon
$ sudo chmod +x transmission-daemon
$ sudo mv transmission-daemon /etc/init.d/


To verify that our script is valid for init.d invoke:

$ sudo chkconfig --add transmission-daemon

Now set the runlevels for transmission-daemon with:

$ sudo chkconfig --level 345 transmission-daemon on

and verify it with:

$ sudo chkconfig --list transmission-daemon

CREATE THE BASIC FILES
Now that our service is configured, let's start and stop the daemon to make certain it works.

$ sudo service transmission-daemon start
$ sudo service transmission-daemon stop


Then invoke:

$ sudo ls -al /home/transmission

This will reveal that the .config directory has been created and we will find that /home/transmission/.config/transmission/settings.json has also been created.

CONFIGURE TRANSMISSION
The editable text file settings.json contains the default configuration for our daemon. It can be edited with a text editor and an explanation of the various options can be found at the Transmission Wiki.

Some suggested changes are (the trailing commas are important!):

Add a blocklist:
- "blocklist-url": "http://www.example.com/blocklist",
+ "blocklist-url": "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz",


Allow all users on the network to access the web interface:
- "rpc-whitelist": "127.0.0.1",
- "rpc-whitelist-enabled": true,

+ "rpc-whitelist": "*.*.*.*",
+ "rpc-whitelist-enabled": false,




Save the file and restart the service.

Setting a username and password to stop all users but us is important, but this must be done with the transmission-remote command because the password is hashed for security and not stored as plain-text.
$ su - transmission
$ transmission-remote --auth username:password


You can use the application transmission-remote to change any of the settings; look at the man page for details or at the Wiki page.

You'll need to set the home directory to auto-download any torrents. First, we'll need to enable it, then set the directory. As shown here, we'll do it on one line each:
$ su - transmission -c transmission-remote --watch-dir-enabled true
$ su - transmission -c transmission-remote --watch-dir /home/transmission


And, we'll have it keep downloaded torrents in /home/transmission/Downloads.
$ su - transmission  -c transmission-remote download-dir /home/transmission/Downloads

If you don't change a setting, transmission will use the default setting. You can see the default setting by examining the settings.json file or looking at the Wiki page referenced just above.

If you are GUI-centric and command-line-phobic, install the GTK or QT clients and as the user "transmission" use the transmission client GUI to change the settings. That's pretty easy.

NOW START TRANSMISSION
 $sudo service transmission-daemon start

  And you are ready to use it.

START TORRENTS AUTOMATICALLY

Instead of clicking on a torrent link, save the linked .torrent file instead and move it to the torrent user.

$sudo mv *.torrent /home/torrent/

Now the download starts automatically! You can even do this from a remote computer, so if your server is at home and you are at work, just copy the .torrent file over the Internet and the download will be done by the time you get home.

To admin your Transmission server, there's the provided Java web client, or a stand-alone application called

FEEDBACK
As always, I'd appreciate any feedback, especially if I made any errors in this.