2007年10月28日

Use MySQL Gui tools to securely connect to remote database

This particular example is going to be based on a connection from Windows XP using Putty, MySQL GUI tools and Dreamhost.

Quick summary of issue: I want to use MySQL Query Browser to access my database on my dreamhost account.  The database allows connections from the webserver only – nothing external.  I have an SSH account on the webserver.

Quick answer: This requires us to tunnel from our machine to the webserver and connect through this tunnel to the database server.

Lets take a look on how we can accomplish this:

Get Putty

Download Putty Here.   PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along with an xterm terminal emulator.

Configure a new SSH connection in Putty

We need to make a new connection in putty and configure it to do tunneling.

  1. 1.jpg Create a connection to your webserver with the SSH protocol and proper port.

    In this case, it’ll be our server ‘dreamhost.server.com’ on port 22 using SSH.

  2. 4.jpgFind the tunnels dialog.  Expand the connection item, expand the SSH item, and click on Tunnels.

    We’re going to make a tunnel from our local source port to our remote destination port at the server.  Choose a source port number that is not in use on your machine and put it in the source box.  Finally, put the mysql server name, colon, mysql port in the destination box.

    In my example, I am using source of 9999, ‘local’ destination (thats local to the ssh server) of mysql.dreamhost.server.com:3306 (3306 being the standard mysql port).

  3. Next, click ‘Open’ (You might want to save the session for future reference), and then log in using your credentials (In the future, you might want to set up a public/private key to remove the need for you to interact with the login – you might also want to set up a new SSH user with no permissions to run any commands to increase security.  They only need to connect!)
  4. 3.jpgOpen MySQL GUI Tool.  In this case, I’m going to use the query browser.

    Since we’ve got our connection open at port 9999 on our local machine, we need to change the server to ‘localhost’ and our port to 9999.  This will make the connection over the tunnel.

    Finally, enter your normal credentials and click ‘OK’

2007年10月27日

# sudo wget http://dl.google.com/linux/linux_signing_key.pub -O- | sudo apt-key add -
在/etc/apt/sources.list加入:
deb http://dl.google.com/linux/deb/ stable non-free
然后不用说了。

2007年10月23日

ubuntu 7.10

启动时fsck错误:
/etc/fstab把windows的分区的pass列(最后一列)改成0,就可以取消检测了

声卡:
sudo gedit /etc/modprobe.d/alsa-base
在最后加上下面两行
options snd-hda-intel model=3stack
options snd-hda-intel probe_mask=1

字体:
sudo mkdir /usr/share/fonts/truetype/ttf-microsoft-fonts
sudo mv *.ttf /usr/share/fonts/truetype/ttf-microsoft-fonts
sudo fc-cache -f -v
最后一句可能出错,用这句:sudo fc-cache -fv 2>&1 | grep failed | cut -f1 -d":" | xargs -i sudo touch {} && sudo fc-cache -fv

刷新率:
安装nvidia-settings,在这里面改。ubuntu自带的改不了。