sabato 2 agosto 2008

Steps to Enable Mouse Wheel Scrolling in Ubuntu Hardy under VMware Fusion

sudo gedit /etc/X11/xorg.conf


Section "InputDevice"
Identifier "Configured Mouse"
Driver "vmmouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Buttons" "5"
Option "ZAxisMapping" "4 5"
EndSection

domenica 22 giugno 2008

HDD or partition backup with dd

full hard disk copy

dd if=/dev/hdx of=/dev/hdy
dd if=/dev/hdx of=/path/to/image
dd if=/dev/hdx | gzip > /path/to/image.gz

Hdx could be hda, hdb etc. In the second example gzip is used to compress the image if it is really just a backup.

Restore Backup of hard disk copy

dd if=/path/to/image of=/dev/hdx
gzip -dc /path/to/image.gz | dd of=/dev/hdx


Getting around file size limitations using split

When making images, it's quite easy to run up against various file size limitations. One way to work around a given file size limitation is to use the split command.

# dd if=/dev/hda1 | gzip -c | split -b 2000m - /mnt/hdc1/backup.img.gz.
  1. This example is using dd to take an image of the first partition on the first harddrive.
  2. The results are passed through to gzip for compression
    • The -c option switch is used to output the result to stdout.
  3. The compressed image is then piped to the split tool
    • The -b 2000m switch tells split how big to make the individual files. You can use k and m to tell switch kilobytes and megabytes (this option uses bytes by default).
    • The - option tells split to read from stdin. Otherwise, split would interpret the /mnt/hdc1... as the file to be split.
    • The /mnt/hdc1... is the prefix for the created files. Split will create files named backup.img.gz.aa, backup.img.gz.ab, etc.

To restore the multi-file backup, do the following:

# cat /mnt/hdc1/backup.img.gz.* | gzip -dc | dd of=/dev/hda1
  1. Cat recombines contents of the compressed and split image files to stdout, in order.
  2. Results are piped through gzip for decompression.
  3. And are then written to the first partition of the hard drive with dd.


sabato 1 marzo 2008

Nuvexport + mythtv svn rev 16196

Lanciando Nuvexport mi si presentava questo errore:

This host not configured for myth.
(No RecordFilePrefix defined for kaos in the settings table.)

Ho risolto inserendo nella tabella settings il campo 'RecordFilePrefix' con questi valori:

INSERT INTO settings VALUES ('RecordFilePrefix', '/storage/mythtv/mythtv-video', 'kaos')


domenica 17 febbraio 2008

Debian "ntpdate": Tenere aggiornato l'orario di sistema

"ntpdate" è una comoda utility che ci permette di tenere aggiornato l'orologio di sistema. Per avere sempre l'ora esatta e' molto comodo utilizzare il protocollo ntp. L'utilizzo di "ntpdate" è molto semplice

# ntpdate it.pool.ntp.org

E' possibile reperire una lista di server NTP a questo indirizzo: http://www.pool.ntp.org/zone/europe

venerdì 15 febbraio 2008

Backup/restore MBR with Linux !

Il master boot record (MBR), nell'architettura dei PC IBM, è il settore di avvio che consiste nei primi 512 byte (mezzo kilobyte) dell'hard disk, che contiene la sequenza di comandi necessaria per l'avvio del sistema operativo. Il firmware di avvio contenuto nella ROM del BIOS carica ed esegue il master boot record. Il MBR di un disco di solito include la tabella delle partizioni, che è usata dal PC per caricare ed avviare il settore di avvio della partizione segnata come attiva. (fonte wikipedia)

Per effettuare il backup del master boot record dell'Harddisk basta utilizzare il comando "dd" :

# dd if=device of=mbr.bin bs=512 count=1

verrà creato un file mbr.bin contenente tutto il master boot record del disco.
Il device generalmente e' /dev/sda per HD sata, altrimenti /dev/hda per HD pata.

Per effettuare il restore:

# dd if=mbr.bin of=device bs=512 count=1

Verrà sovrascritto l'mbr con il contenuto del file mbr.bin

martedì 12 febbraio 2008

XMLTV

XMLTV è corredato da un set di utility che ci permettono di scaricare la guida tv da svariati siti web.
Se vogliamo prelevare la guida tv italiana dobbiamo utilizzare il tool "tv_grab_it":

$ tv_grab_it --days 5 --slow --cache --cache-slow --errors-in-xml > guidatvita.xml

Se vogliamo prelevare la guida tv italiana e di altri canali europei

$ tv_grab_it --days 5 --slow --cache --cache-slow --errors-in-xml --backend skylife,mtvit,wfactory,searchch,boingtv,sitcom1 > guidatv.xml

Per caricare le guida nel DB ("mythconverg") di Mythtv utizziamo il tool mythfilldatabase:

$ mythfilldatabase --file SOURCEID ita.xml

SOURCEID corrisponde al numero della sorgente video (quella impostata su mythtv-setup) da utilizzare.

domenica 10 febbraio 2008

Gestione runlevel e servizi su Debian

Ho trovato due programmini molto utili per la gestione dei servizi:
  1. sysv-rc-conf
  2. rcconf
Entrambi girano su un terminale, sono molto leggeri e non hanno bisogno delle librerie gtk o qt.
Un'alternativa alla gestione manuale dei servizi su linux.

giovedì 31 gennaio 2008

Configurazione di "sudo" su Fedora Core 8

Per configurare sudo su Fedora Core 8:

# echo 'loginname ALL=(ALL) ALL' >> /etc/sudoers

impostazione di sudo senza password:

# echo 'loginname ALL=(ALL)NOPASSWD:ALL' >> /etc/sudoers

domenica 13 gennaio 2008

Linux e le librerie dinamiche..

Compilando da sorgenti ho avuto spesso errori dovuti alla mancanza di librerie. Il problema è dovuto al fatto che spesso il software cerca le librerie necessarie in /usr/local/lib. Nella mia Debian Etch controllando il ld.so.conf ottengo:

miki@kaos:~$ cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf

nella dir /etc/ld.so.conf.d è presente il file i486-linux-gnu.conf

miki@kaos:/etc/ld.so.conf.d$ cat i486-linux-gnu.conf
# Multiarch support
/lib/i486-linux-gnu
/usr/lib/i486-linux-gnu

Manca il path del percorso /usr/local/lib !!

lo aggiungiamo con :
echo "/usr/local/lib" >> /etc/ld.so.conf.d/i486-linux-gnu.conf

e diamo il comando "sudo ldconfig" per caricare il nuovo path.

sabato 5 gennaio 2008

Debian: Scansione canali DVB-S

E' necessario il pacchetto dvb-utils. Per creare una lista di canali di Hotbird-13.0E basta utilizzare il prog "scan":

miki@kaos:~/dvbs$ scan -a 1 /usr/share/doc/dvb-utils/examples/scan/dvb-s/Hotbird-13.0E | tee channels.conf

l'opzione "-a 1" serve per selezionare la seconda scheda sat (la numerazione dei devices parte da 0).
il prog "tee" mi serve per visualizzare l'output nel terminale e scriverlo nel file channels.conf

Alcuni transponder da aggiungere a quelli presenti nel file Hotbird-13.0E

# EUTELSAT SkyPlex, Hotbird 13E
# freq pol sr fec
# 20061206
# RAI1, RAI2, RAI3, RaiMed, RaiEdu2, RaiUtile, Senato
S 11765840 V 27500000 2/3
# RaiSportSat, RaiNettunoSat2, Rai Edu1, RaiNotizie24, Camera Deputati, SAT2000, RaiNettunoSat1, Rai Doc-Futura, CCTV9
S 11804000 V 27500000 2/3
S 10992160 V 27500000 2/3
S 10719000 V 27500000 3/4
# rete4, canale5, italia 1
S 11919000 V 27500000 2/3
# Dfree, rete4, canale5, italia 1
S 11373000 H 27500000 2/3
# mediaset, canale 5, 24ore, comingsoon bbc world, Italy & Italy
S 11432000 V 27500000 2/3
# Sky Italia
S 11219000 H 27500000 3/4
S 11355000 V 27500000 3/4
# ODEON SAT, Made In Italy, MOTORI TV, Telenord, Trentino TV, ROMA SAT
S 11200000 V 27500000 5/6
# sardegna 1
S 11727000 V 27500000 3/4
# arcoiris, taxy, toscanal, etc
# TeleTirreno, 50 Canale, Forte Rosso Sat, Jolly sat, Toscana Channel, ARCOIRIS TV, TAXI channel, Piu' 1 Channels, TV7 LOMBARDIA, Venice Channel
S 11541000 V 22000000 5/6
# TVE Internacional
S 11785000 H 27500000 3/4
# Sportitalia
S 11862000 H 27500000 3/4
# SKY Meteo24, SKY TG 24
S 12713000 V 27500000 3/4
# VenetoSat, Telenova
S 10971000 H 27500000 3/4
# Retecapri, Calabria Channel
S 11013000 H 27500000 3/4
# EURONEWS, Al Jazeera english
S 11034000 V 27500000 3/4
# VIVA Polska
S 11075000 V 27500000 3/4
# Videolina, Roma Uno
S 11137000 H 27500000 3/4
# Denaro TV
S 11178000 H 27500000 3/4
# Bio TV, E'TV Emilia Romagna
S 11585000 V 27500000 3/4
# Napoli TLA, Tele A,
S 11604000 H 27500000 5/6
# ITALIA CHANNEL
S 11623000 V 27500000 3/4
# BBC World, Euronews
S 12597000 V 27500000 3/4
# Telelombardia
S 11240000 V 27500000 3/4
# Mediterraneo Sat 2, Radio Italia TV, LA 9, ...
S 11296000 H 27500000 3/4
# 24ore.tv, Coming Soon, BBC World
S 11334000 H 27500000 2/3
# Hit Italia,
S 11355000 V 27500000 3/4
# Prima TV, DV
S 11373000 H 27500000 2/3