coding

japh

| |
$z=sub{for($z=0;$z<@_;$z++){$z=oct("$_[$z++]")."$_[$z++]".$_[$z];for($w=0;
$w<length($z);$w++){($n,$n)=split(m--,substr($z,$w,2));$w++;$x=int($n);
push(@v,split(m++,${n}x${x}));}}for($w=0;$w<@v/3;$w++){$_=chr(int($v[$w].
$v[$w+055].$v[$w+0x5a]));$_=~tr,a-za-z,n-za-mn-za-m,;print $_;}};$z->(10016,0x460,
4120,6046,0x1810,3110,15706,0x83e,1130,2437,0xb5e,2110,2447,0x456,1213,6050,0x456,
3411,2613,0x840,1321,1763,0x7db,1910,2151,0x584,1312,1771,0x715,1714,2130,0x77a,
2112,3256,0x4ba,1411,7032,0x5ef,1718,2142,0x6af,1812,2442,0x6b0,1417);

64-bit MySQL and DBD::mysql Woes

| | |

I was attempting to install DBD::mysql today, and I ran into a fiendishly difficult problem.

I've installed the mysql drivers for Perl countless times, but this time for some reason, I was getting the following error:

ool-4577f347:~/.cpan/build/DBD-mysql-4.004 root# make
cc -c -I/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -Os -arch ppc64 -fno-common -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"4.004\" -DXS_VERSION=\"4.004\" "-I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE" dbdimp.c
dbdimp.c: In function 'mysql_dr_connect':
dbdimp.c:1565: error: 'ulong' undeclared (first use in this function)
dbdimp.c:1565: error: (Each undeclared identifier is reported only once
dbdimp.c:1565: error: for each function it appears in.)
dbdimp.c:1565: error: parse error before numeric constant
dbdimp.c:1567: error: parse error before numeric constant
dbdimp.c:1681: error: parse error before numeric constant
make: *** [dbdimp.o] Error 1

Fun with Xargs on Mac OS X

| |

This is something I wrote over at DocForge, but I'm keeping it here for posterity. You never know what those crazy wiki-ers might do with it over there ;-)

I've got a directory full of eBooks in the godawful Microsoft .lit format. I had marked with the Finder labels the ones I've already read, and wanted to convert all the ones I hadn't read yet into a readable format.

After using the Spotlight UNIX tools and applying liberal amounts of command-line trickery, the end result was a rather beautiful pipeline, if I do say so myself.

Notes on Mod_Python and Apache 2.2 on Mac OS X

| | |

I'm hoping to get away from PHP in favor of mod_python, but the first thing I needed to do was get mod_python successfully working on Mac OS X. I tried once before, using the built-in Apache and Python binaries that ship with Mac OS X. At the time (I think this was still 10.4, but it could have been 10.3), the built-in Python wasn't multithreaded (or something like that) and the mod_python developers were starting to move away from Apache 1.3 altogether.

I had success recently compiling mod_python on Mac OS X Server, against the distributed (but inactive) Apache 2 installation in /opt. However, I found OS X Server to be basically garbage, so I did a fresh install of the client version of Mac OS X, and set about getting Apache 2 to compile, and then mod_python.

It was not easy.

japh

| |

#!/usr/bin/perl
@x=(0x50,-82,0xd,-3,-12,0x5,0x1,0xd,0x41,-84,0x1,
-2,0x2b,0x4a);$Z=sub{for($z=@_;$z;$z--){unshift(
@z,chr($_[$z]+$z{z}));$z{z}+=$_[$z];}while($z=pop
(@z)){print($z);}};$z=$Z;@Z=(0xd,-6,0x8,0x2);$Z->
((0,0,0,-68,@Z,-7,0x48,-76,-6,0xd,-11,@x));

beginning of day timestamps

| |

mark got me thinking about this, and then i was messing around with one of my own projects that needed the same feature, and i realized the easy way to do it.

i would always get the year/month/day out of a timestamp using the date() function, and then create a new timestamp with mktime().

i just realized the best way is:

$now = time();
$beginning_of_day = $now - ($now % 86400);

this works for me because i definitely remember that number for seconds in a day, and avoids any locale-dependent variations. plus, end of day becomes just as easy.

some info

|

I got a message from someone who was interested in pooking around InnerSpace today, and spent enough time providing some starter instructions that I figured I'd post them here.

thanks a lot for writing. i'm glad some people are checking this out...

right now the codebase isn't really meant for public consumption. i do this primarily as a personal exercise, and although there are many parts of it that are very functional, other parts aren't so refined...

i've attached a tarball, which contains some sparse documentation. i don't know what your level of familiarity is with Python and the Twisted library (http://www.twistedmatrix.com), but some basic concepts from those areas can get you up and running.

the game of life...

|

it's incredibly unusual for me to post this many times in a week, much less twice in a day, but...

when i added that emblem at the top, i got thinking about how i had never written a game of life program. this is one of those standard things all computer science students do at one point or another, but since i didn't want to do things the standard way and had to drop my CS major, I never did.

so, anyways, check it out....

some updates...

|

So, as it's been awhile since I've updated, I have lots of new developments. I've been fortunate to find some time to tinker with IS, and there's lots of cool stuff coming along.

I've also removed the CVS directory from sourceforge, as I wasn't using it, since I prefer to use my own repository for now. Once I get to a releasable 1.0 candidate, I may mirror my repository to sf, but for now you can access the bubblehouse web-repository using the links to the left. I will eventually open up pserver access through my firewall, but until i get some more interest in this I'm not going to bother.

Nice New Things

|

So right away I have something to show anyone who wants to look. I've been thinking about the whole RExec/Bastion problem, and I may have come up with a solution. I'd also certainly appreciate it if anyone could fill me in with any obvious security flaws

Check out SaferPython. It is my attempt to rewrite a restricted environment for Python. Admittedly, I don't think I know enough about the new language features to be sure if this works. I've tried a number of "exploits", and this seems to provide the kind of protection I want, but I'm pretty sure it doesn't have the abilities that some RExec users need.

Syndicate content