Wednesday, December 12, 2007

browse over ssh issues

i copied this from

http://www.debuntu.org/port-forwarding-and-channel-3-open-failed-connect-failed-Connection-refused
need to think about this....


Ssh Port Forwarding and "channel 3: open failed: connect failed: Connection refused"

In relation to a tutorial I previously made on how-to connect to a remote mysql server by forwarding port with ssh, I found out that some distributions like debian sarge where not using a default configuration that allow you to do that by default.People who get an error like:

ERROR 2013 (HY000): Lost connection to MySQL server during query

or

channel 3: open failed: connect failed: Connection refused

might find an answer to their problem.

By default and for security reasons, Linux distribution don't let mysqld server accessible from the outside. There is actually 2 ways to achieve this:

  1. binding the service to address 127.0.0.1, this is the default on ubuntu
  2. skipping networking, in that case, only local (non TCP/IP) connections will be allowed, on Unix, connections will be made through a Unix socket. This is the default on debian sarge

In the first solution, you need to add in the [mysqld] section of /etc/mysql/my.cnf the directive:

bind-address = 127.0.0.1

the second solution use:

skip-networking

instead.

While you can connect on a localhost server which skip networking like you could with a server which only listen on 127.0.0.1 address using:

$mysql -u root -p -h localhost

you can not connect to it using an ssh tunnel with port forwarding.
as you will get an error like:

channel 3: open failed: connect failed: Connection refused

on the remote host
and:

ERROR 2013 (HY000): Lost connection to MySQL server during query

on the client host.

So in order to be able to connect to a remote mysql server which is only accessible from localhost, comment the directive:

skip-netwoking

and replace it with

bind-address = 127.0.0.1

This will not make your server less secure (as the service won't be accessible from the outside) and you will be able to access your database server remotely with tools like mysql-query-browser, mysql-administrator using a ssh tunnel.

Hope this helped.

***********************************************
previous thing was

In a previous article we saw how to connect to a remote mysql server running both ssh and mysql.

This time, we are going a bit further and will see howto connect to a remote server running ssh in order to be able to access a sql server on the remote LAN.

This system allow to hide the SQL server from the outside. Please, keep in mind that in this example, we are connecting to a MySQL server, but it could be any service running there.

Let's put it on the table. Imagine that we have got a web server which is put under high load, a clever way to soften the effect of the load and in the same way protect our SQL datas from the outside will be to have the HTTP server available to the outside (so it can serve the web pages), and hide our MySQL server from the outside.

This will look like this:

We saw last time, that in order to securely connect to a remote MySQL server running both mysql and ssh, we had to create a tunnel between our desktop and the server where we had to forward port 3307 on our desktop to port 3306 running locally on the remote server by giving the following intruction to ~/.ssh/config:

Localforward 3307 localhost:3306

This time, we want to forward port 3307 on our desktop to port 3306 on the MySQL server (let says it as 192.168.0.3 as IP adress). The only change we have to make to the previous configuration is to change the Localforward instruction by:

Localforward 3307 192.168.0.3:3306

And simply use the same mysqlcc configuration as the one given in the How To Connect to a remote mysql server using mysqlcc and ssh tunneling Tutorial. It is as simple as that :). Here is an overview of the final configuration we have deployed:

.

People which do not want to use ~/.ssh/config might use the following command:

tester@laptop:~$ssh -L 3307:192.168.0.3:3306 myuser@remotesshserver.com

Now, you can play around with port forwarding, later on, I will show you how to go even further and just do some useless be geeky thing.

cheerio


Tuesday, December 11, 2007

Panel disappears Sound stops?

1) Panel sometimes disappears from bottom of KDE. How to get it back?

* run-> panel

panel name is "kicker" significance? think about look into kasbar too

2) Sound stops. Who knows why?

* Run /etc/init.d/alsa-utils start
seems to work

who knows what goes wrong?

Thursday, November 22, 2007

Gtk2::GLext install

Ok, I wanted to have
gtkglext
gtkglextmm
Gtk2::GLext all installed.
let us get latest one of them all
first two use
./configure --prefix=/usr
to get to right debian locations
then for the last guy
need to edit Makefile.PL
to move line
mkdir 'build', 0777;
above the line for the pod that enables compilation
got 2 errors
unrecognized argument in LIBS ignored: '-Wl, --export-dynamic'
unrecognized argument in LIBS ignored: '-pthread'
then did make
make test
make install

Friday, November 16, 2007

mac os upgrade dual boot setup

Ok I have a dual boot mac g4. i wanted to upgrade to leopard
so i noted that the hard drive partition setup is
/dev/hda1 Apple_partition_map
/dev/hda2 bootstrap yaboot
/dev/hda3 swap
/dev/hda4 Linux / 15.6G
/dev/hda5 Mac OsX 11.8G


so then i booted into new leopard installer disk, wiped out old Tiger, reinstalled from scratch to mac partition
then i did
power on
hold down apple,option, o,f buttons (yes 4 buttons)
then at > prompt type
>boot hd:2,yaboot

here 2 is /dev/hda2 ie yaboot bootstrap partion
then type
>Linux
then

Login to linux system
run as root
fdisk -l
and look to what the macosx partition is

ON my system it changed from /dev/hda5 to /dev/hda6!!! with the new install, wasting a good 120M of space on the drive...

Then edit /etc/yaboot.conf to set
macosx=/dev/hda6 or whatever

then as root run
ybin
this will reinitialize the boot sector to boot to yaboot and
choose Linux as default or Leopard.

Then install OsiriX to MacOsX partition :)

ecb and semantic-cache files

i may want to get rid of ecb, but while it is on my system:

Emacs and semantic.cache

How can i prevent contaminating each directory with a file semantic-cache?
Set semanticdb-default-save-directory to a directory, by putting the following in your emacs init file (usually .emacs in your home directory):

(setq semanticdb-default-save-directory “~/.semantic”)
(replace ~/.semantic with a different directory, if you wish.)

From http://ecb.sourceforge.net/docs/FAQ.html

Saturday, November 3, 2007

browse over ssh

ssh -ND 8080 you@yourserver.com
sign in
then set up firefox to use socks host : localhost 8080
and you are done.

need to also set up

Set your proxy server to resolve DNS requests instead of your computer; in Firefox's about:config area, set network.proxy.socks_remote_dns = true.

then you cant be traced by your dns queries.....

Thursday, November 1, 2007

emacs commands

1. how to turn on syntax hylighting

M-X font-lock-mode

2. how to indent code?

C-M-\


3. how to comment out code in region? select region then
M-x comment-region
M-x uncomment-region

4. comment on line
M- ; (ie alt-; or esc then ;) creates a comment on the line
M-j then creates another comment line
remove comment on line ??



4. To move the cursor to a specific line:
M-x goto-line
when prompted in the minibuffer
Goto line: