BenV's notes

Archive for 2009

Pokemon OS, rsync/ssh and MAC

by on Sep.11, 2009, under Software

So yesterday at work I ran into the famous ssh MAC failure like this:

wouter@wouter-laptop:~:0> rsync -varP ./vmware/ wouter@192.168.1.2:/archive/archive2/programs/vmware/
Password:
sending incremental file list
./
Keys
116 100% 0.00kB/s 0:00:00 (xfer#1, to-check=8/10)
linux/
linux/VMware-server-2.0.1-156745.i386.tar.gz
32768 0% 800.00kB/s 0:10:11 Received disconnect from 192.168.1.2: 2: Corrupted MAC on input.

rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: connection unexpectedly closed (53 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

No, that has nothing to do with Apple/Mac computers or Media Access Control, it’s
part of the SSH protocol (and others) called Messenge Authentication Code. This blog has a nice explanation: Jan Pechanec on SSH messages.

Funny thing, my brother also had this exact issue with the same kind of laptop. Well…. in his case it was putty failing his connection from a windows machine to this laptop.
The reason? Same as ever, checksum offloading.
You can check if your card does this with the ethtool program:

wouter@wouter-laptop:~:0> sudo ethtool -k eth0
Offload parameters for eth0:
Cannot get device flags: Operation not supported
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: off
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: off
large-receive-offload: off

And the fix for this:

wouter@wouter-laptop:~:85> sudo ethtool -K eth0 tx off

Fixed.

Wait, what does Pokemon OS have to do with this?
Well, isn’t that obvious? It’s supposed to magically work, and it doesn’t! 😉
Probably more a kernel thing though… oh well.

Leave a Comment :, , , more...

Boost, qBitTorrent and lib64

by on Sep.05, 2009, under Morons, Software

After toying around a bit on the news sites I decided it would be interesting to see if qBitTorrent would run on slackware 64.
So we go to the download site, copy the url, and see if Slackbuild likes it. Slackbuild leeches, untars, gives the configure options (which are a bit buggy, I know, will be fixed next release), runs configure. Configure crashes out with “blabla boost blabla”. (continue reading…)

2 Comments :, , , , more...

P4-Clockfuck

by on Sep.03, 2009, under Software

You know what’s really annoying?

Try this:

root@Uil:/sys/devices/system/cpu/cpu0/cpufreq:0>echo ondemand > scaling_governor
root@Uil:/sys/devices/system/cpu/cpu0/cpufreq:0>dmesg
[1325843.712549] ondemand governor failed, too long transition latency of HW, fallback to performance governor

Apparently this is caused by the p4-clockmod module.
You know, this piece of junk:

p4-clockmod

p4-clockmod


Also known as “CONFIG_X86_P4_CLOCKMOD“.

The reason?
Well, the ondemand and the conservative governors want to be able to switch to a different speed before their calculations become invalid.
The p4-clockmod thing apparently makes the latency of switching so BIG that it becomes impossible. Or so they think.
Which leaves only the sucky powersave and performance governors. (and of course userspace).

The kernel menuconfig help states:

This driver should be only used in exceptional
circumstances when very low power is needed because it causes severe
slowdowns and noticeable latencies. Normally Speedstep should be used
instead.

Lovely. I’ll keep that in mind, thanks.
*enables CONFIG_X86_ACPI_CPUFREQ instead*

Note that when they’re both compiled in (as opposed to modules) the retarded thing seems to go for the clockmod. Just great.

1 Comment :, , more...

Phpbb wtf

by on Sep.01, 2009, under Software

Today, phpbb decided to fuck with me.
Or with lotjuh that is. She went to our forum, blank page.
I went there to check, works fine for me. Meh. Probably firefox fucking up as usual.
She tries lynx. Blank.
She tries telnet….

benv@janeman:~:1>telnet forum.handofhades.eu 80
Trying 80.69.76.81...
Connected to forum.handofhades.eu.
Escape character is '^]'.
GET / HTTP/1.0
Host: forum.handofhades.eu

HTTP/1.1 200 OK
Date: Tue, 01 Sep 2009 07:50:04 GMT
Server: Apache/2.2.12 (Unix) mod_ssl/2.2.12 OpenSSL/0.9.8h DAV/2 PHP/5.2.10 SVN/1.4.6
X-Powered-By: PHP/5.2.10
Content-Length: 0
Connection: close
Content-Type: text/html

Connection closed by foreign host.

What. the Fuck.

So, I check the server logs. Nothing.
NOTHING!!!!

Restarted apache. Nothing (surprise!)

Started php myself on index.php. Nothing.
Strace on php to try to figure out what the fuck.
And then I get a glimpse of where it goes wrong when I see it enter a cache dir.
The cache dir has tons of stuff, but most of them look like these:

-rw------- 1 www www 316 2009-08-23 18:42 sql_a10522de103f7e26c0338f4a3982efe0.php
-rw------- 1 www www 316 2009-08-24 21:38 sql_a12f21b584712a564d6bde0b3f733ef2.php
-rw------- 1 www www 316 2009-08-23 00:46 sql_a1386e2adab2812fb0a9076cfbb0fa1a.php
-rw------- 1 www www 316 2009-08-24 11:22 sql_a14603b084ca6516a8f591651a4f0286.php
-rw------- 1 www www 316 2009-08-24 23:02 sql_a1aaa40aaac9978cb292881202667264.php
-rw------- 1 www www 316 2009-08-24 18:23 sql_a1cb1e3ad6332900edb533b9e2a904e4.php
-rw------- 1 www www 316 2009-08-30 18:56 sql_a1cbb2008b00faafb8957bafc7082453.php
-rw------- 1 www www 316 2009-08-22 12:36 sql_a1d2e08e3641f1b8f7c03ceda2e78981.php
-rw------- 1 www www 316 2009-08-24 15:58 sql_a1eac242296c2e713f78618b8b49ad15.php

You get the point.


root@blue:/www/vhosts/forum.handofhades.eu/cache# rm sql_*.php

Fixed. Piece of cancer. Thanks for telling me…

Leave a Comment : more...

Xen and Power Saving

by on Sep.01, 2009, under Software

Or more specific: CPU frequency scaling.

On my laptop this is one of the first things I enabled to make my battery last longer.
Now that we’re going to put a server in a rack where they will bill us depending on the amount of power consumed, this sounds like a welcome thing to have enabled.

Our latest Xen install has Xen 3.4, on which they’ve enabled it by default. Isn’t that nice?
So basically, if your processor etc is good enough to support it, you can mess around with it using the xenpm tool.

For instance we can check the parameters for CPU 0 like this:

root@xenbro:~# xenpm get-cpufreq-para 0
cpu id : 0
affected_cpus : *0 1 2 3
cpuinfo frequency : max [2600000] min [800000] cur [800000]
scaling_driver :
scaling_avail_gov : userspace performance powersave ondemand
current_governor : ondemand
ondemand specific :
sampling_rate : max [10000000] min [10000] cur [20000]
up_threshold : 80
scaling_avail_freq : 2600000 1900000 1400000 *800000
scaling frequency : max [2600000] min [800000] cur [800000]

As you can see, it’s very much like the whole cpufreq ordeal. It has an ondemand governor, a powersave one, etc. Right now this CPU is using the ondemand governor, which will ramp up the clock when demand increases.
However, since this is a quad core and not a real quad processor machine we can only change the governor for all 4 cores at the same time, not for individual ones. (would be cool to have 1 core burning away power while the rest idles by….).

Anyway, the xenpm tool allows us to monitor and change various aspects of this.
For instance this will do a little benchmark and show the processor states during the benchmark.

root@xenbro:~# xenpm start 10
Timeout set to 10 seconds
Start sampling, waiting for CTRL-C or SIGINT or SIGALARM signal ...
Elapsed time (ms): 10003

CPU0: Residency(ms) Avg Res(ms)
C0 49 ( 0.50%) 0.04
C1 9953 (99.50%) 7.19

Avg freq 800000 KHz

CPU1: Residency(ms) Avg Res(ms)
C0 13 ( 0.14%) 0.07
C1 9989 (99.86%) 48.49

Avg freq 800000 KHz

CPU2: Residency(ms) Avg Res(ms)
C0 83 ( 0.83%) 0.21
C1 9919 (99.17%) 25.05

Avg freq 800000 KHz

CPU3: Residency(ms) Avg Res(ms)
C0 28 ( 0.28%) 0.10
C1 9973 (99.72%) 33.92

Avg freq 800000 KHz

As you can see my processor is mostly idle.
State C0 is the most active state, C1 is sleeping with use of the HLT instruction.
Your processor can have many more states, like my laptop which has 4.

Anyway, I put the change to ondemand governor in my /etc/rc.d/rc.local, so let’s hope it helps.

To read some more about the details of this stuff you can check out the Xenpm wiki page.

4 Comments :, , more...

Minor annoyance about linux

by on Aug.31, 2009, under Morons, Software

So I’m working on a little info script (check out Infoscreen) so I can have a nice overview
of my server when I look at console number one without having to log in etc.

Simple question:
“Where in /proc can I find a list of IP addresses with corresponding interfaces?”

Simple answer:
Try /proc/net/if_inet6!

wouter@wouter-laptop:~:0>cat /proc/net/if_inet6
00000000000000000000000000000001 01 80 10 80 lo
20010888148d0000022100fffe221352 04 40 00 00 wlan1
fe80000000000000022100fffe221352 04 40 20 80 wlan1

… that’s great…. but I really wanted the IPv4 addresses as well.
“/proc/net/if_inet4” or “/proc/net/if_inet”? Noooooo….

Conclusion: KANKER LINUX!

Obviously I can get the address by calling ‘ip addr show‘, ‘ifconfig‘ or a heap of other solution involving calling ioctl on sockets or using the netlink interface… but seriously, blegh.

The most retarded thing is that pretty much every other statistic about my network devices is there… including active connections and whatnot, but ipv4 addresses? Nooooo….. *RAAH*

Leave a Comment :, , , , more...

New server, day 2. DomU and networking.

by on Aug.29, 2009, under Software

Another day, another time for fun!

Since we got Xen up and running yesterday, it’s now time for actually having some fun with it.
The goals are:

  1. Getting xend started automagically when booting without destroying my network connection
  2. Getting a domU up and running with a network connection
  3. Getting an internal network between the domUs and dom0, shielded from the big bad internet.

(continue reading…)

Leave a Comment :, , , , , more...

New server, slackware64 and Xen 3.4

by on Aug.29, 2009, under Hardware, Software

You read it right, time for fun!

First we build ourselves a nice cute little server in a 2U rack case made by Chenbro (sounds like Xenbro to me ;)).
Inside we stash a quad core Phenom X2 810, 2 western digital 1TB disks from the “green” series and of course 8GB of DDR1333.
Could be faster, but this should do for not too much coin. (about 600 euros).
(continue reading…)

10 Comments :, , , more...

Secret Maryo Chronicles

by on Aug.28, 2009, under Boring, Fun

So I was bored and went through the usual slashdot, kernel.org, freshmeat.net, etc.
Once reading through the news on happypenguin.org I noticed it must be mario season or something.
After checking the descriptions I decided to check out Super Mario^W^WSecret Maryo Chronicles.
(continue reading…)

Leave a Comment :, , , , , more...

PDF printing and Cups (The Cups Drama ™ Part 2!)

by on Aug.25, 2009, under Software

Here we are today, trying to do a very simple thing. Print a stupid little PDF document so our customers can pay their bills.
Easy huh? Especially after the previous cups drama?

So we fire up xpdf on the document, hit the print icon, lpr, GO!
*time passes*
Mhm, what is it now?
*check http://localhost:631*
Nope, no document there, seems like it was handled by the printer.
*check cups error_log*
Heaps of garbage there.

Remember that we had this issue left in our previous cups story? Something about PDF printing causing issues? (continue reading…)

Leave a Comment :, , , more...

Archives

  • 2018 (1)
  • 2016 (1)
  • 2015 (7)
  • 2014 (4)
  • 2013 (11)
  • 2012 (27)
  • 2011 (26)
  • 2010 (25)
  • 2009 (68)