Tag: ubuntu

How to install pymatlab

HowToubuntu

For a university project i had to deal with a web application written in python and some computations that are matlab based. Of course my webapp was in python so I had to find a library to interact with python. I’ve found pymatlab to be a good library for this goal.

Installing pymatlab was a bit tricky. I had to install matlab on Linux, then install the python-numpy package and then install pymatlab with this sets of commands


sudo -s

export LIBRARY_PATH=/usr/local/MATLAB/R2011a/bin/glnxa64/

export PATH=$PATH:/usr/local/MATLAB/R2011a/bin/
 export C_INCLUDE_PATH=/usr/local/MATLAB/R2011a/extern/include/
 apt-get install csh
 pip install pymatlab

Then I was able to run matlab inside my python programs.

How to put aptana launcher on the ubuntu dock

HowTo

Today after using vim for a while for my web development, I decided to give a try to Aptana. So I just downloaded it and… I liked it. I use the Super+N feature of Unity a lot, I think it’s a killer feature of this DE. Well. I wanted to put aptana in the dock too.

Doing so is prety easy. Just unpack the aptana package you just downloaded from aptana.com in whatever folder you like. I usually put this kind of custom apps in ~/Apps . now enter into the newly created aptana folder and create a file named aptana.desktop.

Put this content into that file:


[Desktop Entry]
Type=Application
StartupNotify=True
Name=Aptana
Comment=Aptana Studio 3
Icon=/home/goshawk/Apps/Aptana_Studio_3/icon.xpm <- replace this whit the ABSOLUTE path in which you unpacked aptana
Exec=/home/goshawk/Apps/Aptana_Studio_3/AptanaStudio3 <- the same applies here, replace with the ABSOLUTE path
Terminal=false
Categories=Development;IDE;

Give that file executable permissions. A chmod +x aptana.desktop should be fine. You can also right click on the file from nautilus, go to properties and then flag execute. The icon of the file will change and will be the aptana icon. Your launcher is now ready. Just drag and drop it to the dock and right click on it and select lock to launcher. Well done.

If you want it to be also accessible from the unity text launcher (the one that appears when you press the windows logo on your keyboard) just copy the aptana.desktop file to ~/local/share/applications. Your aptana will be also available from the text launcher now.

Fan making too much noise on Ubuntu? Let’s fix it

ubuntu

I’ve a Sony Vaio SB series, the one with double graphic cards. I just noticed that on Windows everything was smooth but on Linux the fan was running at maximum speed all the time and the laptop was very hot.

After some investigations I understood that this behavior was due to the second graphic card which was on meanwhile the integrated graphic card was working. After a bit of googling i found a nice explanation of my problem reading this page on the ubuntu help.

https://help.ubuntu.com/community/HybridGraphics

If you have the same problem just put this line:


echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

just before the exit 0 command. This will shutdown the second graphic card as soon as the computer boots, increasing battery life and decreasing fun speed, and thus, noise.

Ubuntu 11.04 clipboard with unity support

ubuntu

One thing I use frequently on my computer is a clipboard. With ubuntu 11.04 and Unity, the clipboard manager i used was not able to work like i want on Unity. So i browsed the net for a good clipboard replacement, and i found one.

It’s called Diodon and it’s an easy and effective clipboard with unity compatibility. Unfortunately it’s not in the ubuntu 11.04 default repo. To install it you have to add the diodon repository. You can do it just typing in a shell:


sudo add-apt-repository ppa:diodon-team/daily

Then install the diodon package. After reboot you will see a clipboard icon close to the clock.

How to change ecryptfs (home cripted filesystem) password on ubuntu and get your files back

ubuntu

locked hard disk

Have you ever tried to change your user password in a pc with crypted home folder. Well, after doing it you will be not able to access your files anymore cuz your login password now defers from the password to open the ecryptfs of your home directory. Don’t worry! You can easily fix it just doing:

ecryptfs-rewrap-passphrase /home/.ecryptfs/$USER/.ecryptfs/wrapped-passphrase

It will ask for your old password and for the new one. Then just logout and login again and your documents will be decrypted automatically.

So when you change your user password (eg with passwd) remember to run also the command above!

How to do nothing when lid is closed on Ubuntu

ubuntu

From Ubuntu 10.10 i noticed that in the power management window the “do nothing” opition when the lid is closed is not available anymore. Although it’s really useful when you connect your laptop to a external tv or screen, to close the lid and watch a movie in the darkness. Likely the shell comes in our help and there is a one line command to add the “do nothing” option and set it.

gconftool-2 --type string --set /apps/gnome-power-manager/buttons/lid_ac "nothing"

This will set a “do nothing” when the lid is closed AND you are connected to the power line.

How to recover crypted home directory in Ubuntu

HowToubuntu

UPDATE: this topic is also covered in a better way at Dustin Kirkland’s blog
Locked hard drive

From some versions ago, Ubuntu provides the facility of setting up the home folder of his users as cyphered directories. This method secure all the documents of the user from any kind of attacks (once the user is not logged in) but what happens if something goes wrong and… you cannot boot the machine anymore? Well, the pc doesn’t recognize its user, you, and you are unable to get your data if you boot from an external hard drive or cd or usb. If you try to boot using an extern device like those, you will find your home directory empty. So… How do we recover data in this case?

If you try to mount your /home partition and try to recover your data you get this error:


root@ubuntu:/home/goshawk# ecryptfs-mount-private
ERROR: Encrypted private directory is not setup properly

During my everyday use i have been in this kind of problems. Don’t ask me how and why, but i accidentally run a rm -fr /sbin so my system was unable to boot. To recover my cyphered data i did the following:

  1. Boot from cd or usb with a live version of Ubuntu
  2. Mount your home partition in /home
  3. Create an user with the same name as your broken system username (in my case goshawk) and run ecryptfs-mount-private like i did in the following console log.

root@ubuntu:/home/goshawk# adduser --no-create-home goshawk

Adding user `goshawk' ...
Adding new group `goshawk' (1000) ...
Adding new user `goshawk' (1000) with group `goshawk' ...
Not creating home directory `/home/goshawk'.
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for goshawk
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
root@ubuntu:/home/goshawk# su goshawk
keyctl_search: Required key not available
Perhaps try the interactive 'ecryptfs-mount-private'
goshawk@ubuntu:~$ ecryptfs-mount-private
Enter your login passphrase:
Inserted auth tok with sig [50a77c517a0463e0] into the user session keyring

INFO: Your private directory has been mounted.
INFO: To see this change in your current shell:
cd /home/goshawk

goshawk@ubuntu:~$ cd /home/goshawk/
goshawk@ubuntu:~$ ls
Amule				  Music
Aptana Studio Workspace		  n900
bin				  Piano.pdf
Desktop				  Pictures
DeusSito_2010_03_26.zip_[lZ4293]  plecno2
Documents			  Public
Downloads			  Random Exercises.pdf
GrayHatPython.epub		  RegDid0809-509-CLSINFMi.pdf
GrayHatPython.mobi		  specialistica poli
GrayHatPython.pdf		  Templates
Immagine 1.png			  TimeShift-20100327T003250.m2t
Jocart.png			  Videos
jupiter
goshawk@ubuntu:~$

Et Voilà. As you can see i was finally able to run an ls and see all my data correctly there. Mission Accomplished. 🙂

How to install Eclipse+Descent+Ldc D programming language compiler and configure auto completition

Dubuntu

Hi, i’ve just done a small video in how to being productive with the D programming language.

The video is actually on YouTube and shows, step by step, how to set up a perfect and complete IDE for the D programming language.

Hope you enjoy… See you!

ldc and libtango-gdc-dev packages for ubuntu/debian in ppa

Dubuntu

Hi, ldc and libtango-gdc-dev are in d language packagers ppa from some time ago now.

Here is the way you can install ldc 🙂 (the same applies for libtango-gdc-dev)

goshawk@earth:~$ sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xac6c83ad38a437abfc26a14af273e44ecde3fa2e
[sudo] password for goshawk:
Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 0xac6c83ad38a437abfc26a14af273e44ecde3fa2e
gpg: requesting key CDE3FA2E from hkp server keyserver.ubuntu.com
gpg: key CDE3FA2E: public key “Launchpad PPA for D Programming Language Applications Packagers” imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
goshawk@earth:~$ sudo nano /etc/apt/sources.list
goshawk@earth:~$ sudo apt-get update
Hit http://it.archive.ubuntu.com jaunty Release.gpg

[…]

Fetched 78.0kB in 1s (77.0kB/s)
Reading package lists… Done
goshawk@earth:~$ sudo apt-get install ldc
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libconfig++6
The following NEW packages will be installed:
ldc libconfig++6
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 7525kB of archives.
After this operation, 32.5MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://ppa.launchpad.net jaunty/main libconfig++6 1.3.1-1ubuntu1 [38.8kB]
Get:2 http://ppa.launchpad.net jaunty/main ldc 0.9.1~20090403.dfsg-0ubuntu2 [7486kB]
Fetched 7525kB in 7s (995kB/s)
Selecting previously deselected package libconfig++6.
(Reading database … 120004 files and directories currently installed.)
Unpacking libconfig++6 (from …/libconfig++6_1.3.1-1ubuntu1_amd64.deb) …
Selecting previously deselected package ldc.
Unpacking ldc (from …/ldc_0.9.1~20090403.dfsg-0ubuntu2_amd64.deb) …
Processing triggers for man-db …
Setting up libconfig++6 (1.3.1-1ubuntu1) …

Setting up ldc (0.9.1~20090403.dfsg-0ubuntu2) …
Processing triggers for libc6 …
ldconfig deferred processing now taking place
goshawk@earth:~$

Well, now you have ldc installed.

I just did a d program to fetch the lastest ldc trunk, package it, and put on ppa. I’m testing it in these days, and when my exams will finish (soon 🙂 ) daily packages will be available! 🙂

Bye.

Maemo/Mer on freerunner half ported

freerunner

freerunnermer1

As you can see from the image, Maemo/Mer is running on a freerunner. You can see the blue Mer background, a window to set up username (it’s first boot 🙂 ) and a keyboard that pops up when an editable field is touched. As you can see, the keyboard is not rendered correctly and it does not work but we didn’t touch any source of the GUI ATM and it’s very good that it worked without any modification.

Well, what’s supported until now? It runs a 2.6.28 linux kernel the same which is used in debian, so there is gps, gsm, wireless and bluetooth support but i’m not able to test them ATM until we will not solve the GUI issues. But the project looks ver promising from these early stages 😀 For now Mer is installed in a microsd and it boots thanks to qi. We (primary Carsten V. Munk) also devoped a imager script wich creates a rootfs. Ready rootfs will be available via mer website this website and eshopen when GUI will work too. In the meantime i’ll publish some snapshots of the working rootfs tree, so all the brave people can start playing with the rootfs 🙂

Eshopen, the company i work for, is sponsoring the porting giving a Freerunner to the developer team. In the next few months we will see a lot of changes in the GUI.

But why this project? Why porting Maemo/Mer on the freerunner?

Well, after that Openmoko CEO Sean Moss-Pultz in April 09 said that they will not develop the GTA03, the freerunner successor, due to budget problems, one thing was clear at eshopen: Openmoko will never delop a stable and full working operating system for freerunner. Om is the proof. Even being developed from 2007 it’s not stable enough to be used as an everyday phone. I also never felt confortable with the opkg package manager and i was missing the the wonderful apt-get which is available in debian based systems.

There are some alternatives to OM operating system, but most of them are based on OpenEmbedded (the same as OM) and others, like debian, seems to bring a full working desktop into a mobile phone. Android looks promising but it is not “open enough” (about it you can see the slides of my talk in Politecnico di Milano University for the Neomeeting), instead, the Openmoko community choose the Freerunner to have a 360° openness.

Maemo/Mer seems an answer to a full working and well supported operating system for any open mobile device. To understand more why Maemo/Mer is so open, more than any other operating system for mobile devices is this image:

As you can see it’s a full debian system with Hildon as GUI. It’s a key point cuz you have quite the same environment (if you use ubuntu) of your desktop pc in your mobile phone. You also have access to all the debian applications already packaged and ready to use. In this kind of environment developing an application will be very easy and you can share your applications via a debian repository.

But there is a field in which Maemo/Mer lacks and the Openmoko community developed a good solution: the phone stack. Maemo/Mer borns to be used into tablet pc like nokia n810, not phones, so it does not have any application to make calls. In the other hand the Openmoko community developed the fso framework (frameworkd and so on) which works thanks a standard, dbus, which is already in Maemo/Mer by default. The experimental applicazion to make calls via fso is called zhone and it’s already packaged for debian. As you can see it will be a good field in which Memo/Mer community and Openmoko community could join forces and help eachoter to develop the next generation free operating system for mobile devices.

What to do next?

  1. Make GUI work
  2. apt-get install fso-frameworkd zhone
  3. Test that all works
  4. Release stable image

Do you believe in this project and you want to help? Just contact me at vincenzo.ampolo[AT]gmail.com 🙂

  • 1
  • 2
%d bloggers like this: