GEEK BOY'S BLOG

Peter Clark on life, coding, parenthood, Java, Scala, Ruby, grad school, and demographic data

Minecraft launcher

My older daughter is becoming a minecraft junkie. Recently, she asked if she could run her own server for her and a friend to use. I was kind of excited that she wanted to try that, but didn't want to give her access to Terminal.app in Parental Controls to run it on the mac. However, the server itself is pretty straightforward - it's a java app that opens a socket and also takes input from the console. It seemed like it should be pretty easy to wrap that into an app that she could run by double-clicking, and that I could have some control over. So, that's what I did. And here it is, in case you want to play with it.

You'll need to get the minecraft_server.jar file yourself, since I don't think I can redistribute that. However, it's easy to find.

Enjoy, and fork!

Filed under  //   java   minecraft   server  

Home networking woes

I've been a QWest CenturyLink DSL customer for ages. I started out with a Cisco 675 modem, then moved to a Cisco 678 when the DSL signaling technology for the line switched from CAP to DMT. The little Cisco box was a sweet DSL modem. However, earlier this year, I couldn't get more than 32kpbs downstream on the DSL line, despite having a steady connection at 7mpbs the night before. A tech came out and was able to get a solid 7 mpbs with his line diagnostic tool, and we tried a newer modem and also got 7 mpbs. So, my cisco got traded out for an ActionTec GT701, and I now get 7mpbs again.

Except when the DHCP server in the actiontec stalls. Then, I get bupkis. I've got a fairly complicated home network - a mix of windows, mac, ios and other stuff. All of it expects DHCP. If something already has a DHCP-assigned address, it works great, but newly-powered-on devices don't get an address and don't get to the net.

As it happens, the apple time capsule will also do DHCP. With a bit of configuration shuffling, I turned off the DHCP server on the ActionTec and turned on DHCP on the time capsule. The ActionTec still does NAT and routing, but isn't being asked to hand out addresses anymore. This seems to work well.

Filed under  //   DSL   actiontec   dhcp   network   time capsule  

Vendor Kudos

I have to give a big shout-out to VMWare's booth staff for cloud solutions at the O'Reilly Strata Conference. 

They told an interesting story about their Cloud Foundry offering, so I went to sign up. After getting approved, I had the option to download a vmware image of a cloud foundry instance to run on my laptop to test stuff out. Great! But it's a gigabyte, and I'm on hotel wifi or conference wifi - one is expensive and slow, the other is slow and rude to other participants.

So, I went back to the VMWare booth to ask if they happened to have it on a flash drive or something. One of the booth staff (and I'm sorry I've forgotten your name) not only had it on her macbook and let me copy it over to mine, she also helped me configure it so that I could play with it. The configuration was straightforward and I could have figured it out on my own, but getting tech support on developer tools from a vendor's booth staff (at least, for a non-startup business) is unexpected and way cool.

Thanks, VMWare folks!

Filed under  //   cloudfoundry   strataconf   tech support   vmware   way cool  

Troubles with sharing from Win7 to Mac OS/X

I wanted to back up a bunch of photos from my mac to my win7 machine, some of which were already there, so I shared a drive on the win7 machine, mounted it on the mac, and got ready to fire up rsync(1). After copying over a good chunk of the pictures, the rsync job started throwing io errors.

The mac console indicated the following error message:

kernel: smb_ntstatus_error_to_errno: Couldn't map ntstatus (0xc0000205) to errno returning EIO

At the same time, the Event Viewer on the Windows side showed a bunch of messages stating:

The server was unable to allocate from the system nonpaged pool because the server reached the configured limit for nonpaged pool allocations.

A little bit of googling turned up a posting that offered an answer. In short, there are some registry settings to be edited:

Set the following registry key to ’1′:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\MemoryManagement\LargeSystemCache

and set the following registry key to ’3′:

HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size

So far, no problems!

These are actually old settings, that go back to the NT Workstation/NT Server days. For more info, this is interesting reading.

Filed under  //   file sharing   mac   samba   smb   windows 7  

Mac App Store updates

The Mac App Store says I've got -4 updates. If I hit 'update', it goes to -5. Kinda neat!

Negative_updates

Filed under  //   app store   fun bug   mac   updates  

Why is my win7 box slow?

On my win7 x64 ultimate box, there's what looks like a runaway process named WmiPrvSE.exe. It's eating up all of one core. Digging into the Event Viewer isn't very enlightening - you can turn on logging by checking View->Show Analytic and Debug Logs in the menu bar, and then going to Applications and Services Logs\Microsoft\Windows\WMI-Activity\Trace. Microsoft provides more detailed information about turning on this logging.

There's a lot of activity in there, well over 150 operations in the 5 seconds of the first page of the log. None of it appears to be particularly relevant.

However, a lot of the traffic to the log appears to originate from a specific and relatively low process id - which turns out to be svchost.exe. No joy there - svchost.exe could be doing anything, and this particular instance of svchost doesn't appear to be busy; its CPU utilization is 0%. But in the task manager, we can right-click on that instance of svchost.exe and say 'go to services' to see what services are running inside that task. Maybe that'll be helpful.

It's running all kinds of relatively low-level junk: Themes, Windows Management Instrumentation, Shell Hardware Detection, User Profile Service, Group Policy Client, Computer Browser, Task Scheduler, Server, IP Helper, Application Experience - many of which are important and can't be turned off.

After some trial and error in the Services app looking for stuff that I don't need, I turn off Windows Live Family Safety Service. After about 15 seconds, WmiPrvSE.exe settles down and my machine CPU usage goes to 0%. I turn in back on, and WmiPrvSE spikes again.

I don't know what Family Safety is doing, and I'm tempted to turn it off and try a different solution to keep my kids off the nastier parts of teh interwebz. Anyone have any advice?

 

 

 

Filed under  //   slow   windows 7   windows live family safety service   wmiprvse  

Playing with PostGIS

I’m working on some stuff for work that involves integrating spatial data (both vector and raster), census microdata, and census tables. Neat stuff. PostgresSQL and PostGIS look like they’ll be extremely useful but I’ve just gotten started learning. I also had the opportunity to contribute a minor bugfix to PostGIS 2.0. Hopefully it won’t be the last one.

For someone coming from a traditional SQL background, the geometry functions take some getting used to. I’ve spent more time in MySQL than anything else, but I tend to think in the Transact-SQL dialect used by Sybase and MS SQL Server, particularly for join syntax. It’s pleasant that PostgreSQL supports a similar join syntax!

I wrote up some simple queries, to play with the spatial functions and to see if they behave the way I expect. I offer them here with no guarantee of usefulness, just a hope that they might prove to be a good starting point for the next adventurer.

This is using PostGIS 2.0-SVN as checked out from the svn repository on Jan 5th, 2012, but none of these functions should be PostGIS 2.0 specific. Once I start playing with the raster stuff, that may no longer be true.

# PostGIS notes:
create table my_geom (id serial NOT NULL PRIMARY KEY, name varchar(20));

select AddGeometryColumn('public', 'my_geom', 'my_polygons', -1, 'POLYGON', 2);

insert into my_geom(name, my_polygons) values ('square1',
    ST_GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'));

insert into my_geom(name, my_polygons) values ('square2',
        ST_GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))'));

# approximate an approximation of a circle of radius 1, centered at 1,1
insert into my_geom(name, my_polygons) values ('circle1', ST_Buffer(ST_GeomFromText('POINT(1 1)'), 1));

# what did we just insert?
select id, name, ST_AsText(my_polygons) from my_geom g1;

# and are they valid?
select name, ST_IsValid(my_polygons) from my_geom;

# how big are they?
select name, ST_Area(my_polygons), ST_Perimeter(my_polygons) from my_geom;

# do square1 and square2 intersect?
select ST_Intersects(g1.my_polygons, g2.my_polygons)
from my_geom g1, my_geom g2
where g1.name = 'square1' and g2.name = 'square2';

# What's the intersection between the two squares? (should be the same as square1)
select ST_AsText(ST_Intersection(g1.my_polygons, g2.my_polygons))
from my_geom g1, my_geom g2
where g1.name = 'square1' and g2.name = 'square2';

# Is it really the same as square1?
select ST_Equals(g1.my_polygons, ST_Intersection(g1.my_polygons, g2.my_polygons))
from my_geom g1, my_geom g2
where g1.name = 'square1' and g2.name = 'square2';

# What's the symmetric difference?
select ST_AsText(ST_SymDifference(g1.my_polygons, g2.my_polygons))
from my_geom g1, my_geom g2
where g1.name = 'square1' and g2.name = 'square2';

# What is the area of the difference (should be 3)
select ST_Area(ST_SymDifference(g1.my_polygons, g2.my_polygons))
from my_geom g1, my_geom g2
where g1.name = 'square1' and g2.name = 'square2';

# What is the area of the difference between square1 and the other two shapes?
select g2.name, ST_Area(ST_SymDifference(g1.my_polygons, g2.my_polygons))
from my_geom g1, my_geom g2
where g1.name = 'square1' and g2.name != 'square1';


drop table my_geom;

Filed under  //   learning   postgis   postgresql  

Looks like I've officially graduated!

Got a happy email from the U of Mn Graduate School on Jan 4th. They said:

Dear Peter,
Congratulations! You have completed all requirements for your M S degree in Computer Science. Your degree award was awarded 12/30/2011.

Your official transcript will be updated, to show the award of the degree, 2-3 weeks following the award date. Official transcripts may be obtained from the One Stop office.  Your diploma will be mailed to you 4-6 weeks following the award date by the One Stop office.  If you need to change the address to which the diploma will be mailed, you may contact One Stop at 612-624-1111.

Note: Posting of your degree is contingent upon payment of all assessed University fees, fines and bills.  

Congratulations on your accomplishments at the University of Minnesota.  We wish you all the best with your new endeavors.

Thankfully, my student account shows a balance of $0.00. Yay!

I passed my final oral exam for my master's degree!

Hey - grad school? We need to talk. It's been a good run, this relationship, but I think we need to start seeing other people. Or at least, I do. It's not you, really, it's me. I'm through. I'm done. We had some good times, you and me, but now it's time to move on. Thanks. Really - I mean that. Let's stay in touch - you know where to find me.

Filed under  //   grad school   umn  

Overheard at a party last night

Girl: Yeah, I got dumped a couple weeks ago...

Guy: So, what does your dad do?

Girl: He's a cop.

Guy: Well, that's the end of that conversation!