Jan 21, 2016

Using SiS 771/671 graphics card with Ubuntu 14.04

Just a quick post to avoid losing this very useful bit of information: we have some older laptops laying around that were budget bargains. They have the following (old!) SiS graphics card:

01:00.0 VGA compatible controller [0300]: Silicon Integrated Systems [SiS] 771/671 PCIE VGA Display Adapter [1039:6351] (rev 10)

After trying in the past several times, somehow today my Google-fu was strong, and I found two useful bits of information:

  1. This PPA for Ubuntu 14.04 and 15.04 that holds the driver xserver-xorg-video-sisimedia, created by mati75:
  2. ArchLinux has the same driver available, so if/when this driver for Ubuntu is no longer viable, I get an excuse to play around with Arch! Awesome!
Following the instructions on the PPA page, I was able to get the laptops to use the native 1280x800 resolution, instead of 640x480. Ubuntu went from absolutely unusable to a very nice option! (using Lubuntu, by the way, but Xubuntu would probably also work decently.)

Dear mati75, Mateusz, thank you for creating that PPA!

Update: To help people in finding this, the laptop model information, from the BIOS. Notice the great serial number. Shame on you, Clevo.

root@user-M7x0S:~# dmidecode -t 1
# dmidecode 2.12
SMBIOS 2.4 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: clevo                           
        Product Name: M7x0S                           
        Version: Rev. A1                         
        Serial Number: 12345678901234567               
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Not Specified

Oct 30, 2015

Better rendering of Windows C-fonts (Calibri and others) on Linux Mint and Ubuntu

Recently I've been working on Linux Mint for my school and some of my friends. They needed to get Calibri and all the other Office fonts rendering decently on Linux to help in exchanging files with other people.

The problem is that these fonts have embedded bitmap versions of very low quality, and the font rendering system on Linux will choose these in too many cases. Modern fonts do not have bitmap versions, which is why every other font that is not from Microsoft will work beautifully on Linux.

The fix is to tell Linux to not use the embedded bitmaps in font files.
I want this setting to be applied to all users, so here are the instructions.

1- Open a terminal, and type:
sudo gedit /etc/fonts/conf.d/20-no-embedded.conf
You will need to enter your password.

2- Paste these lines in the text editor:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  <match target="font">
    <edit name="embeddedbitmap" mode="assign">

3- Close and save that file. To be absolutely sure the setting is applied, reboot your computer, or at least log out and log in.

That should do it!

Found at (among many other places):

Alternatively, you can use the fonts "Carlito" and "Caladea" instead of "Calibri" and "Cambria". Install them with this line:
sudo apt-get install fonts-crosextra-.*
Then you can use LibreOffice's font substitution table in the Options, to use Carlito and Caladea whenever it finds Calibri and Cambria in a document.


The Debian wiki also has a great explanation:

However, be warned that the proprietary versions will likely look much worse on your screen than the OFL ones. This is because Microsoft decided to embed surprisingly bad bitmaps in their fonts and Debian's fontconfig does not disable embedded bitmaps in scalable fonts.

Aug 12, 2015

Getting Google Classroom in English (or some other language)

Alright, so it seems Google Classroom is still not wise enough to use the language that you have configured in your Google Account or in your web browser language preferences (see here, for example).

While the Google engineers work their magic, you can use this nice link here to get to Google Classroom in English:


Here are two more:

If you want to do it by hand:
  1. Open Google Classroom in your favourite way.
  2. Click on the web browser's URL bar.
  3. Go all the way to the end, and add (without the quotes) "?hl=en"
  4. Press Enter

PS: Maybe this was this year's only and lonely blog post. Who knows? :)

Oct 21, 2014

BackupPC and Windows servers - Simple method

Slightly insecure, due to storing the user password, encrypted, on the client machines. See here:
http://cygwin.com/cygwin-ug-net/ntsec.html - section "Switching the User Context, Method 3"
The idea is to be able to backup all files, including open files ("locked"), by using VSS (Volume Shadow Copy Service).
You will need the files that I've shared here.
  • Add the domain user called "backuppc", using the Computer Management program in Control Panel, Administrative Tools. Make this user administrator of the local machine.
  • Download Cygwin 1.7+ from the regular place: http://www.cygwin.com/
  • Install the default Cygwin system, plus the following: cygrunsrv, openssh, and rsync
  • I also install nano (my editor of choice), and procps (for top)
  • Start a cygwin shell and type:
# ssh-host-config -y
# cygrunsrv -S sshd
# mkpasswd -l -u backuppc -d YOURDOMAIN.COM >> /etc/passwd
  • After doing this, check /etc/groups, make sure that the Domain Users group is added. If not, add this line to the end of the file:
    Domain Users:S-1-5-21-3835976426-429400520-196227251-513:10513:
  • I then attempt to ssh into my backupPC system from cygwin, just a nice test, and creates the .ssh directory for me.
  • Copy BackupPC’s public key over, by running this from the SRVR-UBackup server:
# ssh-copy-id backuppc@windows-server-name
  • Connect through SSH to the new server, and run this to store an encrypted copy of the user password on the new server:
    # passwd -R
  • Doing this allows the user to execute administrative operations when logging in using SSH passwordless authentication. Somewhat insecure, but easiest to set up, and should be reasonable in our case.
    NOTE: If it fails, try logging into the server with Remote Desktop as BackupPC, then run the Cygwin terminal as Administrator (righ-click).
  • Install the post-backuppc.sh and pre-backuppc.sh scripts from Windows-vShadow-simplified.zip to the backuppc home directory. Remember to make them executable (chmod +x), and make them owned by BackupPC@yourdomain.com
    NOTE: Carefully edit it to match the drives of the new server that you plant to back up.
  • Install the appropriate vshadow.exe from vshadow-versions.7z in C:\WINDOWS of the new server. Several versions are attached below. Make sure you rename it to vshadow.exe
  • Test the process by doing ssh to the new server as user backuppc, and running /home/backuppc/pre-backuppc.sh. You should see shadow drives come up in C:\shadow.
  • In the BackupPC configuration for the host, change the following:
    • Xfer:
      • RsyncClientCmd:
        $sshPath -c blowfish -q -x -l backuppc $host $rsyncPath $argList+
      • RsyncClientRestoreCmd:
        $sshPath -c blowfish -q -x -l backuppc $host $rsyncPath $argList+
    • Backup Settings:
      • DumpPreUserCmd:
        $sshPath -c blowfish -q -x -l backuppc $host /usr/bin/bash -l -c /home/backuppc/pre-backuppc.sh
      • DumpPostUserCmd:
        $sshPath -c blowfish -q -x -l backuppc $host /usr/bin/bash -l -c /home/backuppc/post-backuppc.sh

Nov 13, 2013

The next bubble to burst: how long will we have all these free cloud services?

A couple of weeks ago, I found this interesting blog post:
Microsoft Price Increases: Here it Comes Again!

The topic is quite obvious, but here is the quote that actually stuck out for me:
Anything being sold “as a service” to an enterprise today is probably being sold at a big loss in order to gain market share. Whether it’s Microsoft, Amazon, or someone else, the pricing is not sustainable. Subsequently, expect future cost increases to be much larger than the ordinary rate of inflation.
What does this mean, in practical terms? I believe we are in a "free cloud services" bubble, and that this quote means it is about to burst.

Amazon runs two very important cloud IaaS - Infrastructure as a Service - products: EC2 and S3. When they introduced EC2, they disrupted dramatically the hosting market. Suddenly, you could run your own server on Amazon's CPU power, on a "pay-as-you-go" model, at rock bottom prices. And you could store all of your server's data on S3 for equally disruptive rock bottom prices.

This enabled the appearance of a large amount of free cloud-based products that many educators know and love: Dropbox, Pinterest, Instagram, Voicethread, Edmodo... You can find some more interesting examples in their case studies page.

Amazon has been effectively subsidizing the EC2 (and all their other Amazon Web Services, quite a lot of them) with other parts of their business, to become the main player in this space. Eventually, they will need to increase their pricing to bring it back to sustainable levels. A price increase on Amazon's side will also enable Rackspace, Microsoft's Azure, and other cloud IaaS providers to increase their pricing in parallel. See above: "increases much larger than the ordinary rate of inflation".

When that happens, we will see a lot of their customers, all these free cloud providers, struggle with their business models. The key question is: How many of them will successfully absorb the increased costs? How many will choose to pass on these costs to their users?

What I see is a bubble about to burst. And we will need to get used to either paying for our cloud, or give it up.

What do you think? How much are you ready to pay for your cloud?

Oct 31, 2013

Open source tools for eBook creation

A quick post with links to resources for creating eBooks with open source software. For my own reference as much as to share with everyone...

This is the most interesting one, perhaps. Something you run on your own web server, and allows for collaborative, online book creation. Exports the finalized product to many different formats. No need to install anything on the user's computer, or restrict what they use.
"The open source platform to help you write and publish print and digital books.
Booktype makes it easier for people and organisations to collate, organise, edit and publish books. Delivering frictionlessly to print, third party services via an API and almost any ereader, Booktype facilitates collaborative production processes. No more lost manuscripts, overwritten Word files, awkward wikis or cumbersome CMSes."

LibreOffice plus eLAIX extension
Cross-platform, very low learning curve. You can quite easily create an ePub from anything you can open with LibreOffice Writer.
Interestingly, eLAIX is actually an expanded version of ePub, made for integration into Learning Management Systems, such as Moodle. Could be worth exploring.

Sigil ePub Editor
Cross-platform ePub creator/editor. You can start from scratch or by importing existing ePub or HTML files.
I can see this also being used as the finishing step after using LibreOffice for text input.

Calibre ebook manager and converter
More of an ebook manager, it can also convert from Word 2007, TXT, ODT, and even PDF (not the best idea!) to ePub or Mobi ebook formats.

If you know of more options, share in the comments!

Oct 29, 2013

Learning Python through competitive "bots" design

Another quickie:
Looking at making Python more fun for our students, I am now looking at these two options:

A remake in Python of the well known Robocode, a "robot arena" for (teaching/learning) Java.
It seems to be pretty complete, at least for using it in a classroom.

Update 18 Nov 2013: Installing this on latest Ubuntu is proving a challenge. Box2D 2.0.2b2 is not easy to find or install. While I think I can get it to work, it will be hard to get students to do it.
There is some hope for an updated version, but not yet available:

AI Challenge
This is a similar concept, but you write code that controls ants as they battle other ant hives. The code can be written in many different programming languages, though the toolkit itself is done in Python.
Originally you could submit your code to their server where it would fight other submissions. They had 8000 contestants!
Now you can get the tools and run it yourself, so that's where I'm thinking of going.

Update 18 Nov 2013: A new (to me) option:
Python RoboCode
This seems like another solid option.

Does anyone have any other interesting pointers? I am also planning to research more multimedia creation resources, maybe creating sound or image from Python code, so those tips are also welcome!