Ink-stained rant

One of the tasks tonight was printing out student work; it needs to be printed so I can grade it and hand it back. Nowadays most students won’t print their own work… usually, I think, from the cost involved.

The big cost is ink. My usual printer for everyday use is a worn Epson Stylus C-120. It uses four colors but five cartridges -doubling up on black – and if I were to use Epson-brand ink, the cost for one set of cartridges would be about  $60. Each cartridge holds 12 ml of ink – thus Epson ink costs $1,000 per liter, or a bit less than $4,000 to the gallon. And you thought gasoline was high-priced?

I don’t use Epson inks. I print way too much to go that route.

For the first couple of years I used a CISS – Continuous Ink Supply System. This is a set of 5 cartridges with tubing which loops outside the printer to a set of tanks holding bulk ink. The cost of the CISS was $35 – for 100 ml of ink in each tank! Re-inking costs were about $30 per 500ml – far less than name-brand.

CISS systems expect to be used, a lot. Daily works best. Otherwise the inks slowly draw back down the supply lines into the tank. If the time between use is too great, the inks may clot up a bit at the feed end of the tanks… at which point it’s easier to pull the system out and replace it rather than fix it. Been there, done that. These inks are dye-based and not particularly stable, but work just fine for daily print work (mostly text).

For now, I’m using generic dye-filled cartridges bought on Amazon – the vendor name changes with each purchase, but on average I’m paying $1.25 per cartridge… everything is working fine, except the ‘status’ messages from the Epson printer driver software.

Epson’s printer drivers give a visual depiction of remaining ink; and a warning pop-up when the capacity is ‘low.’ What I’m finding out is that ‘low’ is… a marketing ploy as opposed to any sort of reality. Two days ago I got the pop-up, urging me to buy ink as I was ‘low’ on black. Earlier tonight when I started to print, the indicator was at the bottom, indicating imminent emptiness – or so it seemed. Two hundred and four pages later, the indicator is still at the bottom… and the black ink is still printing nice and strong.

Tsk tsk tsk.

Bringing Linux to Windows – part 3

Part 3 of 3.

(back-link to part 1, or part 2)

…and the final bit of configuration is to install phpMyAdmin.

phpMyAdmin is a clever package which allows for remote administration of the MySQL database server via a web-browser interface. In this instance, getting it to work also proves that all necessary components of the VM-based server have been installed and are working properly.

From the command-line:

sudo apt-get install phpmyadmin

will start the ball rolling, but there are several questions to answer.

First up, tell the installer which web server to change:

phpMyAdmin installation
Select apache webserver

Next, select the database for operating phpMyAdmin – it needs its own database for running things! It’s best to choose the dbconfig-common option.

dbconfig-common select
Go with the default

Next, you’ll need to provide the password for the ‘root’ user (administrator) for MySQL: (yep, the one you picked earlier)

phpMyAdmin config
Enter the MySQL root user password

…and after a bit more work, it should all be done.

The acid test – use your web browser to connect to phpMyAdmin:

phpMyAdmin in browser
It works!!

…and now you’re the proud owner of a Linux server running in a virtual machine!

One final note: to shut down your VM, go to a command prompt and issue this:

sudo shutdown -h now

which will politely end all tasks and power down your VM.

Addendum – of interest to my students.

In order for your VM to work identically to the classroom lab system, you’ll need to modify the operation of the Apache server. You’ll need to sign in, and from the command line issue this:

sudo a2enmod userdir

which, decoded is “super user do” “apache 2 enable module” “userdir module” – and userdir is the mod which instructs apache to serve content from a user’s “public_html” directory.

–>Important additional step to make this work (added 03/28/2014):

Due to a change in how Ubuntu server is being distributed, you’ll have to change one more file in order for PHP to work properly in conjunction with the ‘userdir’ module.

cd /etc/apache2/mods-available
sudo vi php5.conf

(or whichever editor you’re comfortable with); and comment out (add a # to the start) of the lines indicated in the php5.conf file, and save it back.

Next, you need to restart apache:

sudo service apache restart

Bringing Linux to Windows – part 2

Part 2 of 3

(For part 1, click here)

…at this stage, you should have VMWare all up and running and the install in operation. Near the beginning of the process you should get a popup reminder to download VMWare Tools for Linux – go ahead and select to download and install.

VMWare Tools reminder
Download and Install the Tools

Now it’s time to let things happen; you may need to click “OK” once or twice (or “Close”; message depends on version and OS) to dismiss popups. There will be a number of bar-graph status windows appearing and disappearing during the installation.

Eventually Ubuntu will finish the first part of the installation, and reboot the VM, and then you’ll get a white-on-black screen filled with messages:

Ubuntu boot sequence
VMware Ubuntu boot.

This stage may take a minute or so, but eventually you’ll come up to a login prompt.

Now how do you navigate between your VM and your usual desktop? For the VM to get keystrokes and mouse moves, click inside the VM (or press Ctrl-G on the keyboard). To ‘release’ the keyboard and mouse, use Ctrl-Alt on the keyboard – and you’re back in Windows!

When the login prompt appears, sign in (using that username and password you filled in earlier)… and from the command prompt:

sudo apt-get install openssh-server

(see below) – to install the openssh-server. OpenSSH allows for an encrypted channel between your desktop and the VM, and once this is established, you can use PuTTY to handle the VM – in the same way you would with a remote-hosted account.

install openssh-server
install openssh-server

When this is finished (under a minute), the next command to issue is

ifconfig

which will reveal the local network address for your VM – it’s usually on the ‘eth0’ line up top. This will be an IP address in the form 192.168.xx.128, where ‘xx’ is a number assigned randomly. It won’t interfere with any other local addresses. This is the address you’ll use with PuTTY and your web browser(s).

IP address for VM
Find the IP address

at this point, you can switch away from your VM (Ctrl-Alt releases the keyboard/mouse) and use PuTTY to handle additional administrative chores.

Why use PuTTY when the VM allows you to log in to a command line? Convenience. PuTTY has features not available at the command line.. most useful is the scrollback buffer, where you can see the last several hundred (!) lines of output; followed by copy-and-paste operations. I also prefer using PuTTY in a black-text-on-light-background, and being able to set the font size.

(The next several steps may be completed from the command line within the VM or via PuTTY secure-shell connection.)

From the command line, do this:

sudo apt-get install mysql-server

Enter your password (if requested, after a time or two Ubuntu remembers that you’re the Super User), and let the install proceed. You should be asked for a password; give it the MySQL root password you picked earlier:

MySQL root password
Enter the password here

Next in line, let’s install PHP:

sudo apt-get install php5

and let that go through.

When all that’s complete, it’s time to install phpMyAdmin – which is located in the next part!

Bringing Linux to Windows – part 1

Part 1 of 3

Linux on a Windows desktop – why?

The idea is to provide a learning and development environment; to have my Internet & Web Architecture students be able to use the same environment at school and at home.

At school, we have a standard Ubuntu-Linux server running with the usual Apache2 webserver, PHP/MySQL, ssh terminal access, PHPMyAdmin and a few other utilities. Alas due to firewall configuration this environment is only available from on-campus locations – which imposes a serious time handicap on students.

Thus, let’s use the power of virtualization to bring the same environment to student machines. Basically, any Windows-based computer should be able to handle this, as long as the computer has at least 2 GB memory and 10-15 GB of disk space available.

Parts list:

Hardware:

Windows-based computer; the more powerful the better, but most systems made since 2006 are likely to work. Minimums are 2 GB RAM, 10GB disk, Windows XP and a dual-core CPU.

Software:

Ubuntu Server 12.04 LTS; download ISO as appropriate to your host system (64 bit or 32 bit).

VMWare Player – I recommend using version 3 for Windows XP, or the current version 6 for Windows 7 or 8.

PuTTY – ssh client for Windows; freeware.

Before beginning this, it’s time to make a few notes. You’ll need to assign a username for the Linux user, a password for that user, and a password for the MySQL root account. It’s a good idea to write this down somewhere (or in a text file you can access).

Ready? Grab a beverage, get out your software downloads, and let’s start.

First up – install VMWare. Accept the default choices. When it’s done installing, open it up and you should get this screen (although you may get a message trying to sell an upgrade to workstation – if so just close that and proceed):

VMWare home screen
First step in creating a new Virtual Machine.

When you get to the home screen, it’s time to create your Virtual Machine. Click on “Create Virtual Machine.”

My preference is to load from an ISO file (what you downloaded); it’s much faster to read from a hard disk than from a CD (plus you save all the time needed to ‘burn’ the ISO onto the CD).

VMWare iso selection
Make sure you pick the correct ISO

Next up, find your notes and enter in your username and password. Yes, you need a password. You can change it later from the command line, but you will still need a password.

VMWare id password entry
Add your name as well.

Next up, name your virtual machine and put it somewhere. Usually the defaults are fine.

Now it’s time to set the Disk Capacity for the VM. My opinion – for a 32-bit system set the value to 8 GB; on 64-bit use 12 GB. As noted below, 12 GB allows for a quite elaborate server.

VM Disk size selector
Disk capacity selection

Whether you use a single file or multiple files is largely a matter of personal choice. If you intend to move this around to another system then multi-file may be better (due to FAT32 size limits; and most USB thumb drives are FAT32-formatted).

The next screen should be similar to this:

VMWare ready to run
Ready to install Ubuntu!

And once you click “Finish” it will be on to the next part of this post!