zeyus

 
it lost some power

UPDATE (8 February 2012): Took it in again last night, the manager came out and spoke to us he was nice anyway they fixed it on the spot, replaced the display and the motherboard (again?) now my laptop is all working and correct etc. I’m glad to have it resolved, but this has really jaded my view of apple.

UPDATE (6 February 2012): After taking my stupid macbook in again to get it fixed after the part arrived. Again they assured me it would be same day or MAX next day service. But no, I took it in Saturday after lunch (I had to have a stupid “date” to do it of course) then I could finally pick it back up again on Tuesday night!!!!!!! WTF Apple????

Want to know what’s even worse??????? Over the weekend I tried to use my built-in camera. Guess what doesn’t work???? That’s right I have to go back AGAIN on Tuesday for another “date” with their “idiot bar” and see how much more time I get to waste traveling to and from the Apple store and if it takes another couple years to fix the damn thing!!!!

 

UPDATE (24 January 2012): I spent about half an hour yesterday in the Apple store. The staff were very friendly but unfortunately, I didn’t get offered anything, no new macbook, not even a replacement while they fix it the next time, not a single tiny bit of compensation for hours of traveling to and from the store (and more to come). I specifically asked them about all this and they said they can’t do anything, hell, even a upgrade to a solid state drive would be something (and awesome). The best they can do is promise me it will be a quicker repair this time, instead of 3 weeks it will take maybe 1 day. That’s better, but not so great. I’ll still be without my laptop for work for that 1 day and I’ve wasted so much time and a bunch of cash on metro trips to and from the store. I’m awaiting their call to say the replacement motherboard is in so I can take my laptop in AGAIN then wait a day and hopefully they’ve fixed it so I can go to the store AGAIN and pick it up finally how it should be. Let’s see! I’m definitely not happy with Apple, AppleCare, Apple Store and their service.

So my laptop started playing up, the keyboard wasn’t working great and for some reason the SD card slot only worked intermittently so if I wanted to get some photos I’d usually end up finding a USB card reader after getting frustrated. You don’t expect this from a top of the line macbook pro, mine is fully upgraded, and I have AppleCare

OK Next step, I call the Apple store in Barcelona (which by the way is nowhere near the center of the city), and they give me a date that I can go and talk with them. My wife and I hopped on the train on the Friday afternoon we both had off from work and spend the 50 minutes or so it took us to get to the Apple store.

We informed one of the staff that we were here and they indicated we should wait on the bench until it was our turn, no problems because we were a little early. Finally we get to speak with a genius, a little later than expected but not too bad, especially considering how busy the place was.

Our guy was friendly and helpful and told us that they would replace the motherboard, the top case and the keyboard. Great, I was really happy with that, and he said it would take about 3 days to get the parts in plus 10 days to repair it…well OK, I use my laptop for my work but I thought I could borrow my wife’s for a week or so. IMPORTANT: I noticed on the guy’s screen that the parts he was ordering said motherboard 2.66 GHz, we mentioned this to him and said that I had the 2.8 GHz version, but he said not to worry because they’re all the same.

Well after 2 weeks we called them and they said still no word. Then a few days later I called again and they said well maybe tomorrow or the next day. OK fine, I checked on the web at almost 3 weeks after we took it in and it said I could go pick it up. So off I go, on the train in my lunch break, spending another half hour to get there. I go into the store and the guy, who was friendly said that it’s not actually ready because they ran some tests and it failed, and they might have to change the motherboard again. He said he was working on it right at that moment and if I could wait around it should be less than an hour. So I did, and it was a little over an hour. A little frustrating, but whatever, I had my laptop back finally! I signed for it and they handed it to me and I went on my way.

Oops:

What happened?? I turned it on and logged in, and checked out the system information just to see if anything had changed (serial number, or anything else to keep track of it). Lo and behold, my laptop’s CPU had been changed to the 2.66 GHz model.

I called the store again and they said that they can’t do anything until I book another date, which I begrudgingly did.

Now I have to wait till Monday to see if they can do something, and hopefully not leave me without my work laptop for another 3 weeks, and maybe if I can get some compensation, this has wasted a lot of time!

I’ll update this post when I find out more. Ugh!

 

Random post, not useful or informative, but it’s a hamster!

Source

 
dead_iphone

So, I had my Sony Ericsson K800I for about 5 years, and it served me well, then I had a Samsung Omnia HD (i8910) which was OK but the OS was useless (Symbian is terrible!!)

Unfortunately my Samsung got stolen, and then I was back to my SE K800i, until a colleague sold me their iPhone 3GS for cheap, and when I got it the loudspeaker wasn’t working, I paid a local phone shop 15€ and they fixed the loudspeakers so I could hear the phone ringing again.

Great, but then the vibrate stopped working and not long after the 3G service stopped and then I hardly got network service anywhere! It’s really frustrating having a smartphone but not being able to use any of it’s network features, (not even mail). I did play with installing iOS5 and all that, which was much better to use and had some cool features, but of course it didn’t fix the hardware problems with the phone.

After 4 months of having a phone like this finally I dropped it accidentally from a relatively low height (about half a meter) and bang, here we are again. back now to my K800i, ugh, this sucks.

My wife is using the 3g (not 3gs) which my boss nicely gave me but it’s so so so so slow, even using google maps!

 

Practicing

 

but all the guys at work were doing it…

Working Hard

 

We just created a setup at work with a staging server and a whole bunch of web servers behind load balancers.

Now all of these are exactly the same but changing config or restarting services or things like that that have to be done on all of them can be a pain in the ass.

So here’s a little script I slapped together, this is a first revision and a bit of a mess, but I’m pleased with how it turned out and how useful it is!

Feel free to use it and change it as you please, if you like it or have any suggestions let me know!

Basically it’s as easy as changing the SERVERS to all your backend server IPs and the paths to the web directories/programs

For this script you’ll also need ssh scp and rsync. For best results make sure you add your staging/push server’s public key to the .ssh/authorized_keys for the user you’ll use to connect to them, and add them all to .ssh/known_hosts on the staging/push server. (maybe there’s even a way of adding an install function to this script, in which you generate a keypair if it doesn’t exist, connect once to each server with the password, it installs itself into authorized_keys etc…a thought)


#!/bin/sh

SERVERS=( "127.0.0.1" "127.0.0.2" "127.0.0.3" )

vflag=off
SERVER=off
copyconf=off
copylive=off
copytest=off
copyxml=off
oneoption=off
yesmode=off
nodel=off
execute=off
xcommand=
singlefile=off
recursive=off
filepush=
question=

usage()
{
        echo
        echo "usage: $1 [-v] [-y] [-c|-l|-t|-x] [-a] [[-r] -f file] [-e cmd] [-s server]"
        echo
        echo "    -v          verbose mode"
        echo "    -y          yes mode (non-interactive)"
        echo "    -n          no rsync delete"
        echo "    -c          copy httpd configuration files"
        echo "    -l          copy live web directory"
        echo "    -t          copy test web directory"
        echo "    -x          (temp) XML Rss feeds dir"
        echo "    -a          same as -clt"
    echo "    -r          recursive, only applies to -f option"
    echo "    -f file     push file to remote server (IMPORTANT: It will push the file to the same directory on the dest server)"
    echo "    -e cmd      execute cmd on remote server"
        echo "    -s server   process only server at IP address specified (must already have keypair setup)"
        echo
        exit 1

}

while getopts vyncltxarf:e:s: opt
do
    case "$opt" in
      v)  vflag=on;;
      y)  yesmode=on;;
      n)  nodel=on;;
      c)  copyconf=on question="$question [configuration]" oneoption=on;;
      l)  copylive=on question="$question [live]" oneoption=on;;
      t)  copytest=on question="$question [test]" oneoption=on;;
      x)  copyxml=on question="$question [XML]" oneoption=on;;
      a)  copyconf=on copylive=on copytest=on question=" [all]" oneoption=on;;
      r)  recursive=on;;
      f)  singlefile=on filepush="$OPTARG" question="$question [path: $filepush]" oneoption=on;;
      e)  execute=on xcommand="$OPTARG" question="$question [command: $xcommand]" oneoption=on;;
      s)  SERVER="$OPTARG";;
      h)  usage $0;;
      \?)               # unknown flag
          echo >&2 \
          usage $0;;
    esac
done
shift `expr $OPTIND - 1`

if [ "$oneoption" = "off" ]
then
        echo
        echo "Please specify at least one option"
        usage $0
fi

SSH_CMD="/usr/bin/ssh"

SCP_CMD="/usr/bin/scp"

RSYNC_SRC_LIVE="/var/www/web/live"
RSYNC_SRC_TEST="/var/wwW/web/test"
RSYNC_SRC_XML="/var/www/web/live/xml"

RSYNC_DEST_PATH="/var/www/web/"
RSYNC_DEST_XML="/var/www/web/live/public/"
RSYNC_USER_NAME="root"

RSYNC_VHOSTS_SRC="/etc/httpd/conf.d"
RSYNC_VHOSTS_DEST="/etc/httpd/"

if [ "$singlefile" = "on" ]
then
    if [ ! -f $filepush ]
    then
        if [ ! -d $filepush ]
        then
            echo "Invalid file $filepush"
            usage $0
        else
            if [ "$recursive" = "on" ]
            then
                SCP_CMD="$SCP_CMD -r"
            else
                echo "$filepush is a directory, please enable the -r option to continue"
                usage $0
            fi

        fi
    fi
fi

if [ "$nodel" = "on" ]
then
        RSNYC_FLAGS=
else
        RSNYC_FLAGS=" --delete --force"
fi

if [ "$vflag" = "on" ]
then
        SSH_OUTPUT=
        RSYNC_CMD="/usr/bin/rsync -a -v$RSNYC_FLAGS"
else
        SSH_OUTPUT=" > /dev/null"
        RSYNC_CMD="/usr/bin/rsync -a$RSNYC_FLAGS"
fi

if [ "$SERVER" != "off" ]
then
        #Copy only to specified server
        SERVERS=( "$SERVER" )
fi

if [ "$yesmode" = "off" ]
then
        read -e -p "You sure you want to push$question to servers? [y]: " PUSH
        PUSH=${PUSH:-y}
else
        PUSH="y"
        echo "Pushing$question to server"
fi

if [ "$PUSH" = "y" ]
then
        for HOST in "${SERVERS[@]}"
        do
                :
                if [ "$copylive" = "on" ]
                then
                        echo "Running Rsync of live web directory to $HOST ..."
                        $RSYNC_CMD $RSYNC_SRC_LIVE $RSYNC_USER_NAME@$HOST:$RSYNC_DEST_PATH
                fi
                if [ "$copytest" = "on" ]
                then
                        echo "Running Rsync of test web directory to $HOST ..."
                        $RSYNC_CMD $RSYNC_SRC_TEST $RSYNC_USER_NAME@$HOST:$RSYNC_DEST_PATH
                fi
                if [ "$copyconf" = "on" ]
                then
                        echo "Copying /etc/httpd/conf.d to $HOST and reloading apache ..."
                        $RSYNC_CMD $RSYNC_VHOSTS_SRC $RSYNC_USER_NAME@$HOST:$RSYNC_VHOSTS_DEST
                        $SSH_CMD $RSYNC_USER_NAME@$HOST "/etc/init.d/httpd reload$SSH_OUTPUT"
                fi
                if [ "$copyxml" = "on" ]
        then
                echo "Copying XML RSS Feeds to $HOST"
                $RSYNC_CMD $RSYNC_SRC_XML $RSYNC_USER_NAME@$HOST:$RSYNC_DEST_XML
        fi

        if [ "$singlefile" = "on" ]
        then
            case $filepush in
             /*) absolute=1 ;;
             *) absolute=0 ;;
                fi
                if [ "$copyconf" = "on" ]
                then
                        echo "Copying /etc/httpd/conf.d to $HOST and reloading apache ..."
                        $RSYNC_CMD $RSYNC_VHOSTS_SRC $RSYNC_USER_NAME@$HOST:$RSYNC_VHOSTS_DEST
                        $SSH_CMD $RSYNC_USER_NAME@$HOST "/etc/init.d/httpd reload$SSH_OUTPUT"
                fi
                if [ "$copyxml" = "on" ]
        then
                echo "Copying XML RSS Feeds to $HOST"
                $RSYNC_CMD $RSYNC_SRC_XML $RSYNC_USER_NAME@$HOST:$RSYNC_DEST_XML
        fi

        if [ "$singlefile" = "on" ]
        then
            case $filepush in
             /*) absolute=1 ;;
             *) absolute=0 ;;
            esac

            if [ $absolute = 0 ]
            then
                wdsave="`pwd`"
                cd "`dirname "$filepush"`"
                filepush="`pwd`/`basename $filepush`"
                cd "$wdsave"
            fi
            echo "Copying $filepush to $HOST"
            $SCP_CMD $filepush $RSYNC_USER_NAME@$HOST:$filepush

        fi

        if [ "$execute" = "on" ]
        then
            echo "Running command $xcommand on $HOST"
            $SSH_CMD $RSYNC_USER_NAME@$HOST "$xcommand$SSH_OUTPUT"
        fi

        done
        exit
fi

echo "Too bad..."
exit
 

Before continuing, spare a minute to take a look at this great video:

Before I go on, I would like to say if you disagree with me, or wish to discuss this at all, please do!

I’m not going to go into it in great depth right now, but rest assured, I will at some point in the future.

It’s amazing just how hard it is to admit to yourself that you’re wrong about something. Our brains are wired in a way to find support for whatever beliefs we taught and hold, and in a lot of cases completely disregarding or dismissing any counter-evidence that may come along!

I would like to address a couple of those things in this post, briefly and rationally.

When I was younger I believed in all sorts of alternative medicine, this was partly due to the vast amounts of anecdotal evidence I had available to me, my parents have been to a homeopath and iridologists, and I had been too, and the advice was sometimes normal, sound advice, but when it came to the theme of medications, wow, they really take the cake, a whole array of these medications that you have to take and that cost a fortune.

But you may think, you can’t put a price on your health…well little did I know at the time that there is incredible amounts of evidence that it works no better than a placebo.

OK but what’s the harm in that….well I have heard personally of someone being told to take homeopathic remedies to cure their cancer, this is dangerous, if they choose an alternative treatment like this instead of chemotherapy and related things which can actually save their lives. For other examples have a look at http://whatstheharm.net/homeopathy.html

Alright, one last point on this subject, and it’s on how homeopathic remedies are made (you can find out more by clicking on the 2 links 2 paragraphs above). Basically the idea is to treat like with like, so if you have problems sleeping they might make a remedy based on caffeine. With me still? Next they use the principle that by diluting it over and over again and whacking it against a hard surface it makes it stronger. How does this work? Well they say that the water has a special memory (think about this for a second, if it’s the case then we are drinking water that’s got memory of fish poo, dog poo, human poo, and anything else the water has ever come into contact with, trees, iron, lead, stones, concrete, anyway for a quick briefing click here)…and that the solutions which are more diluted are stronger treatments! WTF????? Also, the end product of homeopathic remedies is just water or sugar pills!!!

The other thing I wanted to address in this post was some things I had been taught specifically about science.

One of them is that: Radiocarbon dating is entirely inaccurate and not to be trusted.
This is just not true, if you look around  you’ll find that it’s accurate to 50,000 years (see: http://science.howstuffworks.com/environmental/earth/geology/carbon-14.htm there are many other resources if you’re interested discussing the topic).

Think about it for a second, if it is accurate to 50,000 years and human skeletons have been found at the upper end (and more) of that spectrum.

Another thing is that we have a lot of junk DNA, that’s leftover from viruses and things like that, but from a looooong time ago. Have a look at http://theness.com/neurologicablog/index.php/enogenous-viruses-and-junk-dna/

Like I said, I’m not going to go into this, or anything else in great detail today. But it’s worth thinking about, debating and discussing.

The universe is a massive and fascinating place, and science is an incredible tool for helping understand the inner workings of it!

 

First of all, I’d like to say that I love my Kindle!
Now that I got an old iPhone (3GS) for very little cost, I decided to test out the kindle reader on there too, the app is great and so far so good, reading on the iPhone isn’t nearly as bad as I thought it would be although the kindle runs rings around it, but for example today, I forgot to put my kindle in my backpack but I had my phone and it was great for reading on the metro!

So, I purchased a eCopy of “The Believing Brain: From Ghosts and Gods to Politics and Conspiracies—How We Construct Beliefs and Reinforce Them as Truths” by Michael Shermer (phew, what a mouthful). I only started reading it a few days ago and I’ve read 27% of the book so far.

It presents the idea of beliefs, whatever they may be as coming from our physical and chemical responses on a very base level. It discusses various studies and ideas and pulls it together very nicely. So far I’ve really enjoyed the bits about his upbringing and now the section I’m reading talking about the brains response to dopamine.

Anyway I obviously have a lot more to go but I can’t wait to keep reading, it’s a fascinating read!

The Believing Brain: From Ghosts and Gods to Politics and Conspiracies---How We Construct Beliefs and Reinforce Them as Truths [Kindle Edition]

The Believing Brain: From Ghosts and Gods to Politics and Conspiracies---How We Construct Beliefs and Reinforce Them as Truths (Kindle Edition)

 

The internet is a rage inciting tool.

It allows the ignorant a voice that expands across time and space.

I’m not saying it should be regulated…but at least justify your indignation with facts!

I don’t mean the trolls, they merely feed off the absence of intelligence.

The effort of finding the truth is higher than that of believing everything that comes to you.

Ignorance may be bliss, but it’s cost is fatal!

funny facebook fails - 10 + 10 x 0 = ?

:(

:(

 

Well I thought this was a good function (and indeed it does do it’s job perfectly in the scenario we have) but I can imagine a million cases where it wont work so great.

<?php
        function parseNumber($strNumber,$cc='45',$len=8){
            $numlenfull = $len + strlen($cc);
            $cclen = strlen($cc);
            if(!empty($strNumber)){
                $strNumber = preg_replace('/\D/', '', $strNumber);
                if(strlen($strNumber) == $numlenfull && substr($strNumber, 0, $cclen) == $cc){
                    $strNumber = substr($strNumber, $cclen);
                }
                if(strlen($strNumber) == $len){
                    return $strNumber;
                }
            }
            return FALSE;
        }
?>
© 2011 Zeyus Suffusion theme by Sayontan Sinha