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.
Hard disks are going to be cheaper and cheaper and we are going to need even more space. So why not build your own cheap storage? Thanks to linux 3.1 and 3.2 and its btrfs support is now very easy to setup a fully redundant, scalable, storage made of many hard drives. Set up a btrfs storage is really easy. I’m using btrfs because it performs really good in a lot of scenarios like oracle demonstrated. Do not rely on old benchmarks, Btrfs has been out from a while now, and early versions are not comparable with old ones. One of the best features of this filesystem is scalability: you can start with one disk and then attach new disks as soon you need them. You just attach and add to the btrfs volume the new hard disk. That’s it.
To create a fully redundant hard disk just do:
goshawk@pluto:~$ sudo apt-get install btrfs-tools goshawk@pluto:~$ sudo mkfs.btrfs -d raid1 /dev/sdb1 /dev/sdc1
goshawk@pluto:~$ sudo btrfs filesystem show Label: none uuid: 627e8d8a-8808-46fa-a237-875cd621f7f3 Total devices 2 FS bytes used 28.00KB devid 1 size 931.51GB used 2.03GB path /dev/sdb1 devid 2 size 931.51GB used 2.01GB path /dev/sdc1 Btrfs Btrfs v0.19
You can see the newly created filesystem. You will see also the UUID. That’s an important information since we can setup automount at startup thanks to that info.
Suppose that you want to attach the newly created storage to /storage and you want it to be mounted by default as soon as the computer starts. You just do add this line to /etc/fstab:
UUID=627e8d8a-8808-46fa-a237-875cd621f7f3 /storage btrfs defaults 0 0
In a previous article I’ve wrote in how to set up a tor server. In this tutorial I’ll show how to set up tor graphically to your desktop for anonymous surfing.
Note that tor is an almost perfect system to break censorship while surfing the net. Thanks to its architecture, using tor, a user is able to access blocked domains such as piratebay.org. Tor can also be used also to hide your identity on the web. But be aware of using websites that require logins, in that case your identity is not hiddend at all for them!
To install tor with a graphical user interface you have to install the vidalia package, you can install it from software center or typing in a terminal:
apt-get install vidalia
It will ask you a question about how to control tor from vidalia, ask permanent takeover such that vidalia will start and stop tor. Now start vidalia from a terminal or from the application icon in the application menu list in unity. Vidalia will start tor in background and you can open your browser and set 127.0.0.1:9050 as your SOCKS5 proxy server. You can do this in chrome from command line just typing:
Then you can surf torcheck or whatismyipaddress.com to check that you are not using your ip anymore. Torcheck may still say that you are not using tor (it will update after few minutes), if it’s so check that whatismyipaddress does not show your ip address (public one).
Happy free surfing!
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.
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.
If you are crashing your head in front of your monitor because a bittorrent program called utserver is giving back the following error:
goshawk@jupiter:/opt/utorrent-server-v3_0$ ./utserver -daemon utorrent.conf bash: ./utserver: No such file or directory goshawk@jupiter:/opt/utorrent-server-v3_0$
or it is just crashes silently, it’s because you are trying to run it without libssl 0.9.8 i386 version.
To fix it just do:
goshawk@jupiter:~$ sudo apt-get install libssl0.9.8:i386 goshawk@jupiter:~$ sudo aptitude unmarkauto libssl0.9.8:i386
The second command ensures that the package will not be removed from the system for no reason.
I just read on omgubuntu that is now possible to install an Unity Lens that makes you able to search in the youtube directory and play videos direcly using VLC if installed.
This is the original article: http://www.omgubuntu.co.uk/2012/01/unity-youtube-lens-updates-with-browser-free-video-playback/
Setting it up is very easy, just run the following commands:
sudo add-apt-repository ppa:atareao/lenses sudo apt-get update && sudo apt-get install lens-video scope-youtube
Often i turn on my pc during lessons or talks and the ubuntu login sound makes the whole process not discrete and make people notice i’m in that room. This is likely a side effect you wouldn’t like to happen, like me. So here is how i removed the ubuntu login sound on my ubuntu 11.10 Oneiric.
Open a terminal (open unity an look for terminal) and then paste this command:
gksudo gedit /usr/share/gnome/autostart/libcanberra-login-sound.desktop
Go at the bottom of the file and set NoDisplay=false. Save the file and then go to the power button in the top-right part of the screen, the one closer to your username. Then select Startup Applications… . You will find the ubuntu login sound in the menu. You can now select or deselect as you wish like in the following figure.
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.
If you are trying to do
pip install mysql-python
and you end up with an error which is the following (or similar):
(env)goshawk@earth:~/Projects/bvisible$ pip install mysql-python Downloading/unpacking mysql-python Running setup.py egg_info for package mysql-python sh: mysql_config: not found Traceback (most recent call last): File "<string>", line 14, in <module> File "/home/goshawk/Projects/bvisible/env/build/mysql-python/setup.py", line 15, in <module> metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found Complete output from command python setup.py egg_info: sh: mysql_config: not found Traceback (most recent call last): File "<string>", line 14, in <module> File "/home/goshawk/Projects/bvisible/env/build/mysql-python/setup.py", line 15, in <module> metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found ---------------------------------------- Command python setup.py egg_info failed with error code 1 Storing complete log in /home/goshawk/.pip/pip.log
The solution to the problem is to install the libmysqlclient-dev package in this way:
sudo apt-get install libmysqlclient-dev
You can now run pip install mysql-python without any further problem.
UPDATE: this post explains how to install tor on a server if you are using a desktop I suggest yout to follow the how to install tor on ubuntu desktop tutorial instead.
Installing tor, as any other service, on ubuntu is a matter of apt-get. Just type in a terminal:
sudo apt-get install tor
It will install tor and polipo so u are ready to go with tor. But to make everything work u still need to modify the configurations files a bit. For polipo just edit /etc/polipo/config and modify these two lines:
#socksParentProxy = “localhost:9050″
#socksProxyType = socks5
socksParentProxy = “localhost:9050″
socksProxyType = socks5
So it’s just uncommenting the two lines. Tor should be already working without any trouble, but it may be slow and u are not contributing to the Tor network. I highly suggest u to configure tor such that u can share your bandwidth with the network.
For changing this u have to modify /etc/tor/torrc and change these two lines:
It’s like in polipo u have to just uncomment them. That’s it! just configure your browser to use localhost:8123 as a proxy and visit torcheck. Congratz! u are using Tor now :)