Archive for the ‘Linux’ tag
PixieLive
A friend of mine, Christian, has released PixieLive, a slax based live linux distro build with gentoo.
It’s one of the few live distributions that support Intel GMA500, popular on netbooks like some Asus EEEPC.
Audio transcoding in bash
A proper transcode must have a lossless audio format as a source, a good one is flac ,stands for Free Lossless Audio Codec, because it does the job well and has a good licence ( BSD and GPL ).
If you have some flacs and want them in mp3 format (you need lame and flac) you can use this one liner:
for FILE in *.flac; do flac -cd "${FILE}" | lame - "${FILE/.flac/.mp3}"; done
the above line decodes every file that ends in .flac to the standard output (screen) and pipes it to lame that will encode it. “${FILE/.flac/.mp3}” will be the output file, in bash that means: take the variables “$FILE” (that is the original filename), remove “.flac” and substitute “.mp3″.
Nowadays I transcode quite often to 320 kbit/s constant bit rate (CBR)
- achieving the best quality for an mp3 and still being highly portable, some players don’t like variable bitrate of high quality ( like the V0 preset)
- doing something unefficient since mp3 is not a good codec for that quality but if your stereo reads just mp3 you don’t have any choices
I simply need to use lame with the proper switches , the above one liner becomes:
for FILE in *.flac; do flac -cd "${FILE}" | lame --cbr --preset insane - "${FILE/.flac/.mp3}"; done
To rip my compact discs and encode my music in flac I use a program for windows called Exact Audio Copy (EAC), my Wine build doesn’t like it for some reasons and Virtualbox has historical problems in handling cdroms correctly, the solution was VMWare. The native solution is RubyRipper
Fail2ban and postfix sasl
Today I found the usual chinese trying to get in my smtp to send his spam to the world and I realized that fail2ban wasn’t working because the regexp used to match the offender is wrong.
This is the log entry (/var/log/mail)
Aug 21 22:45:30 myserver postfix/smtpd[12071]: warning: unknown[xxx.xxx.xxx.xxx]: SASL LOGIN authentication failed: authentication failure
and this is the regex that work , just remove the part after “authentication failed” (/etc/fail2ban/filter.d/sasl.conf)
failregex = (?i): warning: [-._\w]+\[
Test it:
fail2ban-regex /var/log/mail.log /etc/fail2ban/filter.d/sasl.conf
if you are on a slow server or on a big mail server use /var/log/mail.err instead
Unmerge Kde in gentoo
Update
emerge --ask -C `eix -C kde-base --only-names --installed`
nano /etc/make.conf
and delete kde from the USE flags, remove qt3support and qt4 also if you don’t need them anymore
emerge -uavtqND world"
Now you should have just a few kde packages in the list you got as an output of that command, it’s your choice to leave them or unmerge them manually, with unmerge -pv –depclean
Indirizzo ip dinamico e dyndns opendns
Ogni qualvolta ci si collega ad internet viene assegnato un indirizzo ip pubblico al proprio computer/router, in Italia quasi tutte le connessioni adsl private hanno un ip dinamico che camba tutte le volte che ci si riconnette. Può tornare comodo conoscere questo ip per poter raggiungere il proprio computer dall’esterno ( lavoro, università ) e per evitare di doverselo scrivere su un “post it” tutte le volte che si accende il modem è possibile utilizzare un dns dinamico .
Razionale
- iscriversi ad un servizio di dns dinamico, si potrà scegliere un dominio di terzo livello ( terzolivello.secondolivello.it) a cui associare l’indirizzo ip del computer.
- iscriversi a dnsomatic che provvederà a fornire a tutti i servizi che si usano (come i servizi di dns dinamico ma anche altri come opendns) l’indirizzo ip del computer
- usare un client che al cambio dell’indirizzo ip avvisa dnsomatic
Ubuntu on Toshiba A300 PSAJ4E
Info
00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile PM965/GM965/GL960 PCI Express Root Port (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)
00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03)
00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03)
01:00.0 VGA compatible controller: ATI Technologies Inc Mobilitiy Radeon HD 3400 Series
01:00.1 Audio device: ATI Technologies Inc RV620 Audio device [Radeon HD 34xx Series]
02:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)
03:00.0 Ethernet controller: Marvell Technology Group Ltd. Unknown device 4355 (rev 12)
0a:01.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02)
0a:01.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02)
0a:01.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01)
Superkaramba and Gentoo
Nowadays it seems that superkaramba works well, in the past it was heavy and buggy and I used to have conky. There are no particular reasons that made me switch to superkaramba , other than moving from Gnome to Kde.
My superkaramba monitor is based on the dual cpu monitor by Loacoon, I changed it a little to show some useful stuff , some of them gentoo specific ( last sync, last emerges, currently emerging….. genlop is a dependency).
Laptop ubuntu suspend and nvidia virtual tty
I decided to keep ubuntu even if I don’t like this new release ( hardy ) at all. When it came out it used to hang for no reason , the new kernels seem to have solved the issue.
I had two big problems, I couldn’t hibernate/suspend and I couldn’t switch to the ttys with Alt+F1 for example.
Starting from the latter I realized that the nvidia-glx package instead of the nvidia-glx-new does the job. Since I don’t know the difference between the two packages and I really don’t care to have the newest nvidia driver I consider this problem fixed.
Now suspend works and not sometimes or just one time like it used in the past, I had to change some config options in /etc/default/acpi-support
SAVE_VBE_STATE=false
POST_VIDEO=false
SAVE_VIDEO_PCI_STATE=true
Hiberating is still a problem or better waking up from hibernation is a huge deal on my laptop. It does hibernate and it tries to wake up during next boot but when X starts everything freeze. It seems a kernel or xorg problem because I can’t turn on/off the capslock led. Here’s the bug I’ve filled, hopefully someoene will look at it.
Installazione Windows Xp1 e Linux
Ho comperato un nuovo harddisk e ho deciso, dopo averne fatto a meno per un anno, di installare windows xp….magari una mezz’oretta con Cod4 ci sta.
Inizio col dire che è stata più lunga del previsto.
Ho una vecchia copia di windows xp sp1 che non ha al suo interno i driver per il controller sata della mia scheda madre (ICH9) e allora ho dovuto scaricarmeli dal sito della Asus. Dopo averlo fatto mi sono ricordato di quel famoso pulsante F6 da premere in fase di installazione di windows per poter caricare driver di terze parti, subito dopo un flash: “Ma serve il floppy??????”. Già …..
E dove lo prendo un dischetto? Ho varie chiavette, da 128 MB a 8GB, ma di dischetti pochi o nulla…ma uno si,che non va. “Ravana ravana” ho trovato in un angolo di una libreria una vecchia confezione di Verbatim con scritto “Gia Formattati!!” Wow
Copiati i driver sul dischetto e riavviato facendo il boot da cd di windows mi trovo schermata nera, solo una piccola scritta “Rilevazione Hardware” in corso e poi nero completo e cd fermo che non legge.Sia il cd? Cambiati 3 cd e stesso problema.
Ho poi scoperto che se l’installer di Microsoft trova sugli harddisk più di una partizione con la flag “bootable” esce senza avvisare lasciandoti li come un pirla con la schermata nera. Ho risolto scollegando gli altri due harddisk in raid (quando ho fatto il raid forse ho creato anche il danno), un altra soluzione con “parted” era di togliere le flag bootable o lasciarne al massimo una.
In compenso però ora mi ha avvisato che cambierà la risoluzione dello schermo….ma vedi di andare a ….
Nokia N95 and UPNP
Finally i got it….at first it was a mess, some explanations on what does what:
- Media Server: it serves the content on the network
- Media Renderer: it renders the content served by a media server
So I actually needed both on my gentoo linux.
Probably the easiest way to browse content served by upnp servers is djmount , it works as a FUSE file system ( that can be mounted by a normal user) and it looks for all the upnp devices in a network. It works very well even with content provided by Windows Vista (or better from the Media Player that comes with windows vista). You create a directory and simply “djmount it”, in that directory there will be other subdirectories , one for each media server you have in your network.
Easy and working but not that cool, I mean…all this new stuff and , in the end, I still have to browse directories. I’m not using these new things just because I don’t want to plug in an usb cable, I’m not that lazy. So I went searching in various forums another solution.
My first choice as media server was ushare, somehow connected to the geexbox project but it had its limitation, one above all that it doesn’t read tags, so when you copy a music file to another device you must retag it manually. Another problem was the init script that didn’t work that well and I didn’t have time/will to fix it. Mediatomb seems the definitive choice to me, it seems a nice project, it reads metadata and has a built in sqlite backend. (you can use mysql too but i don’t have the server on my box). Mediatomb has a webserver you can connect to and you can add/delete content to your share and chose how to rescan your library , you can chose inotify on that ( if you are using beagle you should already have inotify in your kernel).
When it goes to the Media Renderer it seems that there is not much choice yet, but there is some and in particular there is gmediarenderer from the GNU guys. GmediaRender , as the names says, it’s able to render content served from a MediaServer, it needs gstreamer as a backend for all the codecs (it actually uses gstreamer to render the stream ). If you have gmediarender running you can simply go to your nokia N95 media player , chose a song and in options chose “execute on personal network” ( or something like that) and your computer (not the phone) will sound. You can do the same for videos or pictures.
What about coherence? I have it installed and the rhythmbox plugins actually works , I can see my N95 and browse its contents but you can’t (yet) make rhythmbox work as a MediaRenderer. Coherence is supposed to be a full UPNP solution with its server, renderer and controller but the people who develop it are very good in making Youtube videos but not that good to explain the world “how the hell that damn thing works”.
What is missing? On my nokia I can chose to copy or move stuff to my personal network, I can’t do it and don’t know what part of this upnp mess should provide this feature.
