Blog is moving

My blog is moving to http://victormendonca.com/blog/. If you are looking for a specific or older post you are in the right place Otherwise check out my new page for more up to date content.

Wednesday, June 20, 2007

How to Multiple Desktops on Windows (with VirtuaWin)

If you use Linux, one of the things you probably miss when using Windows is multiple desktops. At least that’s what I missed the most.

I was looking for some applications that would let me do the same on Windows, and I stumbled on a couple cool softwares.

The first one was from M$ itself, and is part of the Power Toys package. The group of software has some tools that are pretty neat. I will describe the ones I like on another post.

The Virtual Desktop however sucks, as usual. It let’s you choose different wall paper for the 4 different desktops (like KDE), and has a nice option of viewing all 4 desktops in a view window like this:



You can choose the virtual desktop you want by pressing on of the 4 buttons on your taskbar:



The application itself is very unstable and extremely slow. You can not move windows from one desktop to the other. And if you like to separate specific application per desktop and the desktop manager crashes (which happens A LOT), you are pretty much f#@!. You’ll have to re-start the desktop manager and re-open all your applications in the proper order.

After a quick research I stumbled on another program called VirtuaWin. It’s a bit complicated to use, but it’s stable, really fast and flexible.

It doesn’t provide you with button to choose a desktop, but it does: (correction, it does with the install of a module)
. allow you to set key combination to invoke specific desktop;
. move windows between desktops;
. list open windows on all desktops;
. move to next desktop by moving the mouse to any corner of the current desktop;
. move to next desktop by right clicking icon on taskbar;
. etc…

The program presents you with an icon on the taskbar that looks like this:



You can right click to get a menu or left click to get a list of open windows:





The setup window has a help menu that explains what each option is for. I found it very useful.



Anyway, I haven’t really “shopped” around for virtual desktop applications for Windows, but I was disgusted by M$ attempt and sold out to VirtuaWin.


Vic.

Monday, June 11, 2007

How to bypass a proxy server with SSH

These steps will guide you on how to bypass a proxy server that may be blocking you from accessing that interesting web-site at work, school or wherever.

Please note that I do not make myself responsible for the usage of this. Use it at your own risk of getting fired or expelled from school. Main thing, use it with responsibility.

The steps of bypassing a web proxy are actually simple. This how to will enable you to even bypass socks proxies that need username and password, as long as they allow encrypted traffic over port 443 and/or 80.

You are going to need:
- A SSH server at the remote side (Windows or *nix)
- A proxy server at the remote side (I’m using squid, which can be installed either on a *nix or Windows box) which can be the same as the SSH server
- Port forwarding on you remote router (if applicable)
- Address for the local (blocking) proxy server (can be easily discovered by opening a web browser, running “netstat -a” and looking for a established connection on port 8080)
- Putty

I’ll lay it out in steps to make it easier:

1- Install Squid on the remote PC
Download and install squid (either the Windows version or *nix). Make sure you know what port is open and change if necessary (default is 3128).

Test it from another computer in the LAN or using 127.0.0.1:3128.

2- Install SSH server on the remote PC. Configure the listening port and configure a user if required. Test it to confirm that it’s working.

3- Configure port forwarding on your remote router to forward port we will use at your work (443 or 80) to the port the SSH server is listening to.

4- Download
Putty.exe.
Now we need to configure it with all the required information for the connection.

4.1 Open putty and fill out the “Host name” with your remote IP (home) and the port you will be connecting to your router or directly to the PC with SSH installed (port 80, 443…)




4.2 On “Connection => Proxy” we need to enter the Proxy type, Proxy, Port, Username and Password. Remember that this information is for the proxy that we are trying to bypass
- Proxy type - Could be HTTP, SOCKS 4, SOCKS 5
- Proxy hostname - IP or hostname of the proxy
- Port - Port used to connect to the proxy (remember the netstat command)
- Username - Username that you usually input into IE when accessing the web
- Password - Password you usually input into IE when accessing the web



4.3 Open “Connection => SSH => Tunnels” and enter the following rules.



- Source port - Port you are going to use on your browser (I use 80)
- Destination:port - LAN IP address of the Squid server and port that is listening to. If you are using one server as SSH and another as Squid, this must be the IP of the Squid server. Now if you are using the Squid server and the SSH in one PC, you need to do a loopback into the port that squid is listening to. Eg: 127.0.0.1:80



5 Configure your web-browser to send requests to the source port we configured on the previous step. I have downloaded a different browser (Opera) that I use to bypass the proxy.



That’s it. You should now be able to access the blocked pages when putty is open and connected.

Process Explanation:
1- Browser sends a request to 127.0.0.1:80 (your PC)
2- Putty listens to the request and binds local port 80 to remote address 127.0.0.1 on port 80
3- Putty connects to the proxy and authenticates using username and password
4- Proxy connects to address and port we configured on step 4.1 (your remote address)
5- Your router accepts the request and forwards it to the port the SSH server is listening to
6- A putty terminal window opens and asks for username and password for SSH server
7- SSH server authenticates username and password and binds configuration from step 2
8- Squid sends requests to the Internet and replies back to tunnel


All this process is encrypted starting from step 2, so local proxy is not aware of any of the information sent over the tunnel.

There are also another 2 things that you might want to add for security and flexibility.

=> Security
- Use a USB pen to store an RSA key, which can be used for authentication with your SSH server. You can them configure your SSH server to only accept connections if the key is provided.

There are many how to’s on the Internet that show you how to do this.
This one is a good tutorial for RSA and putty.

- You can also CHROOT you SSH user.
This is a good tutorial for Ubuntu.

- If you decide to use CHROOT you can also limit WAN connections only for that limited CHROOT user. Take a look
here.

=> Flexibility
- As you are using a USB pen, your configurations will be saved to the registry, and not your pen. You will have to reconfigure putty every time you connect to a different computer.

A good idea would be to use a batch file that loads your configuration when you open putty, and deletes it when you close the connection, so no one has access to it. Check
this link.

Have fun setting this up…


Vic.

Sunday, June 10, 2007

Funny Phrases

I'm going to post here some of weird and funny stuff I've heard on the past few years working on a call center. If you think you are crazy, wait till you read this. These are sentences that came out of peoples mouth during group conversations...

- Amenizador de trauma da mucosa anal - Relief of trauma of the anal mucosa - Daniel
- Se a minha vó tivesse saco seria o meu avo - If my grandma had balls she'd be my grandpa - Daniel
- Uma mordidinha na bunda é gostoso - A little bite in the ass is good - Alkmim
- Eu posso ser feio, mas na cama eu sou foda - I may be ugly, but I'm the shit in bed - Alkmim
- I like facials!!!! (loud and enthusiastic) - Lucy
- Gostaria de ouvir a sua cadela ladrar - I would like to rear you dog bark - Veiga
- Procurei o seu nome, virei para o outro lado e nao encontrei - I looked for your name, turned around and could not find it - Lucy
- A coisa que eu estou a perguntar, é duas - The thing I'm asking is two

Portuguese only

- 2 P de patos e um T de tatu mudo - Maite
- Obrigado por segurar aí as pontas - Daniel
- Isso é uma sequência de momentos que têm de ser - Veiga
- A sua cadela é macho ou fêmea? - Veiga
- A linha está um bocado fraca
- As ligações do brasil são um bocado chatas - Danny P.
- Aguarde um segundo enquanto eu lhe arranjo um engenheiro de telefonia
- Eu nao sei se estou confusado ou nao
- Mas eu sou consideravelmente certo que escrevi...
- Só vou meter voce a guardar pontas
- Voce tem que instalaçar o software
- Se alguma coisa acontecer, é só telefonar pa dentro
- Faca maria faca - Kathleen
- Quando falas com uma pessoa, tens de falar com a pessoa
- Não se percebe.. é como 2 gregos a falar entre si
- Ele foi-se permufar
- Vamos estar em contato come você brevemente.Espero que vai estar tudo pronto hoje
- O senhor manda pa dentro
- Voce podiria abrir uma conta debaixo do seu nome
- Depois de voce abrir o cadrastro - Andre
- Quando as códias se tocam
- Já foi á nossa 3com website?
- Hub? É um hub? sabe o que é um hub? Eu vou-lhe dizer outra coisa completamente diferente
- O senhor mandou a fonte feituosa
- Falei com o nosso engenheiro de nota fiscal
- Acredita que não passou aqui uma hora sem pensar em você, e como nos podemos assistir você
- Como por nossa conversação, eu e-estou enviando-o esta e-mail.
- Se você poderia e-mail mim toda a informação pertinente.
- Codigo de fecho de correio = Codigo postal


I'll keep updating this as I hear more an more stuff...

Vic.

Friday, June 8, 2007

Organizing all your audio with Jinzora

If you are like me and like to keep all your music stored on you PC for easy access, you are going to love this.

I have all my music saved on my main PC (one of the 11). I’m kind of a neat freak when it comes to computers, so I keep it all organized by Genre => Artist => Album => Music.

A while ago I was looking for a server type where I could store all my songs and have easy access from the network. That’s when I stumbled on Jinzora’s name on the Ubuntu forum. It’s a great application that let’s you import all your music information to a database (My SQL) and easy access it from anywhere with a browser (LAN or WAN). Here’s is some screen shots and a link for a live demo:





Some of the features included are:
- Import music information by folder (like me) or by ID3;
- Use different players, even a built in flash player (XSPF);
- Download music;
- Download album art;
- Download lyrics;
- Create users and playlists by users;
- Play random cds, artists or songs;
- Others

I literally felt in love with the application. Requirements are not that high. Any old Pentium 3 PC is more than enough for an in-house streaming. I’m using a Pentium 3 (about 500MHz) and 384Kbps upload to my ISP. I was able to stream to 3 different users at the same time over the Internet with no problem.

You will need a LAMP OS, which can be achieved easily with Ubuntu. Just follow the steps here.

Now configure your web server using the configuration files. I’m not going to get into that here.

Once your server is up and running, web/php/mysql are installed, it’s time for us to create a user and database on MySQL. This can be done easily by using the following commands:

$ mysql -u root
mysql> create database [database];
mysql> GRANT ALL PRIVILEGES ON [database].* TO '[user]'@'localhost'
-> IDENTIFIED BY '[password]' WITH GRANT OPTION;


Copy all your media to a folder on the server. I actually bought a new HD and mounted it to fstab. I was stupid enough to buy an 80Gb HD, and I’m now getting close to being full. You can also mount a NFS or SMB share.

After that, download Jinzora to your server (See Jinzora.com for download link) web root folder (usually /var/www), extract the tar.gz file, change the folder permission/ownership (to web user) and execute Jinzora:

$ sudo tar -xzvf [file]
$ sudo chown -R www-data [jinzora folder]
$ sudo chmod 777 [jinzora folder]
$ sh configure.sh


You can now use a browser to access your install page, either from another PC or from the same (127.0.0.1/[Jinzora folder]). The installation is pretty straight forward from now on. It will give you information if something is wrong, which you can search on the web or on the Jinzora official forum for an answer.

One common error msg will be in regards to your PHP configuration. It will show something in regards to this:

max_execution_time:
memory_limit:
post_max_size:
file_uploads:
upload_max_filesize:


You can change these settings on “/etc/php5/apache2/php.ini”. Open:

$ sudo nano /etc/php5/apache2/php.ini


Press Ctrl+W to find value and change it to the value indicated on the web-based install page. Ctrl+x to save.

If you are not sure about the “Create Database” field on step 6, just simply use drop and recreate (if it’s a new database).

Don’t forget to delete the install file after you are done. Access the web page (computer address/Jinzora folder) in case you don’t know what the file is and Jinzora will remember you.

Installation is done. Now we can tweak a bit of the options from the main Jinzora page.

Go to the Jinzora page and logon using your admin password. Click on Admin Tools button (looks like a hammer and a screw driver), go to System Tools => Settings Manager => Main Settings => Playlist and add the value “xspf” to “embedded_player”.

Another important thing to add (in my opinion) is album art. Admin Tools => Meta Data => Retrieve Meta Data.

You can also add lyrics by going to Admin Tools => Meta Data => Retrieve Lyrics.

You should now be set. Open a port on your router/firewall or just listen from anywhere on your LAN.


Vic.

Thursday, June 7, 2007

known_hosts Clean Up

Have you ever got the following message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
5c:9b:16:56:a6:cd:11:10:3a:cd:1b:a2:91:cd:e5:1c.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:1
RSA host key for [host or IP] has changed and you have requested strict checking.
Host key verification failed.

This usually means that the host IP or name is not matching the entry recorded on known_hosts file. This would be as easy as deleting the entry on the known_hosts file and try to reconnect, but apparantelly on Ubuntu, those entries are encrypted.

This adds security, and if I'm not mistaken is also an option that can be configured on other distros.

If you open you know_hosts file (~/.ssh/known_hosts) you'll see that it looks something like this:

myserver1.com,64.2.5.111 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA11F
V0EnGahT2EK8qElocjuHTsu1jaCfxkyIgBTlxlrOIR

or

[1]AAAB3NzaC1yc2EAAAABIwAAAIEA11FV
0EnGahT2EK8qElocjuHTsu1jaCfxkyIgBTlxl

To get around this problem is very simple. All you have to do is issue the following command:

1- This will delete the entry for the host
$ ssh-keygen -R [hostname or IP]

2- This will display the entry
$ ssh-keygen -F [hostname or IP]

Hope that was enough info. Let me know if you have any question or any corrections

Vic.

Wednesday, June 6, 2007

Welcome!!!

Hi all,

Welcome to my blog!!!
I hope you will enjoy your visit and find the information I post here useful (or at least of some use)

A little bit about me in case you don't know me. My name is Victor. I'm a Brazilian who's been living in Canada (Toronto area) since late 2000. I'm a single dad, born in 1981.

I've been working in the IT area for the past year. I'm currently working as Tech Support for 3Com call center.

I'm also a Linux noob and fanboy. Started using Linux (Ubuntu) on November 2006 as I was studying for my Network+ certification, and I've not been able to stop since them. I just love the operating system.

I spent a lot of my time playing on my computers at home, about 11 of them (diagram). They include BSD, Ubuntu and a few that are left of Windows.

Anyways.... I hope you enjoy.


Vic.