Linux User Group of Mauritius Promoting open source software in our beautiful island

19Dec/150

MaxCDN sponsors GNU Bash logo redesign

Posted by Ish

bash-orgOn 16 December 2015, Chet Ramey, the maintainer of GNU Bash announced an excited piece of news, that of new logo proposals for GNU Bash. The iconic Bash logo seen on the left was taken from tiswww.case.edu/php/chet/bash/bashtop.html.

Depending on the number of votes from the community, one of the below designs could soon sport GNU Bash.

new-bash-logo

Bash, which is a short form of writing Bourne Again Shell, is a Unix shell that comes bundled in Linux distributions and OS X. Released in 1989, GNU Bash was welcomed as a free software replacement for the Bourne shell.

Unfolding the story behind the Bash logo designs

maxcdn-logoI had this chat with Justin Dorfman, a fellow designer at MaxCDN, who had the idea of the GNU Bash logo redesign. As Justin explains, MaxCDN encourages its staff to contribute to Open Source in various ways.

Now, Justin is a huge fan of Bash, he adores stickers and realizing that GNU Bash doesn’t have an attractive logo, he wrote to Chet Ramey in September asking whether he would be okay with MaxCDN sponsoring a logo redesign. Chet showed the green light and Justin also obtained approval for resources from MaxCDN.

Justin says ProspectOne, the company behind jsDelivr and another freelancer were hired for the task. When the proposals were sent to Chet, he chose three designs by ProspectOne but could not further decide which one to select. Therefore they decided to let the final choice be that of the community and Chet sent the announcement on the bug-bash mailing list.

On the first day ~200 votes were recorded. A user by the name ‘anlar’ then posted about voting for the new bash logo on Reddit, which garnered 160 comments. At the time of writing this post over 12,000 votes were recorded, with logo no. 2 earning 79.3% of the votes.

gnu-bash-votes-10k

I thank Justin who provided me an insight of the story behind the new Bash logo. Below are some of the designs that were among the initial proposals.

BASH-new-logo-2015-v5
BASH-new-logo-2015-v6

Is the final GNU Bash logo decided yet? Nah. You still have time to vote for your favorite. Please visit the page, and cast your vote now.

The post MaxCDN sponsors GNU Bash logo redesign appeared first on HACKLOG.

Tagged as: No Comments
28Nov/150

Customize the shell prompt

Posted by Ish

During the week I confused the hostname of a friend’s machine to be his username. He has a MacBook Pro and the shell prompt in OS X displays like:

Hostname:CurrentDirectory User$

My openSUSE laptop has the following prompt and I like it this way:

ish@coffee-bar:~>

He then asked me how to customize the shell prompt. Now, the shell prompt consists of a set of characters that appear every time the shell is ready to accept a command; like we see above. In order to customize the shell prompt with information that we want to display we need to provide some special characters to the PS1 variable (PS stands for ‘prompt string’). Additional input can be provided through PS2, PS3 etc but that’s outside the scope of this post.

We can set the prompt temporarily trying various combinations of special characters by executing something like export PS1="[t w] $ " to see a prompt like [14:52:48 ~] $.

customize-shell-prompt

As we can see above different sets of special characters can be used to customize the shell prompt accordingly. The table below shows various special characters that can be used to further customize the shell prompt.

Variable Description
t Prints the current time in hours, minutes and seconds.
@ Prints the current time in 12-hour am/pm format.
$ Displays the user prompt ($) or root prompt (#), depending on which user you are.
h Prints the hostname of the computer running the shell.
H Prints the full hostname (e.g localhost.localdomain).
u Prints the current username.
w Displays the full path of the current working directory
W Displays only the current working directory base name (e.g /var/log/nginx will be shown as ‘nginx’ only).

To make the shell prompt customization permanent, the value of PS1 can be added to the .bashrc file in the user’s home directory (e.g /home/username/.bashrc).

The post Customize the shell prompt appeared first on HACKLOG.

Tagged as: No Comments
18Oct/150

Extend battery life on Linux with PowerTop

Posted by Ish

One of the greatest fun spoilers when loading your favorite Linux distribution on your new laptop is battery life.

Yes, the battery life that goes upto 4 hours with Microsoft Windows could easily drain down to 2.5 hours with a classic Ubuntu installation. A major argument will be that Linux distributions do not come with optimized under-the-hood power settings. We should not forget that most Linux distributions aim to support a majority of computer hardware out of the box. We are surely happy that we do not need to struggle with hardware incompatibility issues, driver versions etc, as it could be the case with a Windows installation. However, the downside is that the Linux kernel could be bloated with “stuffs” not required for your laptop.

In a recent past there was a tool called Jupiter that allowed some handy power consumption optimizations. The project is now discontinued.

Some claim that TLP which was originally designed for ThinkPads, could optimize power consumption on other brands. I had no such luck with an Acer Aspire notebook.

Recently, I tried PowerTop, a power-management utility by Intel that enables a series of powersaving modes in userspace, kernel and hardware. PowerTop can also monitor and identify applications with a high power demand. I’ve used PowerTop to extend the battery life of my ThinkPad from 3.5 hours to 6 hours; a whopping 2.5 hours gain.

Powertop can be installed from the Ubuntu software repository.

sudo apt-get install powertop

At first run, you need to calibrate it so as it gathers as much information about your machine.

sudo powertop --calibrate

This could take up some minutes and the screen would flicker and even turn off for a while. Do not panic, just let it run and go grab a coffee.

Once done, PowerTop will load with an “overview” of your running applications, their power consumption and battery life estimation. Press the “tab” button to navigate through. The “tunables” tab lists a series of settings that have been applied to your system.

powertop-tunables

After the calibration, PowerTop will have a list of measurements that it could use to tune your system every time you launch it. Therefore, next time you may launch PowerTop as follows:

sudo powertop --auto-tune

Ideally, you could also start PowerTop when the laptop boots. Just add the following in the /etc/rc.local file before the exit 0:

# Loading power-saving schemes
powertop --auto-tune

On that note, happy power saving :)

The post Extend battery life on Linux with PowerTop appeared first on HACKLOG.

Tagged as: No Comments
11Oct/150

Node.js smart server by Yog Lokhesh Ujhoodha

Posted by Ish

The Linux User Group of Mauritius organized a Node.js presentation yesterday at the University of Mauritius. Logan announced the same weeks ago and the prez was done by fellow Yog Lokhesh Ujhoodha.

The night before I had a “Happy Hour” party with colleagues and consequently Saturday morning left me drowsy. I reached the University of Mauritius before noon and was damn hungry. I was looking for room 2.12 when I met Yog, Logan and Humeira who were chatting near in the corridor. Others were having a casual talk in a smaller room while waiting for another class to be free. We needed the projector and a little bit of electricity to power Logan’s laptop :) The fellow has been doing a nice job by supplying gear for broadcasting the meetups on YouTube and allowing remote participation through Google Hangout. Kudos for that!

Thanks to Veer who was heading for the cafeteria, I asked him to bring me some food too. That saved my life :)

The prez started around 12h30 with a dozen participants in the class and several others through Google Hangout.

yog-nodejs-prez

Node.js presentation by Yog Lokhesh Ujhoodha

lugm-usual-suspects-at-nodejs-prez

LUGM usual suspects :)

Yog introduced Node.js and cleared the myth whether ‘Node.js’ is a webserver. It’s a runtime that executes JavaScript on the server-side using Google’s V8 open source JavaScript engine. I particularly liked the flow of his prez in the sense that he described a problem and what followed was how he would tackle it. Along the way, he gave an overview of web server architectures laying emphasis on multi-threaded vs event-driven; while taking Apache and Nginx as examples.

Yog explained through his code, how he identifies the number of CPU cores in a machine and proceeds with forking of child processes.

var cluster = require('cluster');
var numCPUs = require('os').cpus().length;

if (cluster.isMaster) {
    // fork workers
    var proc = Array();
    for  (var i = 0; i < numCPUs; i++) {
        proc[i]=cluster.fork();
    }
}else{ //forked worker

}

Later on he would explain how he runs the child process on a specific CPU core and thus eliminates delays caused by CPU switching [etc..] which he explained initially when describing webserver architectures. Those who missed the meetup can catch up on YouTube.

As and when Logan would switch to remote participants, Nitin and I grabbed the moment to discuss about his new blog tunnelix.com. I also showed Humeira the Firefox OS running Orange Klif mobile.

While others left after the presentation, some of us headed to Bagatelle Mall for a chill-out moment.

The post Node.js smart server by Yog Lokhesh Ujhoodha appeared first on HACKLOG.

Tagged as: No Comments
2Oct/150

LUGM at Infotech 2015

Posted by Ish

I had a brief visit to Infotech 2015 today. An important task was to deliver Logan the banner of the Linux User Group of Mauritius (LUGM). He’s been demo’ing some cool Arduino based robots since yesterday along with Christian Gunnoo. When I reached the Swami Vivekananda Int’l Convention Centre today, I first looked out for the LUGM fellows. I saw Mike & Jessica were there having a chat with the geeks. Cool, I jumped in the convo, greeted everyone and gave Logan the banner.

lugm-infotech-2015

Next to LUGM, there were fellows from the Middlesex University. They also had some cool Arduino projects to display.

On a sad note, the table arrangements got both LUGM and Middlesex University in a blind spot. They were on the same row as the National Computer Board outside the main hall. Nevertheless, I should commend the good work achieved by Logan & Christian to interact with young fellows who made it till there.

Next, I headed inside the main hall. I was looking for the stand of Amazon Web Services (AWS) but before that I got to meet Louis from ICT.io. I had a chat with him and another fellow I happened to meet there. In fact, they showed me where the AWS stand was and I hopped there.

I met Chris Perkins from AWS and we talked quite lengthily about the various cloud services. My main mission was to meet some technical guys and we could have a geek chat about how we’re building up the infrastructure for the next lexpress.mu. Yes! If that comes as a surprise, I now work for LSL Digital :)

aws-infotech-2015

Chris happens to be a Manager within AWS Cloud Support and we had a very interesting chat about operations, sysadmin skill set and all. Chris and his colleagues are in Mauritius to recruit for AWS South Africa. If you’re interested to put your genius in action and be part of the AWS family, you still got two days; put your laptop in the backpack and go meet Chris at Infotech 2015.

I then met Dinesh, an ex-colleague from Linkbynet :) We had a chat about the fun days when I was a Unix System Administrator at Linkbynet. We talked about the shortage of sysadmins and the gap that needs to be filled.

linkbynet-infotech-2015

I left around 13h30 and headed back to LSL Digital. I should be there, at Infotech 2015, tomorrow along with other LUGM members talking about Linux. Meet us at the LUGM stand :)

The post LUGM at Infotech 2015 appeared first on HACKLOG.

Tagged as: No Comments
26Sep/150

Introduction to Flask

Posted by Ish

On the 14th of September 2015, Avinash Meetoo replied to this email on the Linux User Group of Mauritius (LUGM) mailing list and showed interest in doing a presentation for the next LUGM meetup.

The meetup happened today in Curepipe. I was not able to attend it physically, but thanks to Logan who did the necessary for setting up a Google Hangout session, I joined around 13h00. Shortly after, Avinash started his presentation “Introduction to Flask”.

flask-intro-avinash-meetoo

He welcomed everyone who joined and gave a quick brief about the underlying infrastructure of webapps. I particularly liked the way he explained the model-view-controller (MVC) software design pattern; taking from there he talked about Python frameworks. The popular Django framework comes first, Avinash says. Django should be a powerful framework when a lot is needed for a project, like an interface for backend etc. However, if someone wants a pretty quick setup, say for example a prototype for demo’ing to customers or a small web application, there is this Python micro-framework called Flask that comes handy. Avinash explains why it’s called a “micro” framework; reason being it’s limitation to a subset of functions that full stack Python frameworks would offer. Nonetheless, the functions in Flask are pretty enough for setting up web applications.

flask-logo

Avinash mentioned how he uses Flask in his many projects at Knowledge Seven and how he designed his web application electionsmauritius.com. He and his wife, Christina, came up with an idea about a web application to help Mauritians vote intelligently, two weeks before the General Elections 2014. Avinash then put his genius in the making of the “Elections Mauritius” webapp.

During the presentation, Avinash showed a demo of a simple web application and unveiled the code behind his “Elections Mauritius” web application. The prez lasted for approximately 50 mins including the questions & answers at the end. Those who missed the Hangout session can still catch up on YouTube and once again, thank you Avinash :)


Flask logo used from flask.pocoo.org.

The post Introduction to Flask appeared first on HACKLOG.

Tagged as: No Comments
18Sep/150

Nginx virtual host configuration

Posted by Ish

What is Nginx?

Nginx (pronounced engine-x) is a reverse proxy which gained popularity in the recent years. A lot of people, including me, use Nginx as a web server thanks to its event based multi-protocol support. Nginx supports HTTP and that is what we need to run it as a web server. The strong point of Nginx compared to traditional web servers is that each spawned process of Nginx can handle thousands of concurrent connections. Nginx does not embed programming languages within its own process, therefore all dynamic handling (such as PHP) is done through a backend server. PHP-FPM works great as a backend server to handle PHP scripts.

Nginx configuration

Nginx virtual host configurationBefore we dive into the Nginx virtual host configuration, we might need to grasp a little bit of the basics. The Nginx configuration can be classified in two parts; the directives and the contexts. A directive is an identifier that can accept one or several configuration options. A context on the other hand is a section which may contain several directives. The word “context” is mostly used in the Nginx documentation rather than “section”.

A directive would be as follows:

worker_connections 768;

A context would be like:

events {
    worker_connections 768;
    # multi_accept on;
}

A context may contain one or several directives within curly brackets {}. Directives can be disabled by commenting them with the # symbol.

To define a virtual host in Nginx we create a “server” context. This context will handle configuration directives like the hostname, the root directory etc. A basic virtual host in Nginx looks as follows:

server {
    listen 80;
    server_name mysite.com;
    
    root /var/www/mysite;
    index index.html;
}

The configuration tells Nginx to listen to port 80, handle requests for “mysite.com” and serve contents from the /var/www/mysite directory. The index directive tells Nginx to set “index.html” as the default file to serve.

Backend interaction

There is a sub-context called “location” within the server block. The location context handles URI matching. It tells Nginx what to do when a particular URI is sent by the client. Backend communication happens by sending the request to the backend server once the URI matching is completed and conditions are met. The server context may have server location sub-contexts; as we in the example below:

server {
    listen 80;
    server_name mysite.com;
    
    root /var/www/mysite;
    index index.html;

    location / {
        try_files $uri $uri/ /index.php;
    }

    location ~ .php$ {
        include fastcgi.conf;
        fastcgi_pass 127.0.0.1:9000;
    }
}

If a URI ends with .php the request is sent to the PHP5-FPM backend server. If a URI does not end with .php the location / is used. Nginx tries to search a file that matches the URI; if that fails, it tries to find a directory of that name and serves the index file. If both fail, the request is redirected internally to /index.php and the request is handled by the backend server.

The post Nginx virtual host configuration appeared first on HACKLOG.

Tagged as: No Comments
31Aug/150

Quick fix for fast forward youtube

Posted by logan



Symptom

Youtube loads but there is no sound, and youtube seems to be playing in fast forward mode.

After digging around, I realised that the sound sub-system of Linux needs to be badly fixed. It tries to play through the audio HDMI port first. Youtube should also fix their sound output code on Linux. The trick is to disable the HDMI codec driver for the sound.

Add this line in modprobe.conf: blacklist snd_hda_codec_hdmi

I've seen huge threads about this problem on various forums. Maybe this will help a few people.

Tagged as: No Comments
29Aug/150

Linux Meetup (29/08/2015)

Posted by logan




A Linux Meetup after a long time !

We held our first meetup after a very very long time :) I wasn't expecting 71 people, but we got around 13 people who showed up. Quite a few couldn't make it at the last minute. The usual suspects showed up with the addition of Ashvin, who made it this time :) 2 employees of Mauritius Telecom were also present.

group

Bufferbloat explained

I demo'ed and explained the bad latency that Internet Users experienced on the DSLresport website. I explained how, once you cross 5MB/s, your bandwidth isn't that important anymore. Now, we need to talk about latency . When, I showed how by implementing CoDEL we could solve the latency problem, the 2 employees of Mauritius Telecom understood the issue at hand. Unfortunately, none of Emtel, Canal+ or Bharat Telecom engineers were around, sadly.

I hope that ISP guys get the message concerning the need for low latency in Mauritius for us to be able to benefit from a good service for services like VOIP, gaming, teleconference, and IMs.

With Open Source software and Linux, we were able to show how we can still achieve low latency while saturating both our uplink and downlink on a Mauritius Telecom MyT/30 Mbit/s connection. Quite a few people, in particular, Ajay Ramjatan & Shaan Nobee asked a lot of questions regarding fq_coDEL and the theory behind AQM.

I sincerely hope to see University Students pick up on research related to bufferbloat and how to fix it. I hope that Wifi will be fixed, as well as possibly adjusting coDEL for Mauritius.

There were a few questions regarding the IETF, and the applicability of standards. I explained how participation in standards is crucial for emerging countries like ours. In particular, I emphasize on the importance of sending Networking and Systems Engineers to conferences like the IETF, through the budget for training, rather than sending marketting guys, who would never be able to sell anything to a knowledgeable engineer. Too many IT companies think that investing in training is too expensive, and do not realise how they can grow their portolio of services for their customers.

Overall, It was a fun meetup. I hope that we, Linux users, can work together with ISPs to fix the latency issues that 99% of customers are currently experiencing right now.

URL for my presentation: my presentation
Dave Taht's talk on Bufferbloat At Stanford:
Dave Taht talk at Stanford

--Logan
C-x-C-c

Tagged as: No Comments
5Aug/150

LibreOffice 5 installation on openSUSE, Fedora, CentOS etc…

Posted by Ish

Twitter’s flooding with LibreOffice 5’s arrival. Oh! Flooding? Well, only if you’re following the *nix geeks :)

LibreOffice 5 was released today. Those who are used to only hear about the Microsoft Suite, well there exist other productivity suites out in the wild. LibreOffice is among them. It was forked from OpenOffice in 2010. Since then several Linux distributions bundled the LibreOffice Suite in their default install. LibreOffice is written in C++, Java and Python, and is available in 114 languages.

The LibreOffice 5 official package should be rolled out for the stable distros in the coming weeks, if not months. As for the curious who’d like to get hands dirty, just follow the article for a LibreOffice 5 installation. One thing, I’ve kept in the title openSUSE, Fedora and CentOS but the installation would cater for any RPM-based distribution. I haven’t tested the DEB archive but I guess it should be somewhat similar.

LibreOffice 5 installation

The tarball can be either downloaded by visiting the download page at libreoffice.org or from this mirror. Torrent links are available too. Once you have obtained the package LibreOffice_5.0.0_Linux_x86-64_rpm.tar.gz you uncompress it as follows:

tar zxvf LibreOffice_5.0.0_Linux_x86-64_rpm.tar.gz

The extracted files & folders include an installation script licensed under MPL v2. You may peek into if you’d want to know what it does.

Enter the directory that contains the install script and launch the installation as follows:

./install RPMS .

The second dot implies that it should be installed at the current path. Hit enter and the progress will be shown.

####################################################################
#     Installation of the found packages                           #
####################################################################

Path to the database:        /home/ish/Downloads/LibreOffice_5.0.0.5_Linux_x86-64_rpm/.RPM_OFFICE_DATABASE
Path to the packages:        RPMS
Path to the installation:    .

Installing the RPMs
Preparing...                          ################################# [100%]
Updating / installing...
   1:libreoffice5.0-ure-5.0.0.5-5     ################################# [  2%]
   2:libobasis5.0-core-5.0.0.5-5      ################################# [  4%]
   3:libobasis5.0-en-US-5.0.0.5-5     ################################# [  7%]
   4:libobasis5.0-writer-5.0.0.5-5    ################################# [  9%]
   5:libobasis5.0-base-5.0.0.5-5      ################################# [ 11%]
   6:libobasis5.0-impress-5.0.0.5-5   ################################# [ 13%]
   7:libobasis5.0-en-US-calc-5.0.0.5-5################################# [ 16%]
   8:libobasis5.0-en-US-writer-5.0.0.5################################# [ 18%]
   9:libobasis5.0-en-US-res-5.0.0.5-5 ################################# [ 20%]
  10:libobasis5.0-en-US-math-5.0.0.5-5################################# [ 22%]
  11:libobasis5.0-en-US-base-5.0.0.5-5################################# [ 24%]
  12:libobasis5.0-images-5.0.0.5-5    ################################# [ 27%]
  13:libreoffice5.0-5.0.0.5-5         ################################# [ 29%]
  14:libobasis5.0-math-5.0.0.5-5      ################################# [ 31%]
  15:libobasis5.0-draw-5.0.0.5-5      ################################# [ 33%]
  16:libobasis5.0-calc-5.0.0.5-5      ################################# [ 36%]
  17:libobasis5.0-pyuno-5.0.0.5-5     ################################# [ 38%]
  18:libobasis5.0-librelogo-5.0.0.5-5 ################################# [ 40%]
  19:libreoffice5.0-calc-5.0.0.5-5    ################################# [ 42%]
  20:libreoffice5.0-draw-5.0.0.5-5    ################################# [ 44%]
  21:libreoffice5.0-math-5.0.0.5-5    ################################# [ 47%]
  22:libreoffice5.0-dict-en-5.0.0.5-5 ################################# [ 49%]
  23:libreoffice5.0-impress-5.0.0.5-5 ################################# [ 51%]
  24:libreoffice5.0-base-5.0.0.5-5    ################################# [ 53%]
  25:libreoffice5.0-en-US-5.0.0.5-5   ################################# [ 56%]
  26:libreoffice5.0-dict-es-5.0.0.5-5 ################################# [ 58%]
  27:libreoffice5.0-dict-fr-5.0.0.5-5 ################################# [ 60%]
  28:libreoffice5.0-writer-5.0.0.5-5  ################################# [ 62%]
  29:libobasis5.0-ogltrans-5.0.0.5-5  ################################# [ 64%]
  30:libobasis5.0-postgresql-sdbc-5.0.################################# [ 67%]
  31:libobasis5.0-onlineupdate-5.0.0.5################################# [ 69%]
  32:libobasis5.0-ooofonts-5.0.0.5-5  ################################# [ 71%]
  33:libobasis5.0-filter-data-5.0.0.5-################################# [ 73%]
  34:libobasis5.0-kde-integration-5.0.################################# [ 76%]
  35:libobasis5.0-extension-javascript################################# [ 78%]
  36:libobasis5.0-xsltfilter-5.0.0.5-5################################# [ 80%]
  37:libobasis5.0-python-script-provid################################# [ 82%]
  38:libobasis5.0-ooolinguistic-5.0.0.################################# [ 84%]
  39:libobasis5.0-extension-report-bui################################# [ 87%]
  40:libobasis5.0-graphicfilter-5.0.0.################################# [ 89%]
  41:libobasis5.0-extension-mediawiki-################################# [ 91%]
  42:libobasis5.0-extension-beanshell-################################# [ 93%]
  43:libobasis5.0-extension-nlpsolver-################################# [ 96%]
  44:libobasis5.0-extension-pdf-import################################# [ 98%]
  45:libobasis5.0-gnome-integration-5.################################# [100%]

Installation done ...

If no errors occurred you should find a folder named opt created. This makes it easy if you want to move your LibreOffice 5 instance to the traditional /opt path. However, from the current path you can launch LibreOffice Writer as follows:

./opt/libreoffice5.0/program/swriter

LibreOffice 5 installation

You will get LibreOffice Writer, Calc, Base, Draw, Math and Impress with the following commands:

./opt/libreoffice5.0/program/swriter
./opt/libreoffice5.0/program/scalc
./opt/libreoffice5.0/program/sbase
./opt/libreoffice5.0/program/sdraw
./opt/libreoffice5.0/program/smath
./opt/libreoffice5.0/program/simpress

Otherwise, just shoot ./opt/libreoffice5.0/program/soffice and you get the LibreOffice 5 welcome screen with shortcuts to each application.

LibreOffice 5 installation


To have a clean setup, you could move the libreoffice5.0 folder to /opt and have some sweet symlinks. Let’s do it; stay on the current path and shoot:

sudo mv opt/libreoffice5.0 /opt
ln -s /opt/libreoffice5.0/program/swriter /usr/local/bin/writer

You could do for the rest, right? Now, press Alt + F2, type writer and hit the return button. LibreOffice Writer shoots up!

To my fellow non-Linux friendly folks, the free software community makes LibreOffice available for Windows and Mac OS X as well and installation is painless :)

The post LibreOffice 5 installation on openSUSE, Fedora, CentOS etc… appeared first on HACKLOG.

Tagged as: No Comments