Tag Archives: Script

Running Skyrim in Linux with WINE

A few days ago my cousin asked me to try and get Skyrim running for him on his Linux install using WINE.

I have previously gotten RIFT working on my Linux system flawlessly using WINE.

He gave me an ISO file, (probably from ill-gotten sources), and I proceeded to install from that.

Using winetricks I installed what all the other sites told me to install:

d3dx9_42
vcrun2008
xact

Then I ran the SkyrimLauncher.exe using WINE. Clicking low settings to start works, and then I click play… Nothing happens. Throws a minor error but nothing big. Ok…

So then I run TESV.exe directly, game loads in a virtual desktop as I had it setup, acting as its full screen (and annoyingly keeping my mouse inside the window). I click new game, and it sits at a black screen with gray fog floating from the bottom with the Skyrim symbol in the center of the screen. Hmm.

Well after poking around with some debug, for a few hours, I realized that the game is actually running from the Z: drive per this wine prefixes setting, and that I needed to tell it “Hey your actually running from the C: drive.”.

I looked quickly but could not find out how to force programs to run from C: in a wine config, so I created a simple command file “skyrim.cmd” file like the batch files of olde’ and inside I put the lines:

C:
CD \Program Files\Skyrim
TESV.exe

I saved the file inside my ~/.wine_skyrim/drive_c folder, and then to run the game I ran:

WINEARCH=win32 WINEPREFIX=~/.wine_skyrim wine cmd.exe /c ~/.wine_skyrim/drive_c/skyrim.cmd

Which actually ran my script, running wine at a Windows Command line, and then changed to the ‘fake’ C: drive, changed directories and ran the program.

The game runs, and then I click play. Boom, I am reading the story and it’s all working. I need to start the tweaking stage with the wine registry Direct3D entries but if anyone else has the black screen with fog try doing what I did.

OpenVPN Setup

Started using OpenVPN at the workplace to connect some remote locations to the central one. Had a few issues at first, but it seems to be coming together.

We have to use a bridge connection on the system, so this site helped quite a bit with some of the settings.

http://ressukka.net/blog/posts/20080821_openvpn_tunnel/

Kill all processes not root or daemon

for p in $(ps -ef|tail +2|grep -v root|grep -v daemon|awk '{print $2}'); do
  kill -1 ${p}
done

Drop in a KSH script and run anytime you want to send a kill -1 to all processes that are not owned by root or running under daemon.

Document Processing Source Code

This is the PHP console program service that Anthony and I programmed at work. We got the owner of the company to sign off a release form finally making the code available under the GPL.

Please note that this code will probably not work for you as a drop in place system, it will require tweaking, and lots of setup on your part. Please do not ask me for assistance.

Use this code at your own risk. You will need knowledge of Linux, PHP, Shell Scripts, and some common computer programming knowledge.

Folder structure for this program is as follows:
/tmp – Used for temporary storage of files for FDF merge into interactive PDF.
/usr/local/bin – Storage for all scripts this program uses. (dps.php, forge_fdf.php, file2pdf, pollerctl, dps_poller, hud-process.php)
/usr/local/dpsdocs – Root storage for following folders:
dpsdocs/merged – If save mode is on, saves raw ODT and PDF files in named folders.
dpsdocs/failed – Saves documents that failed to merge for some reason.
dpsdocs/monitor – If user chooses fake printer, will save the PDF here, instead of really printing it. Good for NFS/SMB share.
dpsdocs/templates – Live templates that the system pulls.
dpsdocs/test_templates – Test templates that you can SMB/NFS share for users to add tempaltes and you can sync to live later.
dpsdocs/xml_request – Where all the XML files get dumped to from which ever system you have generating them. Good to NFS/SMB share.

Files used and purpose:
dps.php – Main PHP program, does the merging and OOO operations. Takes in the XML as the first parameter and some others. Open file and view for yourself.
dps_poller – The program that loops continuously looking for newly dumped XML files. XML files that have specific printers are SCP’ed over the network to other servers running program so they build and print locally at that location.
file2pdf – This shell script gets called by dps.php and finishes the job, runs pdftk operations, and reads the sorting.txt file to decide where to print.
hud-process.php – Example PHP file that takes in FDF data and merges with specific PDF files. Called from dps.php.
pollerctl – Service script that makes sure the dps_poller is always running and never died for some reason.
tbs_class.php – TinyButStrong PHP class file, called from tbsooo_class.php.
tbsooo_class.php – TinyButStrong OpenOfficeOrg class file, called from dps.php.
zint – Console program that takes in data and creates a barcode. dps.php calls this, and creates a PDF417 barcode.

Document Processing PHP System

You want more?!

Awhile back, (awhile being a few years now) Anthony and I wrote a document processing system in PHP for the company. It takes in XML data and merges this with OpenOffice documents as templates to create final dynamic merged PDF documents for printing, email, and storage on disk. It has been running ever since, processing a few hundred documents a week.

This system actually replaced another one that did close to the same thing, but required Microsoft Word, licenses for Office, and multiple servers and Windows installations and .NET programming. It was horrible, slow, and unstable. Which lead us to create the new system.

A few days ago I was asked to add another template to the server, which happens a few times a month. But this time the document to be added was a PDF file already, very complex actually. Having multiple form fields and such. I tried to recreate / convert it to OpenOffice but it always comes out ugly. So instead of working around this, I went ahead and added some more code to the program to take in the XML data as usual, and for this one document (or more in the future) to merge FDF data into the PDF.

Searching around where to start, and found a good site: http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.html which gave some very useful information. What I really needed was the php function he offers here: http://www.pdfhacks.com/forge_fdf/. Take a look, it’s kinda neat.

It is in production now, and working very well!

Post Navigation