Creating a Debian netinst Bootable USB Stick with Non-Free Firmware

Debian installation can be a hassle when new hardware with non-free firmware support is necessary. A typical workaround is to use a Debian install image which includes non-free drivers.

Typically, such an ISO CD image is located under here.

Choose the installation you need (for now, it is amd64 Jessie RC1), and download an ISO image:

$ wget http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/weekly-builds/amd64/iso-cd/firmware-testing-amd64-netinst.iso

Find a USB stick (which you do not mind formatting entirely; all existing contents on the still will be wiped out with this method), connect it to a working box, and find the device pointer to the stick:

$ sudo fdisk -l
...
Disk /dev/sdb: 16.0 GB, 16008609792 bytes
255 heads, 63 sectors/track, 1946 cylinders, total 31266816 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb745c02d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              32    31266815    15633392    c  W95 FAT32 (LBA)

We see that the USB stick is attached at /dev/sdb in this case.

Then create a bootable installation stick:

$ sudo dd if=firmware-testing-amd64-netinst.iso of=/dev/sdb bs=4M
$ sudo sync
Posted in Uncategorized | Tagged , , | Leave a comment

Install Google Chrome on Debian Jessie

Download a DEB file for the version of Chrome you want from here.

Then

 $ sudo aptitude install gconf-service libgconf-2-4 libnspr4 libnss3 libpango1.0-0 libappindicator1 libcurl3
$ sudo dpkg -i google-chrome-stable_current_amd64.deb
Posted in Uncategorized | Tagged , | Leave a comment

Installing HipChat on Debian Jessie

I simply download HipChat from the official repository and follow the installation instruction there, but when I launch the application, I get the following error:

$ hipchat
libGL error: dlopen /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so failed (/usr/local/opt/HipChat/bin/..//lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.4.so.1))
libGL error: dlopen ${ORIGIN}/dri/radeonsi_dri.so failed (/usr/local/opt/HipChat/bin/..//lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.4.so.1))
libGL error: dlopen /usr/lib/dri/radeonsi_dri.so failed (/usr/lib/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: dlopen /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so failed (/usr/local/opt/HipChat/bin/..//lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.4.so.1))
libGL error: dlopen ${ORIGIN}/dri/swrast_dri.so failed (/usr/local/opt/HipChat/bin/..//lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.4.so.1))
libGL error: dlopen /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

The program gets stuck there until it is killed.

It is not elegant, but HipChat isn’t a very essential application for me, so I simply bandage this by replacing the libstdc++ that comes with HipChat with the one from Debian:

$ cd /opt/HipChat/lib
$ sudo mv libstdc++.so libstdc++.so.bk
$ sudo mv libstdc++.so.6 libstdc++.so.6.bk
$ sudo mv libstdc++.so.6.0.18 libstdc++.so.6.0.18.bk
$ sudo cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 .

Now HipChat should launch normally.

Posted in Uncategorized | Tagged , | Leave a comment

Installing Hadoop-LZO on Debian Jessie

JDK 1.6 or later is need to be already installed for this to work.

Install a few packages:

$ aptitude install liblzo2-dev maven git

To see where the LZO library is installed, get a list of files installed:

$ dpkg-query -L liblzo2-dev
... list of paths ...

In my box, the include and library paths are /usr/include/lzo and /usr/lib/x86_64-linux-gnu, respectively. (These paths should be recognized without doing anything, but if specifically pointing to them is necessary upon build with mvn later, try:

$ C_INCLUDE_PATH=/usr/include/lzo \
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu \
  mvn clean test

for example.)

Get the source from the Hadoop-LZO github repo:

$ git clone https://github.com/twitter/hadoop-lzo.git
$ cd hadoop-lzo
$ mvn clean test package

If the build is successful, the JAR should be found under target:

$ ls target/
...
hadoop-lzo-0.4.20-SNAPSHOT.jar
...

Typically, the JAR thus created should be installed in $HADOOP_HOME/share/hadoop/common/lib, and the following properties need to be added to configuration files under $HADOOP_HOME/etc/hadoop.

In core-site.xml:

<configuration>

  ... some other properties ...

  <property>
    <name>io.compression.codecs</name>
    <value>                                                                                                                                                                        
      org.apache.hadoop.io.compress.DefaultCodec,                                                                                                                                  
      org.apache.hadoop.io.compress.GzipCodec,                                                                                                                                     
      org.apache.hadoop.io.compress.BZip2Codec,                                                                                                                                    
      org.apache.hadoop.io.compress.DeflateCodec,                                                                                                                                  
      org.apache.hadoop.io.compress.SnappyCodec,                                                                                                                                   
      org.apache.hadoop.io.compress.Lz4Codec,                                                                                                                                      
      com.hadoop.compression.lzo.LzoCodec,                                                                                                                                         
      com.hadoop.compression.lzo.LzopCodec                                                                                                                                         
    </value>
  </property>

  <property>
    <name>io.compression.codec.lzo.class</name>
    <value>com.hadoop.compression.lzo.LzoCodec</value>
  </property>

</configuration>

In mapred-site.xml:

<configuration>

  ... some other properties ...

  <property>
    <name>mapred.map.output.compression.codec</name>
    <value>com.hadoop.compression.lzo.LzoCodec</value>
  </property>

</configuration>
Posted in Uncategorized | Tagged , , | Leave a comment

Installing Adobe Reader on Debian/Jessie

Once in a while you need to deal with fancier PDF files which may allow you to type in using forms, but Linux applications like Okular might not be fully capable of handling Adobe’s proprietary features. In such an unfortunate event, you might need to use Adobe Reader.

Go to the FTP download site on Adobe and download the version you wish to install. Here the version 9.x is assumed:

$ wget ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install libgtk2.0-0:i386 libxml2:i386 libstdc++6:i386
$ sudo dpkg -i AdbeRdr9*.deb

If the installation doesn’t fully complete, you might need to do

$ sudo apt-get -f install

to install the rest of missing packages.

Posted in Uncategorized | Tagged , , | Leave a comment

Using Tor on Debian Jessie

Install the package and start the service:

$ sudo apt-get install tor
$ sudo /etc/init.d/tor start

Check to see if Tor is running:

$ sudo netstat -plant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
...
tcp        0      0 127.0.0.1:9050          0.0.0.0:*               LISTEN      7766/tor
...

You should see an entry for Tor.

To simply use this, manually specify SOCKS proxy configuration with localhost:9050. Visit a site like showip.net to check what IP address the remote host is seeing; it should be the exit node of Tor and not the IP address of your host.

For a command-line program, use may use torsocks. For example, if you want to use ping with Tor, do:

$ torsocks ping somedomain.com
Posted in Uncategorized | Tagged , , , | Leave a comment

Using NTP Server to Synchronize Time on Debian Jessie

For just one time synchronization, it is easy:

$ sudo aptitude install ntpdate
$ sudo ntpdate us.pool.ntp.org

The server to use can be specified from the list given here.

Posted in Uncategorized | Tagged , , | Leave a comment

Installing MongoDB on Debian Jessie

On Debian, it is of course easy to install:

$ sudo aptitude install mongodb

My main use of local database servers is for testing, however, and I don’t want MongoDB to take up more than a few GB under /var/lib for journal files. I can instruct it to use smaller files by adding the following line to /etc/mongodb.conf:

smallfiles=true

Then stop the MongoDB service, remove the existing journal files, and restart:

$ sudo /etc/init.d/mongodb stop
$ sudo rm /var/lib/mongodb/journal/*
$ sudo /etc/init.d/mongodb start
Posted in Uncategorized | Leave a comment

Installing PyData Stack on Debian Jessie

Installing NumPy, SciPy, and Matplotlib has gotten so much easier with PIP, but there are some dependencies that are not taken care of automatically.

NumPy:

$ sudo pip install numpy

SciPy:

$ sudo aptitude install libblas-dev liblapack-dev gfortran
$ sudo pip install scipy

Matplotlib:

$ sudo aptitude install libfreetype6-dev
$ su
# pip install matplotlib

I had some issue with sudo when the installer could not find X. Running the command as root worked.

Posted in Uncategorized | Leave a comment

Installing PostgreSQL on Debian Jessie

$ sudo aptitude install postgresql postgresql-contrib
$ sudo su - postgres
postgres$ createuser -s yourusername

where yourusername is the username of your account. Note that with the -s switch the user will be created as a superuser. For assigning a more restricted role, see the official documentation.

Go back to your normal user account, and do

$ createdb
$ psql

Now you should be on the PostgreSQL shell.

Posted in Uncategorized | Tagged , | Leave a comment