Moblock traffic blocker

Moblock (moblock-deb) is a so called traffic blocker. It prevents connections from certain IP numbers (defined in block lists) to gain access to your computer. The whole purpose is that the blocked IP numbers usually belongs to this or that organization that wishes to find out more about your Internet habits and other information they have no reason to get their noses into.

Moblock has a big brother called Peerguardian by Phoenixlabs but development on this program seems to have been discontinued, and unfortunately at a stage where the program doesn’t work (at least for me it doesn’t). I am also sure there are some Windows variants of an IP-blocker (I’m guessing Bluetack is the right place to go).

Installing Moblock on Ubuntu turns out to be a very simple affair. Mainly do two things: Add moblock’s repository to your repository list, and run an apt-get command. (Here’s an even better instruction for installing Moblock on Ubuntu).

The installation takes care of setting up cron-jobs to update your block lists every day, installs moblock as a service started every time the machine is started, and makes the first download, after which the program (or in fact, demon) is started and you are safe.

The above link is a very good instruction on installing moblock, and it even have instructions on how to perform some simple troubleshooting.

If you run linux I suggest you take a look at moblock’s home page, or you can check out it’s project page on sourceforge.

BasKet Note Pads – note-taking application

BasKet is a very nice application I just stumbled across. It is a kind of OneNote for Linux.  In Ubuntu (probably Debian and others as well) it can be managed as a regular package.

I’m using it mostly when writing and ordering ideas and the like, but I can see myself doing much more with it…. once I’ve made sure it’s stable enough. Let me get back on that with a more proper review later.

The Selfish Gene

Richard Dawkins discusses in his book “The Selfish Gene” if we are using our genes to propagate ourselves, or if maybe our genes are using us to propagate themselves.

According to Dawkins life may very well have begun a long time ago, in the primordial soup, when simple clumps of amino-acids became self-replicating. This self-replication started a kind of war between competing replicators and who was on top (or in the majority) in the soup probably changed many times until one kind of replicators using a protective layer of matter came out the winner (one cell organisms).

Continue reading The Selfish Gene

How to add a body on load function with Javascript

This is an article on how to add a javascript function that will be run when a web page has loaded. We begin by defining a function for running after a page (or actually window) has been loaded:

function bodyOnLoad() {
  ..
  ..
}

And then we’ll do:

window.onload = bodyOnLoad;

However, we also want to make sure our setting of the load event doesn’t remove some other setting. This is done by also keeping any older events.

We store the previous on load event by doing;

var prevOnLoad = window.onload;

And we redefine our bodyOnLoad function:

function bodyOnLoad() {
  prevOnLoad();
  ..
  ..
}

However, we can make the creation of the function and the setting of the event a little bit more effective by doing:

window.onload = function() {
  prevOnLoad();

  ..
  ..
}

You still need to get prevOnLoad before you do that

This becomes even more obvious once we create a function for adding new load events:

function addLoadEvent(func) {
  var prevOnLoad = window.onload;
  window.onload = function() {
    prevOnLoad();
    func();
  }
}

In this way, we can concentrate on creating the new load event outside of the function for adding it to the window.onload.

function myEvent(){
  ..
  ..
}
addLoadEvent(myEvent);

We might even do:

addLoadEvent(
  function (){
    ..
    ..
  }
);

Notice the difference between curly braces “{}” and parenthesis “()”

Finally, we have to make sure there is a load event set for the window before calling it from the new event, so we need to check for this:

function addLoadEvent(func) {
  var prevOnLoad = window.onload;
  if (typeof prevOnLoad != 'function') {
    window.onload = func;
  }
  else {
    window.onload = function() {
      prevOnLoad();
      func();
    }
  }
}

Programming humor

In case you wondered. Sure, programming can be humorous, but this is more about looking at programming with humor. Or, well, I’ve found a few funny things I’d like to share… XML is like violence: if it doesn’t solve your problem, you’re not using enough of it.

People who make buttumptions about their censoring settings, will be embarbutted when they repeat this clbuttic mistake.

Review: Paycheck – Let the future be untold (4/5)

Paycheck (IMDB, Amazon) is a story about Michael Jennings (Ben Affleck) who is an engineer, or to be more precise a reverse engineer. Michael is paid to take competitor’s work and reverse engineer it into something his employees can make into a products of their own.

Since it would be very bad if information about whose technology was reverse engineered into what, Michael’s assistant Shorty (Paul Giamatti) helps removing all of Michael’s memories of the project once work is finished.

A once in a lifetime opportunity comes along as Michael’s old friend Rethrick (Aaron Eckhart) offers him work that will give him stocks in Rethrick’s promised-to-become-great company. Michael takes on the three year project, even if he risks losing his memory for the whole period, and that of a probably blooming romance with one of Rethrick’s employees, doctor in biochemistry, Rachel Porter (Uma Thurman).

Three years passes, Michael finds himself back where he once begun, in Rethrick’s office, his memory wiped and all that stands between him and his millions, a trip to the bank.

That is however, when problem starts, because Michael finds not only has he switched the personal effects he once had to leave before entering Rethrick’s employee, he has also forfeited a 100 million dollars worth of stocks in Rethrick’s company.

Why did Michael say no to the money and, of significantly less importance, what became of his personal effects? Michael soon realizes his former employees and the FBI are out to get him, and his bag of assorted effects seems to be the only thing that keeps him ahead of the game. A game, that if lost, could cost him his life…

You can read the whole review by clicking the below link, but there may be spoilers in that text…

Continue reading Review: Paycheck – Let the future be untold (4/5)

Programming booleans

When looking at other programmer’s code I’m sometimes surprised with things like this:

exportDocumentView(java.lang.String absPath, java.io.OutputStream out,
boolean skipBinary, boolean noRecurse)

And in such prominent frameworks as Java Content Repository as well.

What’s my problem then? Double negations. In order to do exportDocumentView and get binary data and recursive export you’ll need to do:

exportDocumentView(“/path/to/my/Node/”, System.out, false, false)

Sure I can handle it… but… false to opt something in? I find it rather fishy. Call me an idiot but my brain just don’t deal with that kind of stuff easily…

What I would have wanted instead was:

exportDocumentView(java.lang.String absPath, java.io.OutputStream out,
boolean includeBinary, boolean recursive)

Which would have been called like:

exportDocumentView(“/path/to/my/Node/”, System.out, true, true)

For when we want binary data and recursive export, and like this for the case when we don’t want either or both:

exportDocumentView(“/path/to/my/Node/”, System.out, false, true)
exportDocumentView(“/path/to/my/Node/”, System.out, true, false)
exportDocumentView(“/path/to/my/Node/”, System.out, false, false)

I’m just saying. In my world false means “no” and “no” means don’t give me something or don’t do something:

“Don’t return binary data.”
“Don’t recurse the tree of nodes.”

To be compared with:

“Don’t skip binary data.”
“Don’t do no recursing.”

(But you’re free to curse? :o)

He heard her own gasp of astonishment

I just read the following sentence:

“He heard her own gasp of astonishment”

Some words just don’t work well with things no one else can do for you, I mean…

I entered the room and guess if I was surprised. My neighbor gasped with my astonishment, and as he had one of my thoughts, he came over to my own apartment to have a talk with me. He told me, with his wife’s voice, he disliked all but his own ideas. I had one of his ideas and in a contrary to his position, decided I liked it, so I made it my own idea.

It could get pretty interesting after a while of that. Perhaps the next pop-style of writing…?

Review: Ultraviolet – Xenophobia (3/5)

Ultraviolet (IMDB, Amazon) is a story about Violet, an ordinary woman whose life changed when she was infected by a virus that turned her into a feared and hated hemophage.

Once contracting hemophagia, Violet was incarcerated and experimented on, and perhaps these experiments cost her the child she was bearing when infected, perhaps the infection itself did, regardless, Violet escaped and now she is out to steal the government’s latest and most deadly weapon in the fight against hemophages.

The hemophages have superhuman strength and speed, but at a cost; few live longer than a decade. Since the virus that causes hemophagism infect on blood contact, the number of hemophages should have grown had it not been for the government’s prosecution.

Like vampires the hemophages have pointy eyeteeth, but unlike the vampires they do not require sucking blood and taking lives to survive. They are far from demons, and rather unfortunates infected by a deadly and infectious disease, and the only demon thing about them is the demonizing of them done by the government.

You can read the whole review by clicking the below link, but there may be spoilers in that text…

Continue reading Review: Ultraviolet – Xenophobia (3/5)

%d bloggers like this: