Friday, June 8, 2012

Getting Continuum .40 to work under Fedora 16 without messing with your global wine installation

I have played subspace (now called continuum) on and off for decades. Its a fun little game and I've always been addicted to Trench Wars :)

If you goto the, you'll see that they specifically have a Linux solution available. It is clunky and to be honest, quite limiting. I've managed to get Continuum to work without issue AND without messing with my global wine installation :)

Here's how I managed to do it.

get the .40 install here. and install it using your default global wine installation. (apt-get install wine   or yum install wine  or w/e your linux method is). It should install without issue.

Using git, Now clone the wine source tree somewhere. To do this, do a  git clone

Then checkout the latest stable branch (at the time of this post, was 1.4.0) by doing this,  git checkout wine-1.4

At this point you need to do either one of two things, either manually add the next specific piece by hand (its really simple and only 1 line to add) or apply a patch. I did it by hand because its literally one line and the patch 'given' at winehq doesn't work out of the box (its setup with the incorrect paths) for any version except the one it was made off of. The patch i'm referring to is located here.

The specific text to be added is

if (access & PROCESS_VM_WRITE) return NULL; 

In the dlls/kernel32/process.c file in the OpenProcess function. You can also just apply this following patch (modified from the above original source so that it will work with anything so long as it is applied while in the root wine source directory)

--- dlls/kernel32/process.c
+++ dlls/kernel32/process.c
@@ -2881,6 +2881,9 @@ HANDLE WINAPI OpenProcess( DWORD access, BOOL inherit, DWORD id )
     CLIENT_ID           cid;
+    /*This fixes continuum, but seems to break nothing */
+    if (access & PROCESS_VM_WRITE) return NULL; 
     cid.UniqueProcess = ULongToHandle(id);
     cid.UniqueThread = 0; /* FIXME ? */ 

Now that the specific 'bug' is patched, we need to ./configure, make depends, make, make install. But I did one thing so that it wouldn't mess up my global install AS well as not need sudo functionality... I set a `--prefix=/path/to/ending/location` option with my ./configure. This will setup the makefiles to now 'overwrite' (if you had the permissions to) the global standard location for wine and build it in a location that you choose.

After your make install is finished, you will see a whole bunch of things in that /path/to/ending/location including a `bin` folder. To run Continuum, you need to start the 'wineserver' in that bin directory (kill any other ones). I started it with the `-p` option and haven't had any issues. Then using the `wine` in that directory, run Continuum.exe (like so)

./path/to/ending/location/bin/wine ~/.wine/drive_c/Program\ Files/Continuum/Continuum.exe

Works like a charm and I still have my global wine installation setup and running smooth with my other 'wine' installs. Now its at the latest version of wine (should probably fix up the winehq page to say it still works with the current version and should work with newer versions as well...)

If people have specific questions, let me know and I'll try help :) Not that this will ever be read by anyone :P

Friday, June 10, 2011

"Failed to connect to EA Online" BFBC2 Solution Xbox360

I've been playing Battlefield Bad Company 2 (BFBC2) a lot lately (possibly .5-1 hr a night right before bed while my wife is getting her early hours in). Wednesday and Yesterday, I was unable to play due to an 'error' I was receiving while trying to play some multiplayer. Everything would be okay until I hit Quick Play. It would bring up a screen that says "Connecting" then goto a screen that said "Failed to connect to EA Online".

I searched all over the forums for both EA Online and Xbox and really came up with nothing. There were a few posts about opening ports through your router and the such, but to make sure that wasn't the issue (as I was playing forever without issues earlier) I directly hooked up my xbox to my modem and still nothing (yes... i configured my xbox properly after connecting it to the modem).

At this point (being the engineer that I am), I knew it had to be either a corrupt download or user profile. I went to my xbox file management and deleted my 'user profile' for BFBC2. Now... this will get rid of your saved games... but as I only play multi-player, I didn't care.

After deleting the user profile, BFBC2 joined in a heartbeat!

If anyone needs more specific details (like exactly click here, and the such), let me know and I'll add them, but for most this should be enough!.

Hope this helps someone else besides me :)

Saturday, January 22, 2011

3d Printer?

So I'm come across an interesting site.

It is an open source community that is dedicated to building 'self-replicating machines'. Essentially, create a 3d printer with parts that can be created by that 3d printer to in effect be able to replicate itself. This will give the ordinary person a 'factory' in their own household (using thermoplastic extrusion) that they can then make another 'factory'. This can be exponentially branched out which will let more people have a factory and keep everything cost efficient.

Looking at the information, the 'hardest' part of this project is essentially the extruder part. What it does is take a spool of 'PLA' plastic (thermoplastic), heat it up and spread it layer by layer according to a design to make something. Looking at the videos on the site makes everything look amazing. Especially since a lot of their videos show them making the parts for the next 3d printer and some of those parts are complex.

I intend to create my own reprap. It will be made using wood (or even 'Cheese Plastic"), threaded metal rods, stepper motors and an arduino (for the computer interface). It will have a cmd line front end that will allow you to choose a folder of images (so even people without 3d designing software can create items).

We will have to see what happens.
It could just be another one of my 'wishes' but if things work out, could be really cool.

Monday, January 17, 2011

Things are not always what they seem...

It seems like everything is getting to the point of being 'news worthy'...

Since when are tips to remove information from a social networking website considered 'news'???

Is there really nothing else to report on?

Sunday, November 1, 2009

Creating PDFS from virtually anything w/ linux

So recently I was asked (by my wife) if I would be able to join different web pages together all into 1 file for printing and storage. I thought it would take a very long time but turned out to be quite easy. Here's a lil how to:

  • Print each page/image/document to file (i usually name it an autoincrementing filename aka  1,2,3,4,...)
    • this stores the page as a PostScript file (even works in Windows) 
  • Join all of the PS files together to form a huge PS file
    • you do this using the ps-utility     psmerge
      • psmerge -oOutputFileName file1 file2 file3
        • you can include as many files as you want in order
        • there is NO space between the -o option and the file name
  • turn the PS file into a PDF file
    • use the ps2pdf utility 
      • ps2pdf pdffile.pdf
 This seems pretty straight forward but can be quite tedious if you have MANY MANY files to do at once.

Below is a python code that will make this process easier. It renames files (so they can be sorted properly) and generates the command (quite large at times) to perform the operation

import os
files = os.listdir(path)
##rename = True
rename = False
if rename:
    for i in files:
        name = i
        if len(name) < 3:
            name = '00%s' % name
        if len(name) > 3:
            name = name[1:]
        print name
        command = 'cp %s/%s %s/renamed/%s' % (path,i,path,name)
#print files
merge = True
##merge = False
if merge:
        com = 'psmerge -oCombined'
        #print com
        for i in files:
            com = ' %s %s' % (com,i)
        print com

 its simple and quite crude but it gets the job done quite nicely!!
give it a shot and you'll be storing stuff as PDFs in no time!