echo "foobar" | pbcopy
Pipe text from commandline into clipboard
Posted on 29. April 2020 Comments
Posted on 29. April 2020 Comments
echo "foobar" | pbcopy
Posted on 18. März 2020 Comments
Update: Well, as expected this post didn’t age well. New Zealand closed its borders to non-residents.
As anything written about the Corona Virus outbreak doesn’t age well, consider this article was written on Thursday 19th March 2020 and I entered NZ on Tuesday 17th March 2020. Things might’ve drastically changed by the time you read this, so do some more research! Also, this is not legal advice, obviously.
When you’re looking for (temporary) refuge from the recent Corona Virus outbreak and you’re in South-East Asia, New Zealand looks like a good option: it’s a civilized democracy with great healthcare, friendly people, a fairly reasonable government, good internet connection and low amount of confirmed cases so far. Even if you’re „stuck“ here for longer, I’m sure you won’t run out of things to do. Alternatives to New Zealand could be Australia and Singapore.
However, you will need to self-isolate for 14 days, so first things first, here’s the official NZ government website about how to self-isolate. There are always idiots that think they don’t have to follow these rules, but NZ police will do spot checks, as I can tell you also from personal experience. And while the rules are not as strict as in e.g. Singapore, they might also force quarantine or deport you if you break the rules or even change them while you’re still isolating.
Things to consider:
Here’s the leaflet you will get at the airport:

Last but not least, chances are you are in Bali: There’s an Emirates flight directly from DPS-AKL at ~4 in the afternoon (coming from DXB), which has 20MB free WiFi and it’s $16 USD for the whole flight. If the login page doesn’t open go to http://172.19.248.2
Please honor the Kiwi hospitality and stay safe!
Posted on 11. November 2019 Comments

Posted on 4. November 2019 Comments
It doesn’t matter which queue system you’re using: Redis, a relational database such as MySQL or a cloud solution like AWS SQS ; you can always store failed jobs in a normal database table. This configuration is done in config/queue.php in the last array:
'failed' => [
'driver' => 'database',
'database' => 'default', // NOTE: connection, not database!
'table' => 'jobs_failed',
],
The key is to put in the connection name, not the database name for ‚database‘. If you don’t you will get the error message „Database default not configured“ every time a job fails instead.
Check out my Laravel Job Eloquent Models.
Posted on 31. Oktober 2019 Comments
If you’re having trouble using $browser->loginAs($user) it might be because the SESSION_DRIVER is set to array. So even this simple code will fail:
$this->browse(function (Browser $browser) {
$browser->loginAs(User::first())
->assertAuthenticatedAs(User::first());
});
Error: The currently authenticated user is not who was expected.
Failed asserting that two arrays are identical.
/vendor/laravel/dusk/src/Concerns/InteractsWithAuthentication.php:102 /tests/Browser/AuthTest.php:162 /vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:67 /tests/Browser/AuthTest.php:163
Write a .env.dusk.local (or where ever you’re starting the tests from) and use a persistent driver like SESSION_DRIVER=database or SESSION_DRIVER=file
Posted on 28. September 2019 Comments
Some pages have an extra screen before the real site appears, e.g. for age verification (like porn, for now anyways, or drug sites) or country/currency selection (like travel and big company sites). As far as I researched this, sometimes the selection is stored in a cookie, sometimes in Web Storage.
Crawling with Cookies is no problem with Guzzle.
But for example, at https://cannabis.wiki the age verification is stored in the Local Storage as you can see in the Chrome DevTools:

Using spatie/crawler we can inject a Browsershot (puppeteer) instance, that sets the localStorage key ageConfirmed through custom JavaScript:
$js = "localStorage.setItem('ageConfirmed', '1');";$browsershot->setOption('addScriptTag', json_encode(['content' => $js]));
However, the code is only injected after the side is already loaded. Therefore we have to use JavaScript to reload the page:
$js = "localStorage.setItem('ageConfirmed', '1');location.reload()";$browsershot->setOption('addScriptTag', json_encode(['content' => $js]));
You can test this on the console e.g. by using ->save($pathToFile); and have a look at the screenshot to see if it worked.
Posted on 19. September 2019 Comments
ALTER USER 'doadmin' IDENTIFIED WITH mysql_native_password BY 'secret_password';
Change ’secret_password‘ to the password given to you by DigitalOcean.
The reason behind this is that SequelPro and other MySQL Clients only work with the old (5.X) way of MySQL authentication vs. the new (8.X) caching_sha2_password. It has nothing to do with the MySQL version itself as Sequel Pro seems to work just as well with version 8.X. You can find more information in the MySQL documentation.
Posted on 4. September 2019 Comments
Posted on 23. Juli 2019 Comments
There is very little (English) information on the internet about how to travel from the Paraguayan capital Asunción to the little town Clorinda, just across the border. Since I don’t have a travel blog but this ranks fairly well, I thought I’d put it up. The only thing I could find, apart from TripAdvisor and LonelyPlanet posts from 10y ago, is this article in Spanish from ultimahora.com.
There are (at least) 2 border crossings and I recently did both. I imagine they work they same the other way around.






There is one report about a ferry and timetables on Facebook but I asked around and the ferry doesn’t seem to run on Saturdays, probably not the whole weekend.
This little town with some odd 40k inhabitants is pretty dead. There’s apparently one hotel, one ATM (though Paraguayn Guaranís/PYG are accepted everywhere, even on the bus!), a few shops selling mostly things like dog food or mate in bulk, a few mum and pop supermarkets. I didn’t see an open café or restaurant, but it might’ve been the time of day. There’s nothing for sightseeing and if you want to travel to e.g. Buenos Aires I’d suggest taking to long distance Bus directly from Asuncións Bus Terminal. It will take the same route anyways but is way less hassle. On the Nanawa side, there’s an interesting market, but selling mostly cheap stuff from China and some local produce – and of course, Mate and accessories. It’s ok for an afternoon or to get the passport stamp to check off the country – although I highly encourage everybody to travel in Patagonia extensively and visit Buenos Aires – this is not the way to see Argentina 😉
Posted on 5. Februar 2019 Comments
Infographik von Wrike – aufgaben software