Neptune’s Pride Battle Calculator v0.3

I’ve upgraded the calculator a little, tinkered a bit with the design with a new header and some minor tweaks for better appearance, and managed to get the javascript to run in IE as well, thanks to a little help from saiboten.

What went wrong was as simple as using type=”text/javascript” for javascripts in stead of type=”application/javascript”. gah.

As allways, feedback is appreciated!

the new version is located here.

The old versions can still be found here if anything stops working for you:

version 0.1

version 0.2

Posted in JavaScript, web | Tagged , , | 9 Comments

Neptune’s Pride Battle Calculator

I got introduced to Neptune’s Pride a little while ago by a friend… It is a simple 4X game, with small games for 8 players in each in the free ones.

The game uses some simple math to calculate the outcome of battles, and since I am lazy I got tired of doing that math and started working on a battle calculator.

This is my first attempt on php, and it is a work in progress… so feedback is appreciated.

Try it out here: Neptune’s Pride Battle Calculator

UPDATE:

I have ditched php, and gone for javascript in v0.2 of the calculator… Now the workflow is more streamlined since you don’t have to go between different pages to get to results.  Seems to be some css-problems though. And javascript issues with IE. Working on it.

…And apparently IE doesn’t care about height / min-height unless you add an !important to it.

the old version can still be found here

Posted in JavaScript, web | Tagged , , , | 11 Comments

Safari 4 Top Sites messes with your Google Analytics

I noticed some strange results in my google analytics account recently, getting a very high bounce rate from visits, and since this is a very small blog about very geeky stuff, a fairly high increase in traffic.

After some tweaking around in analytics it turned out that most of the new bouncing traffic came from Safari, from a machine with the same screen resolution as mine, from my city, my broad band provider and so on.

It turns out that this is because my blog had appeared on Safaris “Top Sites”, a grid of often visited web pages on the welcome screen of Safari. And every time you open safari, it contacts the webpage for an updated snapshot of the page.  This is recorded by analytics and regarded as a bounce visit, decreasing your average time on site and increasing your bounce rate.

So far, it doesn’t seem like there is any other solution to this except removing the site from “Top Sites”, until Google or Apple figure something out.  This of course does not solve the, for me not yet existing, problem of bogus traffic from other Safari users.

Posted in IT | Tagged , , | Leave a comment

Making international characters searchable in LaTeX documents

By default LaTeX generates some international characters in a weird way when building a PDF and so on. For example, the norwegian Å will be represented as ˚A, and thus making any word containing the letter impossible to find when searching for it. This can be solved by using the package fontenc, with the parameter T1 like this:

\usepackage[T1]{fontenc}

Now everything (at least for norwegian documents) should be working as expected.

Posted in LaTeX, Programming | Tagged , , | Leave a comment

Too Geeky….

Found on a bathroom door at “Høyteknologisenteret i Bergen”…

doer_soap

post_it_soap

word on the street has it Saiboten may in fact be geeky enough to have accomplished this feat

Posted in Humor | Tagged , | 1 Comment

Useful BASH-command: !!

When ever you use the terminal in Linux or OS X, and forget to add sudo in front of a command that needs the privileges, you can simply type sudo !! to run the same command with sudo. awesome. “!!” Will repeat the last issued command, and can probably be used for other useful things, too.

Thanks, Peder 2.

Posted in Programming | Tagged , | 2 Comments

Citing / displaying source code in LaTeX

I am writing my master thesis using LaTeX, a typesetting system most commonly used for scientific documents.  Since my thesis is in computer science, I have the need to display a fair amount of code.  After searching around the net and with some trial and error, I have come up with some settings that does this in a nice way.

It is based on the listings package, we define a lstset that handles the code.  This in combination with a nice caption makes for a nice presentation of source code.

Here is the final result:

LaTeX Source Code Screenshot

LaTeX Source Code Screenshot

“Read more” for the rest of the article

Read More »

Posted in LaTeX, Programming | Tagged , , , | Leave a comment

Hiding the Tab-bar in Thunderbird 3

In the new Thunderbird 3, Mozilla included tabbed browsing.  Since you usually don’t have tabs open all the time, it would be nice to be able to hide the tab-bar when no tabs are open.  There is a hidden option to accomplish this.  Thanks to Truben for pointing this out!

Read his article at http://truben.no/journal/auto-hide-tab-bar-in-mozilla-thunderbird-3/

Posted in IT | Tagged , | Leave a comment

Installing Wireshark on Mac OS X 10.6 Snow Leopard

After upgrading to Snow Leopard, one of the few things that stopped working for me was

Wireshark

Wireshark

Wireshark, a really cool network analyzer I’m planning to write more about later. What happened was that at startup you get a long list of error messages, and then no network interfaces could be found.

Luckily, Michael Gracie has scavenged the net for a solution, and found it.

Basically, all you need to do is follow the normal instructions, Dragging the app to the Application folder, the ChmodBPF folder in utilities to the StartupItems alias and the contents of the commandLine folder to /usr/local/bin.

Open a terminal and type:

cd /Library/StartupItems
sudo chown -R root:wheel ChmodBPF

enter your password and hit enter.

Now start up Wireshark, close the list of error messages, hit edit -> preferences -> name resolution, click the edit button next to “SMI (MIB and PIB paths)”, click “new” and type /usr/share/snmp/mibs/ in the text field.  Now click apply / OK, all your way out, exit, and reboot your computer.

After the reboot, everything should be working like a charm.

Posted in IT, Security | Tagged , , | 1 Comment

Learning web-security through penetration testing

At the ROOTS 2009 conference I attended a workshop with Martin Knobloch called

OWASP

OWASP

“Application Security – Awareness.”  Martin works for OWASP, The Open Web Application Security Project, and they have created a lot of cool stuff.  On the workshop we got an introduction to WebScarab and WebGoat, and for learning how a lot of software vulnerabilities work, they are great tools, and fun to play with.

WebScarab is a tool to analyze HTTP and HTTPS communication, and intercepts traffic as a proxy between your browser and the application you are analyzing, and let you look at and modify requests. WebScarab itself is not a training tool, but is supposed to be used for serious application analysis.

WebGoat is a Java web application hosted on a local tomcat server, which contains a lot of flaws and vulnerabilities. The application consists of a series of challenges, in which you use WebScarab to crack your way into the application.

The challenges range from very simple stuff like scanning through source code to look for hardcoded passwords, to more interesting things like Cross Site Scripting and SQL-injection for stealing credit card numbers.

Both tools can be downloaded for free from the OWASP download page, and since it is written in Java, it works on all platforms.

Just be sure to disconnect from the internet before starting WebGoat, since it opens up your computer to all the vulnerabilities it contains while it is running.

Posted in IT, Security | Tagged , , | Leave a comment