29 October 2009
Here is a quick ‘n dirty way to dump the environment of a C program without the aid of any external programs (i.e. if you can’t exec() into /usr/bin/env):
#include <unistd.h>
#include <stdio.h>
int main (int argc, char *argv[]) {
extern char **environ;
int e = 0;
while (environ[e] != NULL) {
printf("%s\r\n", environ[e]);
e++;
}
}
Outputs:
USERNAME=jeremy
DESKTOP_SESSION=gnome
PATH=/home/jeremy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PWD=/home/jeremy
[...]
Tagged: coding, snippets | 4 Comments »
28 October 2009
After I installed Fedora Rawhide on the eMac this week, I fired up X.Org, only to discover that…
(II) AIGLX: Screen 0 is not DRI2 capable
(II) AIGLX: Screen 0 is not DRI capable
So it had fallen back to a software 3D renderer, which is pretty crap. So to make a long story short, it was because my ‘Virtual’ screen size was too big. I typed xrandr, and got the following:
$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 960, maximum 2048 x 2048
Because of various technical reasons, when the Virtual size is too big (which, evidently, 2048×2048 is), DRI gets disabled. So, to re-enable it, I put this into my xorg.conf:
Section "Screen"
Identifier "Main Screen"
Device "Radeon 7500"
Monitor "eMac CRT"
SubSection "Display"
Virtual 1280 960 # put the highest resolution you intend to use here
EndSubSection
EndSection
Obviously, edit the values to suit.
Tagged: ati, emac, fedora, hacks, Linux, xorg | 3 Comments »
23 October 2009
Those of you running Python-iView should do an update to get the latest version, which contains a number of bug and compatibility fixes.
To update an existing Python-iView system, change to the directory where you installed it, and run:
$ bzr pull
Then, to support the new SWF verification ‘feature’, you will need to download and install rtmpdump, and install the resulting rtmpdump_x86 executable into somehere like /usr/local/bin.
(For those of you content with having their videos cut out every 8MB, feel free to continue using FLVStreamer — Python-iView will try both FLVStreamer and rtmpdump.)
If you don’t already have Python-iView, see the original post for instructions on how to get it.
Tagged: coding, python, Python-iView, video | 7 Comments »
22 October 2009
I should mention that WordPress 2.8.5 has been released. No security holes as such, but fixes some other issues that were discovered in the past few weeks.
While I’m at it, here’s a weird bug I only just noticed in the post editing screen: in the Publish postbox (the one that contains the Publish button), when I click one of the Edit links, the edit link disappears, and when I press Cancel, it reappears. That’s fine, but when I open the top Edit link and another Edit link, and I press Cancel on the one that’s not the top, the top Edit link reappears even though the top Cancel link hadn’t been clicked.
What a mouthful. Let me show you a video. (To be honest, this whole post was just an excuse for me to use the <video> tag for the first time. I even had to write a WordPress plugin to let me upload .ogv files. Now my website officially doesn’t validate any more — whee!)
Read more…
Tagged: coding, php, WordPress | 1 Comment »
19 October 2009
Users of my Python-iView application may have noticed that when attempting to watch videos, they cut out after 8MB.
This is because the ABC have turned on “SWF verification”, which translates to “our incompetent head of IT who is a fan of Hello Kitty and also eats puppies decided we would enable this, similar to how passports and airport security actually keep out terrorists and criminals, and also explains why there is no crime in the world any more”.
Which also translates to “security by obscurity”, “papers please”, “fascism”, “коммунизм”, and “Miguel de Icaza”.
Because anybody watching videos from iView in anything other than the Flash-based web interface, e.g. on an underpowered Eee PC, an Xbox, or somebody offline, clearly shouldn’t be doing so. Doesn’t take a rocket scientist to figure that one out — even a manager could work that out.
This really sucks.
(And if you’re the type of manager that actually likes to fix problems and get things done — I know, bowls me over too — then disable SWF verification. It’s, like, a checkbox fix.)
Tagged: aargh, coding, python, Python-iView | 5 Comments »