Matteo Michelini

Wednesday, January 21, 2009

dnsutils overview

# host -t MX candpartners.com
candpartners.com mail is handled by 10 mail.register.it.

# host -a candpartners.com
Trying "candpartners.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3359
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 2

;; QUESTION SECTION:
;candpartners.com. IN ANY

;; ANSWER SECTION:
candpartners.com. 3600 IN NS zeus.csttech.it.
candpartners.com. 3600 IN MX 10 mail.register.it.

;; ADDITIONAL SECTION:
zeus.csttech.it. 3600 IN A 192.168.0.1
mail.register.it. 387 IN A 195.110.124.132

Received 172 bytes from 192.168.0.1#53 in 2 ms

DBA basic tasks

Importing a dump sql file
# mysql -uroot -proot
mysql> creat database new_db;
mysql> \q
# mysql new_db -uroot -proot < dumpfile.sql

Exporting a dump sql file
# mysqldump -h localhost -uDB_USER -pDB_PASSWD db_name > dump_db.sql

Exporting only sql schema
# mysqldump -d -h localhost -uDB_USER -pDB_PASSWD db_name > dump_db.sql

Setting grants
# mysql
mysql> create database new_db;
mysql> GRANT ALL ON new_db.* TO 'user'@'localhost' IDENTIFIED BY 'user_passwd';
mysql> \q

If you want to enable grants for a remote user (dynamic private IP: network 192.168.0.0/24) use

mysql> GRANT ALL ON new_db.* TO 'user'@'192.168.0.%' IDENTIFIED BY 'user_passwd;

Saturday, January 10, 2009

HOWTO select keyboard layout in Debian

# dpkg-reconfigure console-data


You can select even Mac layouts

If you don't wanna use the ncurses utility consider that all the keyboard layouts are stored under /usr/share/keymaps
For example if you wanna load the /usr/share/keymaps/i386/qwerty/it.kmap.gz

# loadkeys it

Use only the name without .kmap.gz

Friday, January 09, 2009

HOWTO use an external display

-- lspci output --
01:00.0 VGA compatible controller: ATI Technologies Inc Mobility Radeon HD 3650

--

# pacman -S xf86-video-radeonhd

-- xorg.conf --
...
Section "Module"
...
Load "dri"
...
EndSection
...
Section "Device"
Identifier "Card0"
Driver "radeonhd"
VendorName "All"
BoardName "All"
Option "AGPMode" "4"
Option "ColorTiling" "on"
Option "AccelMethod" "EXA"
Option "EnablePageFlip" "on"
Option "AGPFastWrite" "yes"
EndSection
...
Section "DRI"
Mode 0666
EndSection
--

# /etc/rc.d/gdm restart

Open a new Terminal in X

$ xrandr -q
Screen 0: minimum 320 x 200, current 1600 x 2000, maximum 2560 x 2560
VGA_1 connected 1600x1200+0+800 408mm x 306mm
...
...
PANEL connected 1280x800+0+0 331mm x 207mm
...
...
$ xrandr --output VGA_1 --mode 1600x1200 --below PANEL

Instead of --below you can use --right-of --above --left-of