Wednesday, August 19, 2015

Ref: Interview with Brian Kernighan

An interview done by Computerphile. Early days of C by Brian Kernighan.



Wednesday, July 29, 2015

Setup guacamole server on Slackware

I encountered the need to access some ssh/telnet/vns server through a client-less HTML5 web app.

Gooling gave me the best product and it is free, the guacamole server.  Looking at the building requirement of it at, I found Slackware by default does not come with all the components needed.  Follow the build procedure in the document, I started with building guacamole-server.

Building guacamole-server

I tried to build all the dependency in except for PulseAudio.  After look through the supported list of needed libraries, FreeRDP, libssh2, have build script at SlackBuilds.org, and libtelnet does not.  After installed FreeRDP and libssh2, I wrote build script for libtelnet, it built and installed without problem.

After I had all the libraries installed, I downloaded the server code guacamole-server-0.9.7.tar.gz.  The package does not come with a ready to use configure command, and have to use autoreconf -fi to bootstrap it.  The configure failed for not finding OSSP UUID library.  Slackware already comes with a uuid library from the util-linux package and it is better than the OSSP one.  So I developed a patched to use the uuid library from util-linux and it works without problem.

Building guacamole-client

The guacamole-client needs to be run under a Java Servlet server.  Luckily, SlackBuilds.org has all I need.  After installed the latest jdk, apache-ant, commons-daemon, apache-tomcat with sbopkg, I had a tomcat server up and running.  I still need to configured /etc/tomcat/tomcat-users.xml to allow to to use the manager GUI. I added the following line to it (of course the user name and password are not the real one I am using ^_^):
<user password="manager" roles="manager-gui" username="manager">
</user>
Guacamole-client needs Apache Maven to build, and SlackBuilds.org has a script for maven.  After installed maven, and with the command mvn package guacamole-client was built and a war file was created in guacamole/target/guacamole-0.9.7.war.  I made it install to /usr/share/lib/guacamole/guacamole-0.9.7.war and had it symbolic links to /var/lib/tomcat/webapps/guacamole.war.  Now I could saw it from Tomcat's manger GUI, accessing it with url http://localhost:8080/guacamole I got a blank screen :(, that was not good.  I have the impression that it should be very easy to setup, now it failed on me.  After reading the documentation again, and again, I realized I failed to setup a user-mapping.xml in /etc/guacamole/.  After follow the example, voila! it showed me the login page, after logged in, I was presented with the entries I had setup earlier in user-mapping.xml.  Links with remote servers are working great!

I am preparing SlackBuilds.org scipts to submit, should not wait too long for them to show up.

Tuesday, June 23, 2015

Protection for Text Messaging SPAM (For Rogers customer)

Sometimes I received spam SMS message, and just found out it could be reported to Rogers and get the credit back.
For protection against unsolicited and unwanted “spam” text messages, send us a text message with the 10-digit wireless number of the spam message to 7726 (SPAM). We will credit your account $0.15 for each reported SPAM message and it’s free to report SPAM. Premium messages (i.e. alerts, contests and promotions) that you have prompted will not be credited. You will not be charged for administrative (such as roaming, data alerts and service messages) or marketing messages that you receive from Rogers and therefore, those messages are not eligible for a credit.

Reference: https://www.rogers.com/web/content/wireless-text/wt_rtm

Tuesday, May 5, 2015

The Code: Story of Linux documentary

The Code: Story of Linux documentary is a very nice documentary about Linux.  You will see the early days of Linux and young 'Linus' and all the important people for the development of it. ^_^

Monday, May 4, 2015

Building Ada promgramming enviroment for Slackware

Slackware has finally upgraded the system GCC to 4.9.2 in current. Here I presented my work to compile GPS using FSF's GCC 4.9.2. It is based on my previous attempt to build the environment with GCC 4.7.0. This time lots of things have changed, new GCC and GNAT GPL released and they make the attempt much more easier than previous one. GCC 5.1 has just been released, but Slackware use 4.9.2 in the current branch for now, so we stick with 4.9.2.

The Compiler

There is no need to change the build script any more, but we need some of the compiler internal files. So run the standard build script for GCC.

XMLAda

For this one, I am using the xmlada-for-gps-6.0.1-src.tgz from GNAT GPL 2014, in stead of xmlada-gpl-2014-src.tar.gz. They are almost exactly the same with minor changes.

GPRbuild

I am using the gprbuild-gpl-2014-src.tar.gz. GPRbuild expected some support functions that are not in the FSF GNAT compiler. Namely the "GNAT.Rewrite_Data" package and some low level support functions in os_lib.c. I gather the missing functions from the GNAT GPL 2014 version and make up some packages for it. Then it builds without problem.

GNAT_UTIL

This GNAT Util Library provides access to GNAT compiler internals for AdaCore utilities. It makes the previous effort of trying to mimic what Debian do redundant. In the build script, the source and build directory of the GCC compiler needs to be specified for it to work correctly.
I am using the 4.9.1 one from the sourceforge project. For there is no 4.9.2 version and there are basically no differences for the generation of gnat_util.

GTKAda

With the standard gtkada-gpl-3.8.2-src.tgz, there is nothing special, it builds without problem. One may have to note that currently it does not support GL.

Aunit

Aunit GPL 2014 also builds without too much problem.

GNATcoll

GNATcoll compile without problem with some patches.

GPS

Oh, finally, we could build the IDE. It depends on pygobject3, which could be build using SlackBuilds.org's supply script.

Florist, ASIS, GNATMEM, Ahven

The rests are relatively easy and build fine with the build script. For gnatmem, we need to rebuild the binutils and specified the directory in gnatmem build script.

Other experimental scripts

I have tried to build the Ada-RM, GNAT RM, GNAT user guide to integrated with GPS, it seems working for me.

Where are the build scripts

All build scripts are available at GitHub.