Saturday, November 6, 2010

Great App: manServer

Do you read a lot of man pages ? Sick that you cannot click on See Also pages?

Try manServer which converts man pages to HTML, is perl script, has a built-in web server to browse thought the pages.

http://www.squarebox.co.uk/users/rolf/download/manServer.shtml

Wednesday, March 31, 2010

LogiLink Adapter

To use my "old" IDE devices, I bought adapters. The options on the net about these weren't very good: too slow, do not work. I cannot confirm this.

My adapters:

LogiLink Adapter AD0008: S-ATA to IDE + IDE to S-ATA
http://logilink.com/showproduct/AD0008.htm
Adapter needs power supply via a USB power cable (within the scope of supply).

LogiLink Adapter AU0005A: USB 2.0 to 2,5 + 3,5 Zoll IDE HDD
http://logilink.com/showproduct/AU0005A.htm
Great stuff, works with HDD, CD drives, ...
If motherboard supports boot from USB, OS from an external HDD or CD drive can be executed.
Jumper has to be set master.

Saturday, February 27, 2010

Looking for pand in Fedora 12 ?

You can find it in the package bluez-compat

PAN: Personal Area Network

Hibernate

Do you think nowadays a swap partition is not needed anymore because of the GB-sized RAMs ?

Well, if you want to use the Hibernate feature you need a swap partition. There is the possibility to use a file on a disk to store the RAM for Hibernate but the quickest way is to use a swap partition.

Friday, February 12, 2010

ASUS AT3N7A-I & MythTV & Fedora 12

On my page you can find a report about the motherboard ASUS AT3N7A-I

http://linux.thaj.net63.net/prj/at3n7a-i/AT3N7A-I.html

and some tips for MythTV 0.22 + NVIDIA Driver and Fedora 12

Sunday, November 29, 2009

Fedora 12 & Maple 13

Maple worked out of the box with Fedora 10. With Fedora 12 you will get some security warings.

To get Maple working execute the script on a terminal:

MAPLE=/opt/maple13
export MAPLE
chcon -t execmem_exec_t $MAPLE/bin.IBM_INTEL_LINUX/mserver
find "$MAPLE" -name "*.so" -print0 | xargs -0 chcon -t textrel_shlib_t

I havn't tested all, but my stuff works.

Sunday, August 2, 2009

Use your mobile phone via bluetooth as modem

All commands should be run as root.

First pair your phone.
There are many HOWTOS or just look at the source at the bottom.
At this step you should get the bluetooth address for your phone, if not use

$ hcitool scan


Another way is to put the pin code into file pincodes in the directory /var/lib/bluetooth/<address of your bt adapter>
The first entry of a line is the address of your bluetooth device, the second the pin code, eg:
00:1E:3B:10:7A:88 1234


Bind the phone.
First you need to find out which channel the DUN (Dial Up Networking) uses. Usually it's channel 1. But ...

$ sdptool search dun

or to get all services ...

$ sdptool browse [bluetooth address]



Add the following to /etc/bluetooth/rfcomm.conf
rfcomm0 {
# Automatically bind the device at startup
bind yes;

# Bluetooth address of the device
device 00:1E:3B:10:7A:88;

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment "Mobile Modem";
}


Replace the bluetooth ID after device with the mobile phone's bluetooth ID and check if the channel is the right one.
If bind is set to yes, the mobile phone is bind when rfcomm starts. Of course, if there is another rfcomm0 section, use rfcomm1 and so on ...

Bind the phone (if bind is set to yes and the bluetooth service is active, the command will be run at startup)
$ rfcomm bind rfcomm0

You can check it with
$ rfcomm

Output is something like
rfcomm0: 00:1E:3B:10:7A:88 channel 1 clean


Set up a modem connection

Now your are ready to start an internet connection via /dev/rfcomm0
The connection settings you should get from your mobile service.

Usually you need an init string something like
at+cgdcont=1,"IP","internet"


Most mobile services accept for the username and password dummy values.


http://linux.frankenberger.at/Huawei_E220_Daten.html is a good place to look for connection settings.


Ref

I tried it with a Nokia 2630 and worked great.

Good source with details HOWTO : http://davesource.com/Solutions/20070520.T-Mobile-Nokia-E65-Ubuntu-Linux.html

Sunday, May 17, 2009

Protect your data

As external hard drives get more popular, data security should get more attention.

Here is a simple How To for creating an encrypt hard drive.

First at all, you need an empty partition. For our example I will call it /dev/sda5.

Run cryptsetup to create the partition. It will ask you for the password. Be sure no data is on the partition !!

cryptsetup -c twofish-cbc-essiv:sha256 -s 256 luksFormat /dev/sda5

Well, -c choose the cipher, -s set key size (128 as default is not enough).



Now we have an encrypt partition, but without any filesystem. To create a filesystem, open the partition with

cryptsetup luksOpen /dev/sda5 encrypthd

The last parameter sets the mapping name, e.g. /dev/mapper/encrypthd



Create the filesystem with

mkfs.ext3 /dev/mapper/encrypthd



Now mount it and your done !

To close an encrypt partition, unmount it and call

cryptsetup luksClose encrypthd





To mount it at startup, edit or create the file /etc/crypttab (only root should be able to read/write)

Syntax for crypttab: target source key options

So, for our example add the line:

encrypthd /dev/sda5 none

If key file is none: it will ask you for the password at startup.



And add the line to fstab:

/dev/mapper/encrypthd /encrypthd ext3 defaults 1 2





If you are really paranoid, you also have to encrypt your swap. On an unclear system shutdown (blackout, ...) the password for the encrypt partition can be still on the swap partition.


Gentoo has a good documentation (cipher, more details, ...):

http://de.gentoo-wiki.com/wiki/DM-Crypt
http://en.gentoo-wiki.com/wiki/DM-Crypt (a little be outdated)


Saturday, April 11, 2009

Some Kernel Parameters

A long list can be found at: http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt


forcefsck to check the filesystem or run (link)
touch /forcefsck
reboot


single (single mode) or n where n is the runlevel to enter

ro mount root file system read only on boot, so fsck can do its job.

Probelms with Fedora 10 on a Gericom Blockbuster 2

A Gericom ??? You ask me, if I'm sick ?
Well, someone bought it and just for standing around it's too bad.

I installed Fedora 10 on an external hard drive and with my PC and another notebook (it's a maxdata) it works without any problems. Well, how to boot Fedora change from PC to PC. Some can read the MBR on the external hard drive and load GRUB, other need GRUB on the internal hard drive to boot from the external drive.

Back to Gericom:
The BIOS have an option to boot from removable devices, but when I plug in my 1TB external drive, the BIOS hangs up. With smaller USB drives it works. BIOS update doesn't help.

So I searched for a boot manager, which is able to boot from usb. I found PLoP Boot Manager at http://www.plop.at/en/bootmanager.html, which does the job.

The next problem:
Booting Fedora worked, X started, but suddenly no keyboard or mouse worked anymore. But the system was running. I know that because when I pressed the power off button, the shutdown dialog appeared. What the hell is going on ?

The make a long story short: After some tests, I figured out that the service irqbalance was the trouble maker. When the service is disabled, the system runs.

Start up with runlevel 2 (here is irqbalance disabled), run chkconfig --levels 345 irqbalance off to disable the service at the runlevels 3, 4 and 5.

Monday, April 6, 2009

Disable the f*cking PIN code

I just installed Fedora 10 and wo. Everything worked at startup: X.org, sound, network. I didn't have to configure something.

Then I plugged in my Huawei E220 UMTS moden and opened the NetworkManager to enter my username and password.

I tried to connect. NetworkManager asked me for the PIN code. I entered the right one and clicked OK. Nothing happend except the logging in the syslog "Searching for network ...". After some minutes the NetworkManager give up.

Rebooted, enter PIN code in the config dialog. Same problem. Rebooted, maybe currently no network, so I tried it with Ubuntu, no problems.

Why does the thing not work with Fedora ? With Ubuntu there is no problem.

After some time I disabled the PIN code and it worked.

NetworkManager is also unable to handle a SIM card with a PIN code correctly.

My tip: Disabling the f*cking PIN code helps to aviod some troubles ...

Wednesday, September 3, 2008

Experience with mencoder

mencoder encodes videos, I use it to encode my DVB recordings. When you run mencoder without any tunning, you will waste useful space. Here is my experience with mencoder:

Removes all black borders
Really !! You can use the filter cropdetect to find the values for the crop filter or use the filter rectangle:
$ mplayer -vf cropdetect video.avi
$ mplayer -vf rectangle=716:428:: video.avi

Avoid odd numbers
as a general advise.

Height and Width
must be a multiple of 16. The video codec encodes the video with 16x16 blocks and if the size isn't a multiple of 16, you will waste space. The filter cropdetect returns values that are a multiple of 16, but also crops the video sometimes to much.

Scale
can help to solve this problem. And sometimes it's better to have a smaller height and width. First just crop only the black borders, then scale the video height and width to a multiple of 16.

For example:
$ mplayer -vf crop=716:428::,scale=640:-10

The new width is 640 and height 352.
The parameter -10 tells the scale filter to calculate the height using the width and to round the height to the closest multiple of 16.

Use filter hqdn3d=2:1:2
Use filter harddup
See man page why

Two Pass Mode
The  first pass analyzing the whole video and writes a statistics file. The second pass reads the statistics file and bases ratecontrol decisions on it. The output file from the first pass can be deleted or send directly to /dev/null

File Size
Should the movie fit on a CD, then you have of calculate the bitrate of your movie:
Bitrate = (Target_Size_in_MB - Audio_Size_in_MB - AVI_overhead_MB) * 1024 * 1024 / Length_in_secs * 8 / 1000
Use the video codec xvid and it will do it for you, you just need to set the video file size in KB (See example).
How to calculate it ? When you use the Two Pass Mode, write down the audio size after the first pass has finished.
Video_Size_MB = Target_Size_in_MB - Audio_Size_in_MB - AVI_overhead_MB
Video_Size_KB = (Target_Size_in_MB - Audio_Size_in_MB - AVI_overhead_MB) * 1024

AVI Overhead
When you use AVI as your container, some MBs will be wasted for the AVI header and index.
For a 350MB file ~ 5MB
For 700MB ~ 8MB

Example

First Pass
$ mencoder -ovc xvid -xvidencopts pass=1:autoaspect:threads=2 -vf crop=715:428::,scale=640:-10,hqdn3d=2:1:2,harddup -oac mp3lame -lameopts aq=3:preset=standard video.mpg -o /dev/null

Second Pass
$ mencoder -ovc xvid -xvidencopts pass=2:bitrate=-595968:autoaspect:threads=2 -vf crop=715:428::,scale=640:-10,hqdn3d=2:1:2,harddup -oac mp3lame -lameopts aq=3:preset=standard video.mpg -o video.avi


Is the value for the bitrate option negativ, it sets the video size in kilobytes [700 (CD) - 110 (audio size) - 8 (AVI overhead) = 580 * 1024 = 595968kb].
The threads option is only useful if you have more than one CPU else remove it.

DVB Streams

If you record a DVB streams you will notice sooner or later, that they aren't small.
For two hours 5 GB space, isn't that small and won't fit on a CD.

To encode a video, first you have to demux with ProjectX (http://sourceforge.net/projects/project-x) and remux with mplex (package mjpegtools) the stream to fix possible transmission errors. If you don't to that, you will maybe get a video where the audio and video is out of synchronization. It is also possible to export the subtitles from the Teletext.

$ java -jar ProjectX.jar myVideo.mpg

After running the program, you will find for every video and audio track an own file. To see all available options from ProjectX, run it without any parameters.

Then remux the video and audio together with mplex:

$ mplex -f 8 -o newVideo.mpg myVideo.m2v myVideo.mp2

When mplex returns without any errors, all files are no longer needed except newVideo.mpg.

Now cut out the advertisement, for example with dvbcut or avidemux and encode the video the get a smaller file size.

Saturday, August 16, 2008

My Linux Stuff

I have set up a new web page where i place all the Linux Stuff which has no place at this blog like long scripts and so on ...

http://linux.thaj.net63.net/

Wednesday, July 30, 2008

Horrible MP3 sound ?

When i played MP3 files, they sound horrible and had a bad quality.

I don't know why, but if I set the PCM control to 80% or lower (thanks
to a hint from a forum), i will get the quality before I switched to
Linux.

Crazy, isn't it ?