maandag 6 juni 2022

Fix the engine

A giant ship's engine broke down and no one could repair it, so they took it to a engineer with over 40 years of experience.
He inspected the engine carefully, from top to bottom. After seeing everything, the engineer unloaded his bag and pulled out a small hammer.
He knocked something gently. Soon, the engine came to life again. The engine has been fixed!
7 days later the engineer mentioned that the total cost of repairing was $ 10,000 to the ship owner.

"What ?!" said the owner.
"You did almost nothing. Give us a detailed bill."

The bill:
Tap with a hammer: $ 2
Know where to knock & how much to knock: $ 9,998

Lessons to Learn:

The importance of appreciating one's expertise and experience ... 
The words "it's easy" and "that's all", should be set aside. Why? Because maybe the experience is the result of struggles, experiments and even tears.
Like above:
If someone can finish a job in 30 minutes, it's because he spent 10 years learning how to do it in 30 minutes. You pay for those 10 years, not 30 minutes.

zaterdag 7 december 2019

Waardeer het, repareer het!

Eindelijk, Sire heeft mijn levensmotto ontdekt. Niets mooier dan je eigen spullen fiksen! Of het nou een fiets, auto, of een duplo treintje is :)



dinsdag 28 april 2015

Twitter script for bash shell

For my Solget project I use some scripting I found on the internet. The original site does not exist anymore. However, I found out that I wasn't receive new tweets anymore. I did some homework and found the bugs. I also found out that the script could skip some code so I removed that.

Edit: since twitter made some changes again; script is also revised. (April 8 - 2015)
Edit2: another change; script revised (April 28 -2015)

Results:

#!/bin/bash

#REQUIRED PARAMS
username="TWITTER USERNAME"
password="TWITTER PASSWORD"
tweet="$*" #must be less than 140 chars

#EXTRA OPTIONS
uagent="Mozilla/5.0" #user agent (fake a browser)
sleeptime=0 #add pause between requests

if [ $(echo "${tweet}" | wc -c) -gt 140 ]; then
echo "[FAIL] Tweet must not be longer than 140 chars!" && exit 1
fi

if [ "$tweet" == "" ]; then
echo "[FAIL] Nothing to tweet. Enter your text as argument." && exit 1
fi

touch "cookie.txt" #create a temp. cookie file

#INITIAL PAGE
echo "[+] Fetching twitter.com..." && sleep $sleeptime
initpage=`curl -s -b "cookie.txt" -c "cookie.txt" -L --tlsv1 -A "$uagent" "https://mobile.twitter.com/session/new"`
token=`echo "$initpage" | grep "authenticity_token" | sed -e 's/.*value="//' | sed -e 's/"\/>.*//'`

#LOGIN
echo "[+] Submitting the login form..." && sleep $sleeptime
loginpage=`curl -s -b "cookie.txt" -c "cookie.txt" -L --tlsv1 -A "$uagent" -d "authenticity_token=$token&username=$username&password=$password" "https://mobile.twitter.com/session"`

#TWEET
echo "[+] Posting a new tweet: ${tweet}..." && sleep $sleeptime
update=`curl -s -b "cookie.txt" -c "cookie.txt" -L --tlsv1 -A "$uagent" -d "authenticity_token=$token&tweet[text]=$tweet" "https://mobile.twitter.com/compose/tweet"`

#LOGOUT

echo "[+] Logging out..."
logout=`curl -s -b "cookie.txt" -c "cookie.txt" -L --tlsv1 -A "$uagent" "https://mobile.twitter.com/session/destroy"`

rm "cookie.txt"


vrijdag 13 juni 2014

mail form

Zo, het zou eens tijd worden. De mailforms zijn weer in orde op alle sites. Dat krijg je als je de boel niet bijhoudt. Nu zijn de foutmeldingen in elk geval weer verdwenen en werkt alles zoals het hoort.

eregi is vervangen door preg_match; en split door explode.

Werkt prima, geen deprecated method meldingen meer!

function checkmail($email)
{
    if(preg_match("/^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$/i", $email))
    {
    $mailDomain = explode("@",$email);
if (checkdnsrr($mailDomain[1], "MX")) {
return TRUE;
}
    }
    return FALSE;
}

donderdag 12 september 2013

de 80; statistieken 2012

Nog gauw even uitgerekend; altijd handig voor onderweg.


Aankomst Vertrek Rusttijd KM
Unnaplein Waalwijk 07:46

0,0
Start Raadhuisplein Waalwijk 20:00

0,5
Post 1 Drunen 22:38 22:51 00:13 15,4
Die Heygrave Vlijmen 23:51

20,9
Post 2 Haarsteeg 00:44 00:54 00:10 25,5
Elshout In Den Gekroonden hoed 01:42

29,9
De overlaat Waalwijk 02:35

34,7
Post 3 Waalwijk 02:49 03:01 00:12 36,0
Doorlooppost 10 Waalwijk 03:27 03:32 00:05 38,3
Post 4 SprangCapelle 04:57 05:07 00:10 45,9
Sportcentrum Waspik 05:40 05:49 00:09 48,9
Post 5 's-Gravenmoer 06:23 06:33 00:10 51,9
Post 6 De moer 08:36 08:46 00:10 62,1
Tennispark de Moer 09:03

63,6
De Wetering Loon op Zand 09:57 10:04 00:07 68,0
Post 7 Loon op Zand 10:22 10:35 00:13 69,5
Doorlooppost 18 kaatsheuvel 11:27 11:33 00:06 74,1
Post 8 Kaatsheuvel 12:20 12:29 00:09 77,7
Toilet café James 12:30 12:38 00:08 78,0
Finish Waalwijk 13:22

81,4







Totaaltijd 17:22


Rusttijd 02:02


Wandeltijd 15:20


Gemiddeld 4,69


Loopsnelheid 5,31

maandag 15 juli 2013

Daar gaan we weer!

We gaan er weer aan beginnen, de 17e vierdaagse staat voor de deur! Je kunt mij volgen via http://marcel.reinieren.net/p/4daagse.html

 Ik zal proberen om hier weer elke dag een kort verslagje te plaatsen.