Thursday, February 26, 2015

Installing STATA on Debian GNU-LINUX


I needed to install STATA to collaborate with a colleague at work. The computer guy gave me the software on a disk, with an installation guide. Here are the commands I entered following those instructions:

Create a directory for Stata
# mkdir /usr/local/stata13
# ln -s /usr/local/stata13/ /usr/local/stata
Install Stata
# cd /usr/local/stata13
# /media/paul/Stata/install
Stata 13 installation
---------------------

  1.  uncompressing files
  2.  extracting files
  3.  setting permissions

Done.  The next step is to run the license installer.  Type:

        ./stinit
If the licensed software is Stata/IC 13, you will be able to run Stata/IC by typing
        xstata              (Run windowed version of Stata/IC)
        stata               (Run console  version of Stata/IC)

Run the license installer
./stinit
There follows some questions about user name and affiliation. "The two lines, jointly, should not be longer than 67 characters."
Then comes the message:
Stata is initialized.
You should now, as superuser, verify that you can enter Stata by typing

        # ./stata
or
    # ./xstata

I added this to my .bashrc so that stata and xstata can be used as a command directly:
 export PATH=$PATH:/usr/local/stata

Both command "stata" and "xstata" work as a normal user now.

There is an error message when running xstata:
'Failed to load module "canberra-gtk-module"'
But this was not a problem at the start.

GNOME application launcher


I added STATA to the GNOME application lancher, by typing "application" in the launcher, then "main menu", "new menu".

R to Stata

I use R most of the time for data analysis and will export csv files to STATA.
R command to export csv files:
write.csv(dtf, "filename.csv", row.names = FALSE, na = ".")
STATA command to import csv files:
insheet using "filename.csv", delimiter(",")


Wednesday, February 11, 2015

Big scientist

Hilary Mason:
Big data is data that cannot hold on one node.
[...] Some people spread the idea that big data will tell you what to do. [...] This is bullshit, it concerns me that this is starting to get steam outside of the tech community.
Neha Kothari
Linked In Hadoop cluster contains information on all clicks made by users. 1000 employees have access to the cluster and run queries on the data with pig. 
 Women in data science

Tuesday, February 10, 2015

LIbre office crash at startup

Since I opened a bizarre Excel document. Libre office crashed at startup. Deleting the user profile solves the issue:

rm -r .config/libreoffice/4/user/

Monday, February 09, 2015

Bulk resize images with a shell script and imagemagick

I like to resize images to 1000 pixels wide before sending them per email, it's large enough for most screens and I can send a dozen of pictures without cluttering my friends inbox. A pity that in 2015 there is still no easy way to do this integrated in the Gnome file manager. Maybe there is another way, or maybe I should use a proper image management program. Add a comment on how you resize images. 
 
But it's easy to create a shell script:
#!/bin/sh
mkdir -p small
for i in *.jpg; do
    echo $i;
    convert $i -resize 1000x small/$(basename $i .jpg).jpg;
done
Since I had images ending with .JPG extension in capital letters, I added a second loop:
for i in *.JPG; do
    echo $i;
    convert $i -resize 1000x small/$(basename $i .JPG).jpg;
done

Inspired by this question on stack overflow, and the mkdir complain corrected by looking at this question.

Thursday, February 05, 2015

Debian GNU-LINUX communications

Ekiga

Ekiga seems to be the tool to use for audio and video calls on the Gnome desktop. Ekiga is based on a communication framework called Telepathy which enables connection by multiple clients simultaneously.  What communications network should I use?

Skype

I use Skype to communicate with Windows users and also with some other Ubunutu-GNU/Linux users. Would it be possible to use other tools to communicate with them?

Recordmydesktop

Recordmydesktop can be started from the command line, a flag is required to use the pulse sound server:
recordmydesktop --device pulse

Stop recording with CTRL+C.
To use the GUI, the advanced / Sound / Device setting should also be changed to "pulse". To stop a recording started from the GUI, show the Gnome bottom bar, using the windows + M key, then press on the icon that appears there.

As explained in this Fedora forum, Gnome also has an own desktop recording system which can be started and stopped with CTRL + SHIFT + ALT + R.

 Webex

Some colleagues would like to use Cisco Webex. This requires the Java plugin for Firefox. Based on this blog, I installed it with:
$> apt-get install icedtea-7-plugin
This will install web browser plugin based on OpenJDK 7 and IcedTea. 

But there is no sound. Because Webex uses a proprietary 32 bit sound application, the only fix seems to be to install a 32 bit version of Firefox / Iceweasel.

Blog: Webex support on 64 bit Fedora Linux system explain that 32 bit version of has to be used:
"One means of successfully accessing WebEx from Fedora 12 x86_64 is to use a 32-bit version of Mozilla Firefox with Sun JRE and Adobe Flash 32-bit plugins.
Why 32-bit?
  1. Per the JRE download site, the 64-bit version does not have support for java applets or Java Web Start (JWS is required to run another WebEx like app named Elluminate).
  2. Per the WebEx System Requirements page only, 32-bit versions of Linux are supported."
Blog: Install 32 bit Firefox and Thuderbird on Debian 64 bit.
Blog: 32 bit applications on 64 bits Linux Mint

This user had an issue with i386 packages and explains how to remove them from his system. How do I remove all i386 architecture packages from my Debian installation?

The Debian multi architecture page explains how to install 32 bit programs (called the i386 architecture) on a 64 bit machine.