Monday, November 17, 2008

Midnight Commander transparent color scheme

Midnight Commander (or "mc") can have transparent panels instead of the ugly, dull default blue. So can "mcedit", its text editor.

Here's how to do it. Edit the file ~/.mc/ini and add at the end the following:

Tuesday, September 2, 2008

Postfix on FreeBSD - Maildir delivery

Suppose you have a clean FreeBSD install and you want to get Postfix as your MTA.

Current setup:

  • OS: FreeBSD 7.0-RELEASE
  • SHELL: bash
  • no previously installed MTA present on the system

Sunday, June 29, 2008

Triple boot pain

Today I went at a friend's place to help him set up a triple boot system. The PC is brand new and bleeding edge (it will be used primarily as a gaming device), but the guy was still curious about Linux. So I told him about Linux in general and offered to install Ubuntu. He agreed and we went on with the partitioning scheme.


The HDD had 500 GB and we agreed to set up the partitions as follows:
* primary partition - 50 GB - Vista Business x64
* primary partition - 50 GB - XP Professional x64
* primary partition - 25 GB - Kubuntu 8.04
* extended partition - ~375 GB
- 4 GB - Linux swap
- the rest - big storage partition
OK, so when all this was settled, I started the Vista install. It went OK, no troubles whatsoever. Then came Kubuntu - all went fine. I used GRUB in order to be able to choose between the two operation systems.

Thursday, June 26, 2008

Manually modifying a .deb package

From time to time, you might be facing a binary .deb package that you have to tweak for suiting your own needs or for testing purposes. By "a binary .deb package" I mean the final .deb, with a few configuration files and pre/post-inst/rm scripts and not the source files for the .deb themselves.

So, what to do if you only want to change, say, the behavior of a postinst file and then have the .deb prepared for installation?

First of all, the .deb itself is a kind of an archive. This is why you can browse its contents while in mc, for instance ("Midnight Commander").

Sunday, June 22, 2008

Ubuntu 8.04 Live CD and weird SATA HDD

Today I went at a friend's to help her set up a new PC in a dual boot configuration (Windows XP, which was already installed, and Kubuntu 8.04).

XP came preinstalled so I burned a CD with Kubuntu 8.04 and booted from it... just to find out that there was no normal way of detecting the HDD as device.

Tuesday, June 10, 2008

Compiling Pidgin MTN

This post explains how to compile Pidgin from source, but not the stable Pidgin releases available for download on the website; instead, I'm talking about the latest development Pidgin version (often called "Pidgin MTN"), available via Monotone (a distributed version control system). See this post regarding compiling Monotone from source.

Compile Monotone from source

The current version of Monotone, a distributed version control system, is 0.40. To compile it from source:

Monday, June 9, 2008

How to overlap two images using Gimp

Gimp - one of the greatest professional apps ever to be found out there... professional image manipulation software; and, of course, open source.

Too bad there are a lot of idiots in this world - starting with myself - who don't have the slightest clue on how to use it. I mean, I always loved photography and as a kid I used to play with my grandfather's "borrowed" old Zenit camera, but since photographic films were not cheap and I had no means of editing the photos, I quit. Since then, I've been planning... and planning to get a camera of my own, but since I don't want anything below a SLR - and a decent one is around 1,000 EUR - it'll have to wait. But that's another story...

Getting back to Gimp. My concrete problem was how to get two images of exact size (after adjusting their size such that they "fitted" the dimensions) overlap with an amount of transparency. I'm aware this must be an extremely easy task for anyone just a little bit more photo editing savvy than myself, but anyways - I had no clue what to do so after googling and reading a little bit, I found out.

I'm posting here the "short version", suitable for my concrete issue. (Such that I'll know next time where exactly to go to for instructions.)

Sunday, June 8, 2008

Pidgin bug

While I have to admit that Pidgin is generally speaking a great multi-protocol IM (instant messaging) client, it's got its flaws too... just like any software. And I'm not talking here about the notorious developers / users scandal, resulting in a Pidgin fork because users just wanted a resizable text input field, while the developers said they don't care. I'm not even talking about the lack of voice and web cam support (there's a ticket from the beginning of time there... prioritized as minor).

Wednesday, April 9, 2008

Convert .flac files into .mp3

In order to convert .flac to .mp3, you'd need to do the following: first cd into the directory with the .flac files, then
for x in *.flac ; do OUTF=`echo "$x" | sed s/\.flac$/.mp3/g` ; flac -c -d "$x" | lame -m j -q 0 -V 0 -s 44.1 - "$OUTF" ; done

Friday, February 29, 2008

Default charset in apache (2)

Yep, so getting back... apparently I've missed some important hint:


http://www.apache.org/dist/httpd/CHANGES_2.2

This file contains a paragraph I missed:

Thursday, February 28, 2008

Default charset in apache

Darn! I finally got over my problem... so let's get back to the very beginning...

I use apache 2.2.4. I've been using it without a problem for a long time. My needs for apache are very basic: I just need tons of directory listings (indexes) with the ability to follow symbolic links, and ~10 aliases. The files in the directory listings are on my local computer and they usually have "weird" encodings, so I needed to let apache know I need it to use UTF-8 as default charset/encoding. Simple to achieve... or so it seemed: I used to run apache installed via aptitude under /etc/apache2.

Wednesday, February 27, 2008

Webmin in FreeBSD

Webmin installation in FreeBSD is pretty straightforward:

pkg_add -rv webmin
echo 'webmin_enable="YES"' >> /etc/rc.conf
/usr/local/lib/webmin/setup.sh
/usr/local/etc/rc.d/webmin start

Tuesday, February 26, 2008

Apache...

For a wealth of apache documentation: apache.org httpd docs. (Just change '1.3' in the URL into '2.0' or '2.2' for different flavors.)

Note to self: RTFM.

Basic apache configuration in FreeBSD

So I decided to try out apache in FreeBSD...
pkg_add -rv apache
vi /usr/local/etc/apache/httpd.conf
Added the lines:
ServerName www
BindAddress *
Supposing my hostname is dvorak, I need to edit
vi /etc/hosts
and add the line:
127.0.0.1 dvorak

procfs and loadavg

I think that one of the biggest problems somebody with a Linux background faces with FreeBSD is having gotten used to procfs.

Sendmail: Maildir format

Here's a quick one: on FreeBSD, how to configure sendmail to deliver mail in Maildir format?

...Using procmail for this example.

PACKAGESITE

Coming from my Linux background, I expected that after installing FreeBSD and choosing my geographical location – and, most importantly, choosing a local FTP mirror for the bootonly install CD –, somehow the system would "guess" that I'd want to keep the same location when doing further package installs - with pkg_add for instance. Unfortunately, pkg_add goes to the default ftp://ftp.freebsd.org package location and it can take a long time to install a package with lots of dependencies.

After fiddling around I found out there's an environment variable called PACKAGESITE that instructs pkg_add to go to a "package site" designated by the user.

dpkg-reconfigure locales...

"Open source features" take N+1 :-)

On a Debian system,
sudo dpkg-reconfigure locales
would prompt you with a nice menu allowing you to select new locales... Unfortunately, this is not the case with Ubuntu. You just get to generate or update the already selected locales. This is actually an Ubuntu bug, confirmed (with status: wishlist).

Monday, February 25, 2008

Make Konqueror remember the default view

One of the 'features' of open-source is this phrase that I'm sure you heard at least once: "Well now... that's not a bug, it's a *feature*!" -- yeah, right!


One of those "features" is the fact that Konqueror doesn't seem to remember the default view I set up in any profile. Namely, when I use Konqueror as a file manager and type something in the address bar, such as ~/tmp, I really want it to display the contents of ~/tmp in "Detailed List View", the way I chose it as default! But it doesn't.

Convert .wma files into .mp3

Another thing that's been troubling me regarding audio files is those damn .wma-s that cannot be played by my iPod. So it's time for a handy script that will convert .wma into .mp3:

for x in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader "$x" ; lame -m s audiodump.wav -o "${x%wma}mp3" ; rm audiodump.wav ; done

Pretty impressive – lame's manual page deserves a good read.

Convert .m4a files into .mp3

One of the things that's been troubling me lately has been the fact that on a standard Debian/Ubuntu system I can't seem to be able to edit the tags for the .m4a files I have.

So, in order to edit the tags on the .m4a files... I'd rather convert them into .mp3-s. The way to do this is actually simple.

LSCOLORS

As stated earlier, I came back to the problem of LSCOLORS.

If using bash, in order to get colorful directory listings in FreeBSD the user needs to set the CLICOLOR environment variable to "YES" and export it and would also need to define (and export) the LSCOLORS variable, all inside ~/.bash_profile.

So, how do we define LSCOLORS?

Sunday, February 24, 2008

First customizations

OK, first things first. For an 'experiment' with FreeBSD I first needed it installed somewhere... for the purpose of my own mental and psychical health, I choose to get FreeBSD running in a virtual machine first.

Since I'm not eager to see it (...yet) as a viable fully fledged desktop system, I was not interested in the X part of this install so I chose a minimal install, by using the "boot only" CD.

Friday, February 22, 2008

Default title for a 1st post (?)

The next boring step after having finally edited my "Blogger profile" is the first post... so let's get this over with.