Archive for the ‘Linux’ Category

LMCC and Router Configs

Wednesday, October 22nd, 2008

Source code attached, see end of article.

I had to pull the password for the internet connection out of a router at work recently and stumbled upon a problem that didn’t seem to have much of a solution, the router allows you to save a binary copy of the config, but it didn’t appear to be a known format.

kosh@aerith ~ $ file config.bin
config.bin: data

So after a little digging I found a Zlib header in the file and found a resource on the internet that had a windows only decoder (which failed for me :( ) so I proceeded to figure it out for myself.

kosh@aerith ~ $ hexdump -C config.bin | head -n 2
00000000 4c 4d 4d 43 00 03 00 00 c9 1a 00 00 8d 0e 8d cb |LMMC............|
00000010 e0 a2 00 00 78 9c ed 3d 6b 73 db 38 92 9f ef 7e |....x..=ks.8...~|

You can see the Zlib style magic at the 20-byte mark (0×14, “78 9c”). I tested my theory by grabbing zpipe.c from the zlib website and using dd to decode it.

kosh@aerith ~ $ dd if=config.bin of=test.bin.Z bs=20 skip=1
342+1 records in
342+1 records out
6857 bytes (6.9 kB) copied, 0.0165227 s, 415 kB/s
kosh@aerith ~ $ ./zpipe -d < test.bin.Z
<config version="3.7.0" fsstamp="20061221093151">
....
</config>

But considering I was 5 minutes from a simple working setup, I hacked zpipe.c down and made zlmcc.c from it. I've made zlmcc.c available for anyone else that wants to deflate these files quickly.

Usual guarantee applies, if it blows up the world, not my fault. I only tested it on my system and with my single config file, using the above steps you should be able to figure it out if they change the format by a little (offset, etc)

KoshWiki - zlmcc.c

g729 Licensing and the Devil

Monday, October 9th, 2006

I reactivated my g729 licenses on the temporary box so I could get to sleep, now that I have built up a new asterisk 1.4 box and set it up, I have to wait until tuesday to reactivate the licenses so I can use them.

So in the meantime clients and friends who ring the VoIP system i’m running get silences and interruptions.

Ugh.

I’m almost tempted to pay another $100 USD for 10 more licenses, but … they won’t be setup until … Tuesday, damn America and it’s time difference.

A conundrum, with an answer

Sunday, October 8th, 2006

Riddle me this Batman. I have a file, fstab, if I add a line it shrinks in size.

entropy:/etc# ls -al fstab
-rw-r–r– 1 root root 610 2006-10-05 20:52 fstab
entropy:/etc# cat fstab
# /etc/fstab: static file system information.
#
#            

proc            /proc           proc    defaults        0       0
/dev/mapper/vg1-root /               ext3    defaults,errors=remount-ro 0       1
/dev/hda1       /boot           ext3    defaults        0       2
/dev/mapper/vg1-home /home           ext3    defaults        0       2
/dev/mapper/vg1-usr /usr            ext3    defaults        0       2
/dev/mapper/vg1-var /var            ext3    defaults        0       2
/dev/hda5       none            swap    sw              0       0
entropy:/etc# ls -al fstab
-rw-r–r– 1 root root 461 2006-10-08 09:36 fstab
entropy:/etc# cat fstab
# /etc/fstab: static file system information.
#
#            

proc                    /proc           proc    defaults        0       0
/dev/mapper/vg1-root    /               ext3    defaults,errors=remount-ro      0       1
/dev/hda1               /boot           ext3    defaults        0       2
/dev/mapper/vg1-home    /home           ext3    defaults        0       2
/dev/mapper/vg1-usr     /usr            ext3    defaults        0       2
/dev/mapper/vg1-var     /var            ext3    defaults        0       2
/dev/mapper/vg1-backup  /backup         ext3    defaults        0       2
/dev/hda5               none            swap    sw              0       0
Read on for the answer.

(more…)

Suggested, Learn to Spell

Monday, April 3rd, 2006

I thought this was very funny.

root@knoppix:~# apt-get install nano
Reading Package Lists… Done
Building Dependency Tree… Done
Suggested packages:
spell

The following NEW packages will be installed:
nano
0 upgraded, 1 newly installed, 0 to remove and 863 not upgraded.

Netcat Tar Pipe

Sunday, March 26th, 2006

Always useful netcat and tar used together.

This is more for my own memory, but checkout the page on Dan Walrond’s site.

On the receiving end do:
# netcat -l -p 7000 | tar x

And on the sending end do:
# tar cf – * | netcat otherhost 7000

PXE and BartPE

Friday, March 24th, 2006

I’m going to experiment later with getting BartPE working with PXELinux, I’ll post up my results on that as well.

I think I need to use this more for periodic info, and make a sister site with browsable articles.

But it’s not like anyone reads this site anyway.

Unattended Windows XP/2003 Installations Over the Network

Friday, March 24th, 2006

I recently had the opportunity to try setting this up.

The quick list is
PXElinux
Bart’s Network Bootdisk (for deployment from the pxelinux server)
setupmgr from the deploy.cab on the XP/2003 CD
Linux Server to run it all from.

I’ll write more about it later on, but it is very interesting, and a huge time saver for techs like me who have to do XP / 2K3 installs all the time.

Also I haven’t tried it yet, but I am looking at using a combination of VMware and PXELinux to make my laptop able to be a portable “drop and install” server.

I’ll put up more news on that when I get a few minutes to myself.

Server Updating and Pie

Friday, March 24th, 2006

When come back bring Pie !

Anyway.

I had some trouble with my latest apt-get, I was getting GPG errors on the keys for the servers.

Here is the link and the excerpt from what I found on how to fix it, using this as a base, it’s pretty easy to figure out how to fix.

http://lists.debian.org/deity/2005/08/msg00178.html

Reading package lists... Done
W: GPG error: http://kanotix.com ./ Release: The following signatures
couldn't be verified because the public key is not available:
NO_PUBKEYFB1A399A71409CDF
W: GPG error: http://www.stanchina.net ./ Release: The following
signatures couldn't be verified because the public key is not available:
NO_PUBKEY 3DCCCCACE46F104F
W: GPG error: http://hinterhof.net ./ Release: The following signatures
couldn't be verified because the public key is not available:
NO_PUBKEY A0E41455F530F04D

These GPG errors can be corrected by running:
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 71409CDF E46F104F F530F04D
&& apt-key add /root/.gnupg/pubring.gpg && apt-get update

FreeNX

Wednesday, March 22nd, 2006

I just started playing with FreeNX (when I was looking for a VNC Linux Server tutorial, it has been WAY too long since I did it :P )

It looks good, I have a few bugs, but it goes pretty well, and it seems very user friendly.

http://ubuntuforums.org/showthread.php?t=1968
http://www.nomachine.com/

Check it out.

Compaq Server Woes

Tuesday, February 7th, 2006

Still on the Compaq Servers, I have officially given up running linux on them.

I couldn’t find a way to make it reset when told to restart, and having a machine that you can’t restart remotely is bad.

Under Windows, it restarts fine … doesn’t shut down though.

Meh.

The end of the Compaq Saga