This will explain how to connect to a remote mysql server only allowing connections from locahost, from your computer in a secure way as it is being done through a ssh tunnel.
What we are going to do here is to create a tunnel from your localhost to your remote host (the one the sql and ssh servers are running on).
If your sql server and ssh server runs on different machines, please read on and then refer to How To: ...
July 9th, 2010 | Posted in Linux system, MYSQL | 1 Comment
My friend wanted to know how to change or convert DHCP network configuration to static configuration. After initial installation, he wanted to change network settings. Further, his system is w/o GUI system aka X Windows. Here is quick way to accomplish the same:
Your main network configuration file is /etc/network/interfaces
Desired new sample settings:
Host IP address 192.168.1.100
Netmask: 255.255.255.0
Network ID: 192.168.1.0
Broadcast IP: 192.168.1.255
Gateway/Router IP: 192.168.1.254
DNS Server: 192.168.1.254
Open network configuration file:
sudo vi /etc/network/interfaces
OR
$ sudo nano /etc/network/interfaces
Find and remove dhcp entry:
iface eth0 inet ...
July 9th, 2010 | Posted in Knowledge, Linux system | No Comments
If you want to change you current IP using DHCP distribution by modem, DHCP server, You should put some ...Other IP different with ranges DHCP.
By command line below
Open interfaces eth0:
sudo gedit /etc/network/interfaces.
Add:
auto eth0 #thường là eth0 có thể là eth1, eth2
iface eth0 inet static
address 192.168.1.x #địa chỉ ip bạn chọn
netmask 255.255.255.0
gateway 192.168.1.1
Restart network:
sudo /etc/init.d/networking restart
Change DNS console:
sudo gedit /etc/resolv.conf
Add new DNS server
nameserver 208.67.222.222 # OpenDNS
nameserver2 208.67.220.220 # OpenDNS
July 9th, 2010 | Posted in Linux system | No Comments
Sometimes you run into situations where you need to change the IP addresses on a Linux server. If you are a “Windows” or “GUI” person, you might feel lost when you have to change the IP address of a Linux machine from the command line. But no worries, the actual process of changing the IP address is not that hard. Here is how it works:
Login to your server (preferrably via console or SSH) and switch to the root user
Now open ...
July 9th, 2010 | Posted in Linux system | No Comments
Setuid and setgid (short for set user ID upon execution and set group ID upon execution, respectively) are Unix access rights flags that allow users to run an executable with the permissions of the executable's owner or group. They are often used to allow users on a computer system to run programs with temporarily elevated privileges in order to perform a specific task. While the assumed user id or group id privileges provided are ...
July 5th, 2010 | Posted in Knowledge, Linux system | 1 Comment
If you want to migrate all MySQL databases from one server to another. This was a one time only operation, so setting up replication wasn't an option. And restoring a backup on the new server involved more downtime than strictly necessary. I figured the most ideal way would be to dump the active MySQL directly into the new MySQL instance. And that's what I did.
This often beats setting up replication if you want a quick & dirty solution.
Extremely fast because ...
July 3rd, 2010 | Posted in Knowledge, MYSQL, PHP script | No Comments
There are certainly times when all Web developers and “information architects” find themselves in a situation where they need to move content from one page to another. When you do so, you need to redirect visitors from the old location to the new location, and you need to do so properly. To do that, you need to make sure that the old location returns the correct status code (301 – Moved Permanently). There are a number of ways to do ...
July 3rd, 2010 | Posted in How to, Knowledge, PHP script | No Comments