Il blog di Gas

Just another WordPress site

Archive for the ‘English’ Category

PixieLive

without comments

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.

PixieLive

Written by gas

agosto 26th, 2010 at 7:04 pm

Posted in English,Linux

Tagged with , , ,

Audio transcoding in bash

without comments

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

Written by gas

agosto 26th, 2010 at 6:50 pm

Posted in English,Linux

Tagged with ,

Fail2ban and postfix sasl

without comments

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]+\[\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed

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

Written by gas

agosto 21st, 2010 at 11:18 pm

Posted in English,Linux

Tagged with ,

Unmerge Kde in gentoo

without comments

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 you can see what packages pulls in your atom.

Written by gas

luglio 24th, 2010 at 11:48 am

Posted in English,Linux

Tagged with , ,

Ubuntu on Toshiba A300 PSAJ4E

with 3 comments

toshiba a300Info
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)

Read the rest of this entry »

Written by gas

luglio 17th, 2008 at 10:15 pm

Posted in English,Linux

Tagged with , , ,

Superkaramba and Gentoo

without comments

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).

superkaramba

Read the rest of this entry »

Written by gas

giugno 12th, 2008 at 5:21 pm

Posted in English,Generale,Linux

Tagged with , ,

Laptop ubuntu suspend and nvidia virtual tty

without comments

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.

Written by gas

giugno 7th, 2008 at 5:44 pm

Posted in English,Linux

Tagged with , ,

Nokia N95 and UPNP

with 5 comments

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.

MediatombMy 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.

RhythmboxWhat 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.

Written by gas

febbraio 22nd, 2008 at 11:44 pm

Posted in English,Linux

Tagged with , , , , ,

Mldonkey and conky

with one comment

In the past conky had some built in features regarding mldonkey that have been dropped later. I launch a script that uses netcat to do the same thing ( at least what I need).


#! /bin/sh
USER=user ## mldonkey user
PASS=pass ## mldonkey password for user
HOST=192.168.1.2 ## host where mldonkey is running
PORT=4000 ##port
(echo "auth $USER $PASS";echo $1;echo q) | nc $HOST $PORT

and then for conkyrc

${execi 50 ml_command bw_stats|grep Down|awk -F " " '{print $1,$2,$3,$10,$11,$12}'}

Written by gas

febbraio 14th, 2008 at 2:12 pm

Posted in English,Linux

Tagged with , , , ,

Sync: Nokia , Thunderbird and Google Calendar

with 3 comments

I need to sync many applications on different devices so the best idea for me was using a central server where I can sync too. ScheduleWolrd is a funambol based service that regardless of its ugly interface does what I want .This small howto covers my Nokia N95 , thunderbird + lightning and Google Calendar but it should work with many other devices or applications. Syncing between ScheduleWorld and Google Calendar works mostly out of the box.
Read the rest of this entry »

Written by gas

dicembre 29th, 2007 at 6:08 pm

Posted in English,Generale,Linux

Tagged with , , ,