Thursday, 29 November 2012

Anyone following the MIT Introduction to Computer Science and Programming course, with lectures from the superlatively knowledgeable Professor Eric Grimson will know that it is not so much an introduction, more of a repeated duckstooling into the deepest waters of abstract mathematics, incremented by doses of extreme maths for prodigies and geniuses, topped off with a subtle course of extra curricular Iterative and Recursive Algorithms, Objects, nested recursive multi-dimensioned Tuples and much more. It is heavily maths orientated so realistically is aimed at high level and dedicated coders with potentially burgeoning careers in certain areas of web engineering, as you would probably expect from an institution which traditionally mentors students from within the top 1% of the worlds intellectual talent. An interesting course which demonstrates crossing the line between just being an average Python programmer and being one in absolute control, Professor Grimsons mastery of the subject matter is palpable. As I have inferred, despite the name it is not entry level and it is followed by many experienced programmers.

Those who drop out may nonetheless be interested in Speedcrunch and Gcalctool, both decent calculators for Centos 6/RHEL.

Speedcrunch Centos 6

Featuring sin, cos, tan, asin, acos and atan keys, views for Math book, Constants, Variables and Functions & including a full screen mode for when small just wont do, Speedcrunch is a very useful tool. Results are displayable as Binary, Octal, Hexadecimal and Decimal with Decimal being available in three formats, General, Scientific and Engineering & 50 decimal digits.The symbols used are computer keyboard friendly, for example the divide and multiply keys are identical to your keyboard for easy input and it has a handy exponent key. It is cross platform on Linux, Windows and Mac so users of the latter two happening upon this post can obtain it at the link above, whilst Linux users can use the rpms which I prepared, further down the page.It's handy if you are using the minimal Fluxbox version as I do and don't have access to Gnome desktop accessories.

Although I believe it is now in the Epel repoI converted the supplied deb files to rpms with Alien and it runs fine on Centos 6, so get them below if you have any problems with the repo.

Install it with$ sudo rpm -Uvh <file_name>Run it with$ speedcrunchGcalctool, now renamed simply 'Calculator' is another fine calc built by the people at Sun and available in the Epel repo. It has multiple modes and below is an example in the Scientific mode.It has a formidable array of features including a Programmers mode, user editable constants and functions & accuracy levels configurable up to 9 significant figures/places so it is extremely versatile.

Gcalctool Centos 6

If you have the epel repo enabled just issue$ sudo yum -y install gcalctool to get it.Run it with$ gcalctoolThese are the two calculators which I use for various tasks and they cover the large majority of needs up to mid range mathematics, although professional mathematicians will no doubt use more powerful devices.

Tuesday, 27 November 2012

Fluxbox key bindings.Fluxbox key bindings make life easier on your Centos 6 box as you can assign your programs to be opened with just a keystroke, namely the F1 - F12 keys and Mod1 (Alt) or Mod4 (Microsoft logo) + a letter.If you haven't yet installed Fluxbox then as long as you have Epel repo its straighforward, so fetch it with

Set up your shortcuts in Fluxbox as below.Hit Alt+F2 to run Thunar or your chosen file manager, check the 'show hidden files' box from the 'view' menu and browse to the .fluxbox directory which is normally hidden.Open the 'keys' file with vi and add at the top 'F1 : ExecCommand thunar' (or your file manager) then copy/paste it 10-12 times.Change the other F1 entries to F2 etc and change the program it runs, for eg F2 : ExecCommand rxvtF6 : ExecCommand beaverF9 : ExecCommand google-chromeF10 : ExecCommand firefoxThat's fine to start with, save the file, close off file manager and restart fluxbox to register the shortcuts (right click and select restart, change styles here also - try zinek_darkblue).More fluxbox options available at /usr/share/fluxbox + info at http://fluxbox.org/

Fluxbox is highly customisable and the F1 - F12 shortcut keys open your most used programs very quickly. (Alt+F2 to run others or create shortcut/symlinks in the Desktop folder as below).$ cd Desktop $ sudo ln -s /usr/bin/<prog_name>More keyboard shortcuts.You will likely run out of keys for your programs using just F1 - F12, so you can add more by using the Mod1(Alt) & Mod4(Microsoft logo) keys, for example Mod1 g : ExecCommand gimp, (Alt + g) to run Gimp, or another example Mod4 g : ExecCommand gimp, (MicroSoft logo + g) again to run Gimp.Mod1 and Mod4 keys + letters gives another 52 shortcuts.More information on this can be found athttp://fluxbox.sourceforge.net/docbook/en/html/fluxbox-man.htmlFluxbox Autostart Programs

Dillo is a fast lightweight browser based on FLTK (fast light tool kit). Written in C and C++, it is known for its small footprint and lightening fast rendering of web pages. It has a novel bug meter for detecting bugs and contributions from new developers are encouraged. Although there is deliberately no support for images and scripts it is nonetheless a useful addition if you are looking for a featherweight browser without going the text based route.To install Dillo on your Centos 6/RHEL box, first make sure you have kernels and compile tools sorted as in this tutorial.Download FLTK (need 1.3.0 +)Download Dillo (latest recommended)Both to your home directory, get dependencies first, you needopenssl and an --enable-ssl flag on configuring.$ sudo yum -y install openssl openssl-devel$ sudo suFirst build the FLTK source files# cd /usr/src# tar xvf /home/<user_name>/fltk-1.3.0-source.tar.gz# cd fltk-1.3.0# ./configure# make && make install# cd and remove the install files# rm -rf /usr/src/Now install Dillo# tar xvf /home/<user_name>/dillo-3.0.2.tar.bz2# cd dillo-3.0.2# ./configure --enable-ssl# make && make install# cd and remove the install files# rm -rf /usr/src/dillo-3.0.2# exit Run it with $ dilloSee Fluxbox key bindings for more information.

Dillo's page rendering is sometimes strange due to lack of image and script support but if you can live with that it is a very fast and useful browser.

To zip up a test folder containing various compressible files and using default and maximum compression.$ zip -r test1.zip test_folder$ zip -9 -r test2.zip test_folderAlthough it often does not seem that the compression makes all that much difference, those are the usual commands.To unzip the folder or file just$ unzip <zip_file/folder_name>Zip folders in Linux are usable cross platform.$ zip -h for more options and flags.That's it, simple zipping and unzipping.