ubuntu – Vincenzo's hacks http://vincenzo-ampolo.net hacks, researches, thoughts Thu, 12 Mar 2015 07:52:30 +0000 en-US hourly 1 https://wordpress.org/?v=4.7.3 56100434 How to install pymatlab http://vincenzo-ampolo.net/2012/06/24/how-to-install-pymatlab/ http://vincenzo-ampolo.net/2012/06/24/how-to-install-pymatlab/#comments Sun, 24 Jun 2012 08:43:27 +0000 http://goshawknest.wordpress.com/?p=177

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.

]]>
http://vincenzo-ampolo.net/2012/06/24/how-to-install-pymatlab/feed/ 4 177
Set up a full redundant btrfs storage under ubuntu linux http://vincenzo-ampolo.net/2012/04/05/set-up-a-full-redundant-btrfs-storage-under-ubuntu-linux/ http://vincenzo-ampolo.net/2012/04/05/set-up-a-full-redundant-btrfs-storage-under-ubuntu-linux/#comments Thu, 05 Apr 2012 18:21:25 +0000 http://goshawknest.wordpress.com/?p=246

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

With:


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

Happy storage!


 ]]>
http://vincenzo-ampolo.net/2012/04/05/set-up-a-full-redundant-btrfs-storage-under-ubuntu-linux/feed/ 1 246
How to easily set up tor in your ubuntu desktop http://vincenzo-ampolo.net/2012/04/03/how-to-easily-set-up-tor-in-your-ubuntu-desktop/ http://vincenzo-ampolo.net/2012/04/03/how-to-easily-set-up-tor-in-your-ubuntu-desktop/#comments Tue, 03 Apr 2012 12:57:24 +0000 http://goshawknest.wordpress.com/?p=239 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:


chromium-browser --proxy-server=socks://localhost:9050

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!

]]>
http://vincenzo-ampolo.net/2012/04/03/how-to-easily-set-up-tor-in-your-ubuntu-desktop/feed/ 5 239
Fan making too much noise on Ubuntu? Let’s fix it http://vincenzo-ampolo.net/2012/03/16/fan-making-too-much-noise-on-ubuntu-lets-fix-it/ http://vincenzo-ampolo.net/2012/03/16/fan-making-too-much-noise-on-ubuntu-lets-fix-it/#comments Fri, 16 Mar 2012 18:55:17 +0000 http://goshawknest.wordpress.com/?p=213 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.

]]>
http://vincenzo-ampolo.net/2012/03/16/fan-making-too-much-noise-on-ubuntu-lets-fix-it/feed/ 5 213
How to fix bash: ./utserver: No such file or directory on ubuntu 64 bit http://vincenzo-ampolo.net/2012/02/18/how-to-fix-bash-utserver-no-such-file-or-directory-on-ubuntu-64-bit/ http://vincenzo-ampolo.net/2012/02/18/how-to-fix-bash-utserver-no-such-file-or-directory-on-ubuntu-64-bit/#comments Sat, 18 Feb 2012 14:45:11 +0000 http://goshawknest.wordpress.com/?p=227 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.

]]>
http://vincenzo-ampolo.net/2012/02/18/how-to-fix-bash-utserver-no-such-file-or-directory-on-ubuntu-64-bit/feed/ 1 227
Play youtube videos without using browser directly from Unity on ubuntu 11.10 http://vincenzo-ampolo.net/2012/01/02/play-youtube-videos-without-using-browser-directly-from-unity-on-ubuntu-11-10/ http://vincenzo-ampolo.net/2012/01/02/play-youtube-videos-without-using-browser-directly-from-unity-on-ubuntu-11-10/#respond Mon, 02 Jan 2012 14:19:04 +0000 http://goshawknest.wordpress.com/?p=222 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

Happy watching!

]]>
http://vincenzo-ampolo.net/2012/01/02/play-youtube-videos-without-using-browser-directly-from-unity-on-ubuntu-11-10/feed/ 0 222
How to disable login sound on Ubuntu 11.10 Oneiric http://vincenzo-ampolo.net/2011/10/19/how-to-disable-login-sound-on-ubuntu-11-10-oneiric/ http://vincenzo-ampolo.net/2011/10/19/how-to-disable-login-sound-on-ubuntu-11-10-oneiric/#comments Wed, 19 Oct 2011 01:54:51 +0000 http://goshawknest.wordpress.com/?p=215 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.

]]>
http://vincenzo-ampolo.net/2011/10/19/how-to-disable-login-sound-on-ubuntu-11-10-oneiric/feed/ 11 215
Ubuntu 11.04 clipboard with unity support http://vincenzo-ampolo.net/2011/09/12/ubuntu-11-04-clipboard-with-unity-support/ http://vincenzo-ampolo.net/2011/09/12/ubuntu-11-04-clipboard-with-unity-support/#respond Mon, 12 Sep 2011 21:59:22 +0000 http://goshawknest.wordpress.com/?p=172 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.

]]>
http://vincenzo-ampolo.net/2011/09/12/ubuntu-11-04-clipboard-with-unity-support/feed/ 0 172
Error installing mysql-python package http://vincenzo-ampolo.net/2011/07/27/error-installing-mysql-python-package/ http://vincenzo-ampolo.net/2011/07/27/error-installing-mysql-python-package/#comments Wed, 27 Jul 2011 11:16:20 +0000 http://goshawknest.wordpress.com/?p=194 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.

]]>
http://vincenzo-ampolo.net/2011/07/27/error-installing-mysql-python-package/feed/ 2 194
How to install tor on ubuntu natty 11.04 http://vincenzo-ampolo.net/2011/05/08/how-to-install-tor-on-ubuntu-natty-11-04/ http://vincenzo-ampolo.net/2011/05/08/how-to-install-tor-on-ubuntu-natty-11-04/#comments Sun, 08 May 2011 15:34:33 +0000 http://goshawknest.wordpress.com/?p=161 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

into

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:

#ORPort 9001
#DirPort 9030

into

ORPort 9001
DirPort 9030

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 🙂

]]>
http://vincenzo-ampolo.net/2011/05/08/how-to-install-tor-on-ubuntu-natty-11-04/feed/ 33 161