How to easily set up tor in your ubuntu desktop

ubuntu

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!

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.

How to fix bash: ./utserver: No such file or directory on ubuntu 64 bit

ubuntu

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.

Play youtube videos without using browser directly from Unity on ubuntu 11.10

ubuntu

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!

How to set black background on geany and remove the green / white line

Programming

Geany is a very good editor to edit a big variety of source codes. Unfortunately it has a white background by default. I dunno if you have ever used a black background based editor such as vim but it makes your eyes less stressed when u are coding, and this thing is something that will increase your productivity. I tried to switch geany to use a black brackground and i found many extensions to do that… but i always have thought that it was impossible that geany codes didn’t think about this. After playing a bit with the settings i found a way.

Just go to Edit->Prerefencies then go to Editor and select the Display tab. U will see something like this:

 

Just select invert syntax highlight colors and you did it. If you want also to remove the odd green or white lines that appears after 72 characters you can just disable the long line marker and it will go 😉

Hope this helps

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 switch to different python version on apache mod_wsgi

sysadmin
By default the ubuntu-debian package of libapache-mod-wsgi contains the wsgi apache module compiled for either python 2.6 and python 2.7. This makes really easy to switch between python 2.6 or python 2.7 support in webapps. Indeed you have just to change a symbolic link to make your application working with python 2.7 interpreter if python 2.6 is enabled by default.
As you can see the libapacke2-mod-wsgi package countains both the 2.6 and 2.7 version of the the modules.
Se let's see how to accomplish this:
vincenzo@mba:/usr/lib/apache2/modules$ ls
httpd.exp             mod_authz_groupfile.so  mod_dir.so           mod_mem_cache.so       mod_ssl.so
mod_actions.so        mod_authz_host.so       mod_disk_cache.so    mod_mime_magic.so      mod_status.so
mod_alias.so          mod_authz_owner.so      mod_dumpio.so        mod_mime.so            mod_substitute.so
mod_asis.so           mod_authz_user.so       mod_env.so           mod_negotiation.so     mod_suexec.so
mod_auth_basic.so     mod_autoindex.so        mod_expires.so       mod_proxy_ajp.so       mod_unique_id.so
mod_auth_digest.so    mod_cache.so            mod_ext_filter.so    mod_proxy_balancer.so  mod_userdir.so
mod_authn_alias.so    mod_cern_meta.so        mod_file_cache.so    mod_proxy_connect.so   mod_usertrack.so
mod_authn_anon.so     mod_cgid.so             mod_filter.so        mod_proxy_ftp.so       mod_version.so
mod_authn_dbd.so      mod_cgi.so              mod_headers.so       mod_proxy_http.so      mod_vhost_alias.so
mod_authn_dbm.so      mod_charset_lite.so     mod_ident.so         mod_proxy_scgi.so      mod_wsgi.so
mod_authn_default.so  mod_dav_fs.so           mod_imagemap.so      mod_proxy.so           mod_wsgi.so-2.6
mod_authn_file.so     mod_dav_lock.so         mod_include.so       mod_reqtimeout.so      mod_wsgi.so-2.7
mod_authnz_ldap.so    mod_dav.so              mod_info.so          mod_rewrite.so
mod_authz_dbm.so      mod_dbd.so              mod_ldap.so          mod_setenvif.so
mod_authz_default.so  mod_deflate.so          mod_log_forensic.so  mod_speling.so
vincenzo@mba:/usr/lib/apache2/modules$ file mod_wsgi.so
mod_wsgi.so: symbolic link to `mod_wsgi.so-2.6'
vincenzo@mba:/usr/lib/apache2/modules$ sudo ln -fs mod_wsgi.so-2.7 mod_wsgi.so
Finished: we created mod_wsgi.so file which is a symbolic link to mod_wsgi.so-2.7. Now your reboot apache with sudo apache2ctl restart and you are using python 2.7 ;)

how to solve pymongo.errors.AutoReconnect: could not find master/primary

HowToProgramming

If you are coding and you have experienced an error like:

pymongo.errors.AutoReconnect: could not find master/primary

The problem is that your mongodb instance has not been shutdown correctly last time. To solve this just run the following command (it has been tested on a Ubuntu server):

sudo rm /var/lib/mongodb/mongod.lock && sudo /etc/init.d/mongodb restart

Hope this helps. I had to type that a lot of time during my coding time indeed.

Error installing mysql-python package

Codingubuntu

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.

%d bloggers like this: