Mini-Howtos
How do I make my MySQL server use TCP connections instead of Unix sockets?Comment out the option skip-networking in the file my.cnf which typically lies under /etc or /etc/mysql. Then restart your MySQL server: /etc/rc.d/init.d/mysql restart or /etc/init.d/mysql restart With netstat -ta you can check if MySQL is reachable via TCP. How do I restore a MySQL database from an sql dump?If your MySQL user has a password: mysql -h localhost -u [MySQL user, e.g. root] -p[database password] [name of the database] < [name of your sql dump, e.g. sqldump.sql] Please note: there's no space between -p and the password! If there's no password: mysql -h localhost -u [MySQL user, e.g. root] [name of the database] < [name of your sql dump, e.g. sqldump.sql] How do I make an sql dump of a MySQL database on the command line?If your MySQL user has a password: mysqldump -h localhost -u [MySQL user, e.g. root] -p[database password] -c --add-drop-table --add-locks --all
--quick --lock-tables [name of the database] > sqldump.sql Please note: there's no space between -p and the password! If there's no password: mysqldump -h localhost -u [MySQL user, e.g. root] -c --add-drop-table --add-locks --all --quick --lock-tables [name of the database] > sqldump.sql Resolving domain names with digTo resolve a domain name on the shell, you can use the command dig. Resolving the domain example.com: dig example.com If thedomain can be resolved, the result will be similar to this: ; DiG 9.2.1 howtoforge.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42946 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;example.com. IN A ;; ANSWER SECTION: example.com. 84600 IN A 192.168.0.1 ;; Query time: 27 msec ;; SERVER: 212.227.21.251#53(212.227.21.251) ;; WHEN: Wed Oct 26 18:53:32 2005 ;; MSG SIZE rcvd: 48 To check if the local webserver is responsible for this domain use the following command: How do I create SSL certificates with OpenSSL on the command line?You do it like this: openssl genrsa -des3 -passout pass:yourpassword -out /path/to/your/key_file 1024 openssl req -new -passin pass:yourpassword -passout pass:yourpassword -key /path/to/your/key_file -out /path/to/your/csr_file -days 365 openssl req -x509 -passin pass:yourpassword -passout pass:yourpassword -key /path/to/your/key_file -in /path/to/your/csr_file -out /path/to/your/crt_file -days 365 openssl rsa -passin pass:yourpassword -in /path/to/your/key_file -out /path/to/your/key_file2 chmod 400 /path/to/your/key_file2 How do I start the X server in Suse 9.2 when the graphic card is working work in text mode?To start the X server from a text mode session, execute the command: startx How do I find out if a remote system is still alive, if certain services are running, which processes are running, etc.?You can use ping to see if the system is alive: ping -c4 <system's IP address> To see if a certain service is still alive, use the telnet command: telnet <system's IP address> 25 (for SMTP) telnet <system's IP address> 80 (for HTTP) telnet <system's IP address> 110 (for POP3) You can login to the system using SSH (port 22) (use PuTTY if you are on a Windows PC; PuTTY is an SSH client for Windows), and when you are on the system, you have a few useful tools to gather more information: How do I scan my Linux system for rootkits, worms, trojans, etc.?Either with chkrootkit or with rkhunter. chkrootkitEither install the package that comes with your distribution (on Debian you would run apt-get install chkrootkit ), or download the sources from www.chkrootkit.org and install manually: wget --passive-ftp ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz Afterwards, you can move the chkrootkit directory somewhere else, e.g. /usr/local/chkrootkit: How can I get a list of quotas assigned to my users and groups and of the space used by them?repquota -avug shows a list for both users and groups. repquota -au shows a list for users, repquota -ag a list for groups. How can I set a limit as to how much space is available for a web site I put on my server? Like it is limited to 50 MB of space.First, you have to enable quota on your system. Have a look at the quota section of the appropriate "Perfect Setup" tutorial for your distribution on HowtoForge. After you've enabled quota on your system: To set quotas for a user or group, use the setquota command (see man setquota for more information), e.g.:
setquota -g $group $blocks $blocks 0 0 -a Replace $group, $username and $blocks. Note: $blocks is the quota size in MB * 1024! To deactivate quotas for a user or group, run these commands and set $blocks to 0. |


Recent comments
1 day 2 hours ago
1 day 7 hours ago
1 day 9 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 16 hours ago
1 day 17 hours ago
1 day 19 hours ago
2 days 8 hours ago
2 days 10 hours ago