Apr 24

Anyone threatening death in the name of religion or politics: Go Fuck Yourself!

Tag: PoliticsMichael Lind Mortensen @ 5:24 pm

Support freedom of speech!

The Daily Show With Jon Stewart Mon – Thurs 11p / 10c
South Park Death Threats
www.thedailyshow.com
Daily Show Full Episodes Political Humor Tea Party



Apr 08

I’m back baby!

Tag: JunkMichael Lind Mortensen @ 5:28 pm

Just when you thought you were rid of me I came clawing back :-)

For anyone actually looking at the amount of time between this post and the one before it, you might be thinking: “Where the hell was that guy for like.. a year?”. Well, I have no idea? Busy I guess? Wrote a compiler, took a bunch of courses, started a business.. all sorts of stuff.

But anyway, I’m back now so hopefully I will be taken the time to write something worthwhile within the near future (no this post is not classified as worthwhile ;-P).. oh yeah, and I updated the About the author page.. it was getting kinda outdated! So come back here soon and read+comment on whatever dribble I conjure up.

Until then: take care!

~ Out




Apr 08

Statistical Voyeurism

Tag: JunkMichael Lind Mortensen @ 9:51 am

Hehe – If you’ve just had a couple of statistics courses, this joke just seems a million times funnier:

Statistical Voyeurism




Feb 07

Ayoe Angelica

Tag: StuffMichael Lind Mortensen @ 2:04 am

Ayoe Angelica - I'm AmazedWhen it comes to music I’m mostly a Metal, Jazz and Hard Rock kinda guy, but lately one artist has captivated me in a new and deeper way – This artist is the talented and beautiful Ayoe Angelica.

Truth be told, I actually know Ayoe indirectly through my fiancee Sara Lind, however Ayoe never striked me as a potential world artist until I heard her sing. With a combination of mellow soul and powerful lyrics, Ayoe’s debut-album is a wonderful piece of art that tears up your mind and soul. Not only do I firmly believe Ayoe’s music will appeal to most everyone in some way or another, but I also believe that 5 years from now, such a statement will be so universal that it almost constitutes a given!

This belief was strengthened even further when I accidently turned on Denmark’s DR1 in December and saw Ayoe Angelica as a supporting singer for Ufo & Yepha (for a charity event as far as I know.)

So am I expecting you’re just gonna take my word for it? Of course not!! You can find more information about Ayoe on her own website: http://ayoeangelica.dk/ … Other than that Ayoe also has a MySpace page, a Facebook fan page and a bunch of YouTube videos, one of which is included in the bottom of this post! I hope Ayoe’s music brings you enlightenment as it has me! … That is all!!

Ayoe Angelica – Dr. Jekyll:

Ufo & Yepha feat. Ayoe Angelica (This is in Danish):




Oct 30

Help us get a free dinner at Jensens Bøfhus

Tag: StuffMichael Lind Mortensen @ 9:57 pm

Hello everyone!

Dear friend, visitor or whatever your role might be. Please take the time to help me and my fellow computer science students get a free dinner at the Danish restaurant Jensens Bøfhus.

They basically have a small competition running right now, where you can upload a picture and get voted for – if your picture has the most votes = you win! So please help us and vote for our picture – you would make a bunch of poor students happy ;-)

So, if you would be so kind to click on this link (no viruses – promise!):
http://jensensb.ziteman.com/mms_sider/mms_nyestebilleder.asp?vote=1C4936BC-3DF0-48DA-B464-C11E0AD6D092

It will simply cast a vote for us in the competition. And remeber, you can vote two times! ;-)

Anyways, thanks for the support!! Peace!




Oct 30

Removing X-Powered-By header for mod_rails

Tag: Security,UnixMichael Lind Mortensen @ 4:44 pm

I recently had a bit of a problem with a server running a Ruby on Rails application. I wanted to make sure the server didn’t give out any information about service versions, however mod_rails didn’t give any easy way of doing this within the module itself. I therefore began searching for another way of doing this, and found that an easy solution was to make Apache remove the headers via. the mod_headers module.

So how is it done? Very simple, just enable the module mod_headers and add the snippet below to httpd.conf or another included configuration file in Apache. Both actions have to be done as root of course.

Enable the mod_headers module (This example is Linux Debian – it might be different for your system)

# cd /etc/apache2/mods-available/
# a2enmod headers

Add these lines to httpd.conf

Header always unset "X-Powered-By"
Header always unset "X-Runtime"

Restart the Apache server (Again – this is Debian! It might be different for you)

# apache2ctl restart

And there you go. Try making e.g. a Nikto scan on the server and see if the headers aren’t there anymore.




Oct 19

The Status of the World – Audio version

Tag: PoliticsMichael Lind Mortensen @ 12:54 am

Hello everyone,

I thought I would try something new today. I just bought a microphone a few months ago and haven’t really attempted to get it tested yet, so I guess it was about time. For this reason I’ve recorded a small message to the world, summing up the status of the world.. Enjoy!

The Status of the World




Sep 28

Simple backup script with notification

Tag: UnixMichael Lind Mortensen @ 2:07 am

So I recently had to come up with a simple backup solution that didn’t involve any fancy system and basically just gave one the opportunity to choose what directories to backup, where to back them up and notify if something goes wrong.

So I came up with a solution which, in my own view, could be better and more “clean”, however this is how it is right now. You’re welcome to take the script, change and redistribute it – it’s released under the BSD license.

You might notice it’s refering to a bunch of files – these files are the error messages sent in e-mails and need to be placed somewhere, with corresponding changes in the script. If they don’t, e-mail notification won’t work.

Right now it’s sending e-mails when it’s succesful in making a backup. Depending on how often you want your cron job to do a backup, it might be irritating to get that many e-mails, so all you need to do is basically just remove the last part so that it only notifies you if something goes wrong.. That will however create the possibility that the e-mail functionality of the server will stop working and you won’t notice.

But yeah.. Here’s the script + all the error-messages zipped for download: backup_script

I’ll be the first to admit it’s not optimal in any way.. it’s a quick solution and has a bunch of DRY (Don’t Repeat Yourself) violations… but hey.. it works and given it’s low complexity I don’t wanna prioritize cleaning it up that much – but you are more than welcome to do so!

Here’s the code copied into the post:

#!/bin/bash
# Copyright (c) 2008, Michael Lind Mortensen
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of Michael Lind Mortensen nor the
#       names of his contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY MICHAEL LIND MORTENSEN ''AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL MICHAEL LIND MORTENSEN BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
# Define settings
DATA="/home/user1 /home/user2 /etc /var/www/virtual /var/log" #Location of backup files.
DISC="/mnt/backup" # Mount location of backup disc
DEVICE="/dev/sdb1" # Backup devicename
MAILREC="info@example.com" # Define message recipients. Comma-separate for more recipients.
SENDER="noreply@example.com" # Define sender e-mail for error-messaging.
LOG="logfile.txt" # Location of the error logfile
DBPASS="databasepassword" # The root password to the mysql server
 
set $(date)
 
#####################################################
#  Define email functionality for error messaging   #
#                                                   #
# Parameters: MESSAGE - E-mail content from file    #
#                                                   #
#####################################################
function error_mailer {
        MESSAGE=$1
        SUBJECT="Backup process encountered errors!"
        # Send the email using mail
    if mail -s "$SUBJECT" -r "$SENDER"  "$MAILREC" < $MESSAGE
    then
        :
    else
        echo "$3-$2-$6-$4 - ERROR: Mail functionality not working!" >> $LOG
    fi
}
 
#####################################################
#  Define email functionality for success messaging #
#                                                   #
# Parameters: MESSAGE - E-mail content from file    #
#                                                   #
#####################################################
function success_mailer {
        MESSAGE=$1
        SUBJECT="Backup created succesfully!"
        # Send the email using mail
        if mail -s "$SUBJECT" -r "$SENDER" "$MAILREC" < $MESSAGE
        then
                :
        else
                echo "$3-$2-$6-$4 - ERROR: Mail functionality not working!" >> $LOG
        fi
} 
 
# Mount backup disc
if mount $DEVICE $DISC
then
        :
else
        echo "$3-$2-$6-$4 - ERROR: error while mounting disc!" >> $LOG
    error_mailer "/etc/backup_inc/errors/mount_error.txt"
fi
 
# Perform daily full backup
if tar cfz "$DISC/data/data_$3-$2-$6.tgz" $DATA
then
        echo "Data saved successfully!"
else
        echo "$3-$2-$6-$4 - ERROR: error while saving data!" >> $LOG
    error_mailer "/etc/backup_inc/errors/data_error.txt"
fi
 
# Create SQL dumps of databases
if mysqldump -u root --password=$DBPASS --all-databases > "$DISC/database/db_$3-$2-$6.sql"
then
        :
else
        echo "$3-$2-$6-$4 - ERROR: error while making mysqldump!" >> $LOG
    error_mailer "/etc/backup_inc/errors/mysqldump_error.txt"
fi
 
if gzip "$DISC/database/db_$3-$2-$6.sql"
then
        echo "MySQL databases saved and compressed succesfully!"
else
        echo "$3-$2-$6-$4 - ERROR: error while saving mysql databases!" >> $LOG
    error_mailer "/etc/backup_inc/errors/db_error.txt"
fi
 
# Unmount backup disc
if umount $DISC
then
        success_mailer "/etc/backup_inc/success.txt"
else
        echo "$3-$2-$6-$4 - ERROR: error while unmounting disc!" >> $LOG
        error_mailer "/etc/backup_inc/error/umount_error.txt"
fi

The fast person will probably notice that WordPress writes < and > as &lt; and &gt; .. that’s just the code plugin messing things up and I hope you can figure out how to fix that yourselves.. if not, the zipfile has the code without any odd layout errors.

All in all the code should be fairly self-explanatory.. if not, there are plenty of comments to help you use the script or change it to whatever you need.

Last but not least – Remember to add a cron job with the script.. If you don’t there won’t be much automatic backup about it.

That’s just about it.. Enjoy!




Sep 11

Energy saving hype

Tag: DebunkingMichael Lind Mortensen @ 9:17 am

I saw a new TV-add from “Elsparefonden” this morning. As many before it, it tried to get people to think about how much power they consumed and thereby consume less to save the environment. Before I go on, you can watch the add here from YouTube:

So what’s my problem with this? Well, basically it’s just plain bullshit! Sure, power consumption will fire up energy production demands and thereby harm the environment because the energy production harms the environment. However the only reason why energy production harms the environment is because of low-quality materials like coal! Why the hell try to get people to go back in technological development by using less power, instead of just making our energy production more effective and clean (which would probably also be cheaper than all does damn adds all the time).

But apparently the global warming hype has become almost a religion, with fanatics fighting to jump back in time on a lot of fronts like electronics, food, industrial production etc. For some reason they believe the world population was better off with the status we had 50 years ago! Like for example a Linux guy I heard at FOSDEM 08, whom claimed that the German government should not use Windows Vista and instead use Linux – what was his reason? Vista uses more power and Microsoft was therefore fighting to destroy the environment…. Now, there are many valid arguments for using Linux instead of Vista, however saving the environment is definitely not one of them! It really pisses me off a lot of organizations are using this global warming frenzy to push their agendas, just by coating it with some environmental bullshit.

So – My conclusion? Shift all energy production to wind power and nuclear power – and stop irritating us with demands of lower power consumption. The only real reason to consume less power is saving money – power is expensive and will probably keep on getting more expensive for a long while, so if one can develop machines that consume less power, these machines will obviously be cheaper – this however has nothing to do with saving the environment.




Sep 09

Funny Christian music

Tag: JunkMichael Lind Mortensen @ 7:10 pm

This is probably the funniest Christian music I have ever heard.. Very very odd!




Next Page »