Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Debian

Journal Journal: Debian netboot

A spare laptop with no working cdrom and seemingly unable to boot from usb... but with a realtek boot agent. So it's netboot time. Another option is using wuby and install ubuntu right on the ntfs partition along with windows, but then you're back to square one if something happens to the windows installation.

On a debian box used as server:
aptitude install tftpd-hpa dhcp3-server
if you have another dhcp server installed skip dhcp3-server but you have to find the proper config yourself.

edit /etc/default/tftpd-hpa

RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"

from your fave debian mirror in dists/etch/main/installer-i386/current/images/netboot/

downloaded netboot.tar.gz, expanded it in /var/lib/tftpboot

For /etc/dhcp3/dhcpd.conf let's assume the tftpd box is in 192.168.0.1, I have to specify "filename" and "next-server" options- all other options depend on your subnet:

subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.5 192.168.0.15;
        filename "pxelinux.0";
        next-server 192.168.0.1;
    option subnet-mask 255.255.255.0;
    option routers 192.168.0.1;
    option broadcast-address 192.168.0.255;
    option domain-name-servers [ put here DNS addresses, space separated];
}

Then restart the services to make changes effective /etc/init.d/tftpd-hpa restart /etc/init.d/dhcp3-server restart

Make sure machines on the subnet can freely access the net to download packages, else the installation won't be very straightforward.

On the box that needs the reinstall chose net boot (usually selectable in the bios and or among boot options menu).

If all goes well the debian boot installer prompt should appear. Only after installation is complete you can stop tftpd server.

BTW on the laptop HAL had to ignore the broken device: put this in /etc/hal/fdi/preprobe , as this blog entry says

<?xml version="1.0" encoding="UTF-8">
<deviceinfo version="0.2">
<device>
<match key="block.device" string="/dev/[DEVICE]">
<merge key="info.ignore" type="bool">true</merge>
</match>
</device>
</deviceinfo>

Debian

Journal Journal: Wireless setup with wpa supplicant - incomplete

I already had the setup for 802.11b with my home lan

Note this setup is quite sub-optimal as the password is saved in plaintext
The wext driver is for recent 2.6 kernels, works for my ndiswrapper

add to /etc/network/interfaces:

iface wlan0 inet dhcp
                wpa-driver wext
                wpa-ssid "ZyXEL XXXYYY"
                wpa-psk [password plaintext]
# wpa-bssid 00:1a:2b:3c:4d:5e -> not necessary but likely safer
                wpa-key-mgmt WPA-PSK
                wpa-pairwise TKIP CCMP
                wpa-group TKIP CCMP
                wpa-proto WPA RSN

Debian

Journal Journal: Quick and dirty subversion to git repository migration

while git-svnimport can be used for proper subversion repositories, I had issues with it and a personal svn repository which didn't follow the traditional svn layout with trunk branches tags (shame on me). Well why not simply iterate over the revisions and importing them? Seems to work. Here's how I did it:

first run
svn info [URL of the svn repository you want to migrate]
to discover how many revisions it has till now.

then let's get the commit messages so we can recycle them:

for i in `seq 1 [number of revisions]`; do svn log -r $i [URL of svn repository] > /tmp/svnlog$i.txt; done

then:
svn co --revision 1 [path to the svn repository you want to migrate]
so that a dir with a working copy is created, we'll call it [target git repository]. Now let's migrate all changes:


cd [target git repository]/
git-init
echo *.svn >> .git/info/exclude
for i in `seq 1 [number of revisions]`; do cd .. ; svn co --revision=$i [URL of source svn repository] ; cd $OLDPWD ; git add . ; git-commit -a -F /tmp/svnlog$i.txt; done

That should do it. Better do a
git-gc --prune --aggressive
(Do it when nobody else is accessing the new git repository!!!) so that you save space on disk, and a
git clean -d
to get rid of now useless .svn dirs.

User Journal

Journal Journal: stv680 cam and mplayer

The cam (an old trust spycam 300) worked under ekiga or gqcam without problems, once the proper stv680 kernel module is installed.

for mplayer one must use the v4l driver specifying outfmt width and height, like this example

mplayer tv:// -tv driver=v4l:device=/dev/video1:outfmt=bgr24:width=320:height=240

Well the pic is upside down, can use -flip option or dunno turn the webcam upside down :)

"webcam" package is quite useful as a poor man cctv. here's a sample config

[ftp]
host = localhost
user = nobody
pass = xxxxxx
dir = /tmp
file = webcam.jpg
tmp = imageup.jpg
local = 1

[grab]
device = /dev/video1
width = 320
height = 240
delay = 1
wait= 1
norm = pal
quality = 75
trigger = 0

For complex stuff zoneminder.com ought to be the choice.

Debian

Journal Journal: [ITA] Empire Pen Dual TV - su Debian Etch

Nota: lascio libero chiunque di copiare modificare e riutilizzare il seguente articolo, che rilascio nel pubblico dominio. E' probabile che sul sito del produttore (www.empiremedia.it) si trovino ulteriori informazioni.

La usb pen mi funziona subito come analogico, dopo un po' funziona anche la parte digitale. Presumo sia una questione di caricare il firmware piu' adatto (v. sotto) o di aspettare che il driver maturi.

Per avere a disposizione la usb pen sotto linux bisogna compilarsi i moduli relativi. Quello disponibile con il kernel di etch non la riconosce.

Ho seguito le istruzioni in inglese su
http://www.marcushellberg.com/pages/projects/digital-tv-in-linux.php

Se non lo si sa, scoprire con
    uname -r
quale versione del kernel si sta usando, nel mio caso
    2.6.18-4-686

Usare questa informazione per scaricare la versione giusta degli headers:
    aptitude install mercurial linux-headers-2.6.18-4-686 build-essential

Fare copia di sicurezza dei moduli attualmente installati, casomai qualcosa andasse storto

    tar zcvf modulesbackup.tgz -C /lib/modules/ 2.6.18-4-686/

Scaricarsi e installare i moduli aggiornati usando mercurial

    mkdir dvbdriver
    cd dvbdriver/
    hg clone http://mcentral.de/hg/~mrec/v4l-dvb-kernel
    cd v4l-dvb-kernel/v4l/
    make
    sudo make install

Scaricarsi il firmware dal sito http://konstantin.filtschew.de/v4l-firmware/ (non va aggiornato il firmware della penna, va solo scaricato, viene usato dal modulo), a me va anche la versione 4, teoricamente andrebbe la versione 3.

una volta scaricato, scompattarlo in /lib/firmware, es:

    tar xvzf firmware_v4.tgz -C /lib/firmware/

a questo punto riavviare il PC inserendo la usb pen: i messaggi, ottenibili anche col comando dmsg, dovrebbero annunciare che la penna e' riconosciuta ed i moduli relativi caricati, ad esempio:

(...)
em28xx v4l2 driver version 0.0.1 loaded
em28xx new video device (eb1a:e310): interface 0, class 255
em28xx: device is attached to a USB 2.0 bus
em28xx: you're using the experimental/unstable tree from mcentral.de
em28xx: there's also a stable tree available but which is limited to
em28xx: linux =2.6.19.2
em28xx: it's fine to use this driver but keep in mind that it will move
em28xx: to http://mcentral.de/hg/~mrec/v4l-dvb-kernel as soon as it's
em28xx: proved to be stable
em28xx #0: Alternate settings: 8
(...)
EEPROM ID= 0x9567eb1a
Vendor/Product ID= eb1a:e310
AC97 audio (5 sample rates)
500mA max power
Table at 0x04, strings=0x226a, 0x0000, 0x0000
tuner 0-0061: chip found @ 0xc2 (em28xx #0)
attach inform (default): detected I2C address c2 /root/dvbdriver/v4l-dvb-kernel/v4l/tuner-core.c: setting tuner callback
tuner 0x61: Configuration acknowledged /root/dvbdriver/v4l-dvb-kernel/v4l/tuner-core.c: setting tuner callback /root/dvbdriver/v4l-dvb-kernel/v4l/xc3028-tuner.c: attach request! /root/dvbdriver/v4l-dvb-kernel/v4l/tuner-core.c: xc3028 tuner successfully loaded
attach_inform: tvp5150 detected.
cs: IO port probe 0x100-0x3af: clean.
cs: IO port probe 0x3e0-0x4ff: clean.
cs: IO port probe 0x820-0x8ff: clean.
cs: IO port probe 0xc00-0xcf7: clean.
cs: IO port probe 0xa00-0xaff: clean.
tvp5150 0-005c: tvp5150am1 detected.
Loading base firmware: xc3028_init0.i2c.fw
Loading default analogue TV settings: xc3028_BG_PAL_A2_A.i2c.fw
xc3028-tuner.c: firmware 2.7
ANALOG TV REQUEST
em28xx #0: V4L2 VBI device registered as /dev/vbi0
em28xx #0: V4L2 device registered as /dev/video0
em28xx #0: Found MSI DigiVox A/D
em28xx audio device (eb1a:e310): interface 1, class 1
em28xx audio device (eb1a:e310): interface 2, class 1
usbcore: registered new driver em28xx
usbcore: registered new driver snd-usb-audio
em2880-dvb.c: DVB Init
Loading base firmware: xc3028_8MHz_init0.i2c.fw
Loading default dtv settings: xc3028_DTV8_2633.i2c.fw
xc3028-tuner.c: firmware 2.7
Sending extra call for Digital TV! /root/dvbdriver/v4l-dvb-kernel/v4l/xc3028-tuner.c: attach request!
DVB: registering new adapter (em2880 DVB-T)
DVB: registering frontend 0 (Zarlink ZL10353 DVB-T)...
Em28xx: Initialized (Em2880 DVB Extension) extension
(...)

Per vedere se c'e' l'audio della TV:

arecord -l

  (...)
  card 1: Device [USB 2881 Device], device 0: USB Audio [USB Audio]
      Subdevices: 1/1
      Subdevice #0: subdevice #0

Si può regolare il volume con:

  alsamixer -c 1

premendo tab per scegliere l' input screen

A questo punto la scheda e' pronta, usando ad esempio mplayer, dopo aver verificato che mplayer funzioni con un file video (scelta del -vo adatto, verifica dei permessi per sentire l'audio ecc), per vedere la tv si usa

mplayer -vo xv tv:// -tv chanlist=italy:driver=v4l2:input=0:norm=2:device=/dev/video0:alsa=yes:audiorate=48000:amode=0:forceaudio=yes:adevice=hw.1,0:volume=80:immediatemode=0

(attenzione, inserire tutto su una riga e da chanlist= in poi senza spazi, in caso di dubbi vedersi l'help di mplayer- c'e' anche in italiano)

e usare h e k per provare tutti i canali fino a trovare qualche emittente.

Dopo qualche minuto di ricezione segnale analogico che a quanto pare sblocca la situazione, si puo' provare con il digitale. Consiglio di installare kaffeine, che ha una funzione di scansione canali. L'antennina in dotazione non ha fatto molto per me, collegando all'impianto antenna di casa (n.b. mai adattato al digitale terrestre) invece spuntano i canali, se la zona è servita.

Kaffeine permette di fare pausa del segnale video, registrarlo in mpeg2 (serve spazio su disco), e a quanto mi pare registrare un canale e vederne un'altro purche' appartenga allo stesso "stream".

Una stranezza, appena avviato kaffeine il segnale e' piu' debole, cambiando canale un po' la ricezione migliora. Ritengo sia qualche problema con i comandi dati al sintonizzatore.

Per la tv analogica riesco con mplayer a registrare in divx a 2000kbit e qualche filtro per incrementare la qualita' con un celeron a 1.7 giga. Registrando in mpeg2 o salvando direttamente lo stream (mai provato) si ha minor consumo di cpu e lievemente maggior qualità a scapito della dimensione del file.

Debian

Journal Journal: Processing.org installation on debian etch x86

first i checked that update alternatives (same as the checks performed with ibm-sdk for ppc installation script in the java journal entry) point to sun-java5-* related stuff.

then i downloaded and untarred processing.tgz

then i "aptitude installed" libstdc++5 and jikes (but the default jikes is supplied with processing.org, check it works with ./jikes -v in its directory)

then started the environment with ./processing

User Journal

Journal Journal: Vsftpd

Occasionally I need ftp to transfer big files without the hassle.

I chose vsftp because it seems easy to configure

in /etc/vsftp.conf i made sure the listen and listen_ipv6 are NO so it doesn't get started at boot, and made a copy of vsftp.conf and changed/added these options

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
listen_port=(non standard port)
userlist_enable=YES
userlist_deny=NO

created a couple users for ftp only gotta prevent login

Databases

Journal Journal: remote ssh tunnel to postgresql

ssh access to the remote postgresql machine required, of course.

let's assume the db is already configured to accept local connections like this:

host [dbname] [dbuser] 127.0.0.1 255.255.255.255 trust

and let's assume i have the same user (and uid) on a machine that needs to access the db

I need to know the port postgres listens to, netstat knows, 5432 in the example

First step is making an ssh tunnel
(i assume firewall allows the client to communicate, else one has to do a reverse port forwarding with different config)

ssh -f -v [dbuser]@[IP of db machine] -L [free port number]:127.0.0.1:5432 sleep 30

so now ssh forwards the client local free port number to the db machine, 30 secs to initiate it, for example with psql. One must be the db user!

su - [dbuser]
psql -h localhost -p [free port number] [dbname]

User Journal

Journal Journal: Lighttpd and SSL

# lighttpd.conf entry to transparently add ssl
$SERVER["socket"] == "[server-ip]:443" {
  ssl.pemfile = "[full path to .pem]"
  ssl.ca-file = "[full path to CA .pem]"
  ssl.engine = "enable"
}
Debian

Journal Journal: Install .ttf fonts

  # cd /usr/local/share/fonts
  # mkdir truetype
  # chmod go+rx truetype
  # cd truetype
  # (mv .ttf on this directory, chmod o+r them, they can have .TTF or .ttf extension)
  # mkfontscale (or ttmkfdir -o fonts.scale ?????)
  # mkfontdir
  # defoma-reconfigure

to update, it should be enough to clear all non ttf files, add/remove fonts and redo mkfontscale and mkfontdir

Use
# fondu (path to fonts, found on mac partition to hold the resource file)

to convert mac fonts to ttf in working directory
Debian

Journal Journal: quick dvd authoring

the mpeg must be in format suitable for dvd, see mencoder docs for example.

dvdauthor -o dvd/ -t movie.mpg (separately for each track) then use -T for TOC

<?xml version="1.0"?>

<dvdauthor dest="dvd/">
                <vmgm>
                                <menus>
                                                <video />
                                                <audio />
                                                <subpicture lang="it" />
                                </menus>
                </vmgm>
  <titleset>
    <titles>
      <pgc pause="0">
        <vob file="file.mpeg"
chapters="0,1:52,5:59,11:10,16:36" />
      </pgc>
    </titles>
  </titleset>
</dvdauthor>

if the directory containing the files is "dvd"
dvdauthor -o dvd -x example.xml

mkisofs -dvd-video -o dvd.iso dvd

growisofs -Z /dev/hdc=dvd.iso

(Trying to master the .iso with nero on windows involves renaming to .nrg and using a 2048 byte block - the default)

Another reported command:
dvdauthor...
(then in the directory with dvd folders)
growisofs -dvd-video -dvd-compat -Z /dev/dvd -V "DVD Title" ./

variation
<?xml version="1.0"?>
<dvdauthor dest="DVD/">
        <vmgm>
                <menus>
                        <video />
                        <audio />
                        <subpicture lang="en" />
                </menus>
        </vmgm>
        <titleset>
                <titles>
                        <pgc pause="0">
                                <vob file="joined.mpg" chapters="0,0:20" pause="0" />
                        </pgc>
                </titles>
        </titleset>
</dvdauthor>
Debian

Journal Journal: import dvd to kino

ffmpeg -i [input mpeg file] -target dv output.dv

note i had also to manually install liba52 and
ln -s /usr/lib/liba52-0.7.4.so /usr/lib/liba52.so.0

ffmpeg should work for fv pipe export too

Debian

Journal Journal: mldonkey

Firewall setup: this ports must be open. Else you get the "firewalled" status.

TCP ports to open 6881 6882 6883 6884 6885 6886 6887 6888 4662 6347 4444 2234
UDP ports to open 4666 6347 4444

Note that it might be sufficient to open TCP port 6882 and not all 6881-89.

#aptitude install mldonkey-server

then, as the user who will run mldonkey
$mlnet

creates a .mldonkey folder with configuration in that user's home dir

now we can know which port to open for overnet. always as user

$ less ~/.mldonkey/donkey.ini

                (* port for overnet *)
      port = 15097

which is to be added as open tcp and udp port

Connecting with a browser to localhost:4080 will give you mlnet interface. There is also telnet. See docs.

Debian

Journal Journal: mysql5

postgres rules, but ok :)

# aptitude install mysql-server-5.0
# mysql
> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.01 sec)
> use test
Database changed
> grant all privileges on test to someuser@'%' ;
Query OK, 0 rows affected (0.00 sec)
> CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), age INT);
> insert into pet values ('cat','john',2);
...

testing OO
#aptitude install unixodbc libmyodbc
(let debconf setup myodbc driver)

as the db user create a file template:
[MySQL-test]
Description     = MySQL test database
Trace       = Off
TraceFile   = stderr
Driver      = MySQL
SERVER      = localhost
USER        = someuser
PASSWORD    =
PORT        = 3306
DATABASE    = test

and register it:
odbcinst -i -s -f [template filename]

oobase: connect to odbc, database name MYSQL-test, no user, no passwd
connect to mysql odbc (todo)

Slashdot Top Deals

Stellar rays prove fibbing never pays. Embezzlement is another matter.

Working...