niels / Blog /

Pretty Code

Update 2021-10-31: I no longer use WordPress or the mentioned plug-ins. What you see is generated by Jigsaw. Tried a number of WordPress plugins while looking for a syntax highlighter that supports the regular Gutenberg code block and does not come with a ton of unnecessary bloat. I think I found it. You’re looking at […]

Read more..

niels / Blog /

First Post!

First post on the new peen.dev domain. I’m expecting many more to follow.

Read more..

niels / Code / #php

PHP TCP server

The first thing developed for Mailjoe was its TCP server. There are many examples out there, but we didn’t find any that was multi-protocol, non-blocking and multi-process. The snippets below are fairly small and self explanatory. Please keep in mind that all of this code worked fine during the Mailjoe beta, but is by no […]

Read more..

niels / Software / #vpn

Linux L2TP/IPSec with iPhone and Mac OS/X clients

After moving to China I ran into a few issues that got me to install a VPN. Namely: Latency. I frequently use SSH to access remote servers in US and EU and for some reason the latency here is terrible. Running SSH over a VPN seems to resolve this. A nice bonus is that idle […]

Read more..

niels / Code / #php

Syncing Fanfou with Twitter

@kofai asked me to share my Fanfou to Twitter sync script. It’s not art, but it works, so here goes: <?php define(STATUS_PATH, ‘/home/www/twitbridg/status/’); include_once(‘password.php’); $since_id = file_get_contents(STATUS_PATH.$twitter_username.’.last’) OR $since_id = ‘1’; // The twitter API address $url = ‘https://twitter.com/statuses/user_timeline/’.$twitter_username.’.xml?since_id=’.$since_id; $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, "$url"); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_GET, 1); $buffer […]

Read more..

niels / Software /

RMVB files on (64-bit) Linux

The Chinese like to share their movies in RMVB (RealMedia) format as opposed to Xvid or DivX. Not sure why it got to be so popular (I would prefer the more open Xvid), but the file sizes and quality it produces are quite good. A problem I ran into is that mplayer/vlc don’t seem to […]

Read more..

niels / Software /

AliPay on GNU/Linux

AliPay is the Paypal of China and hard to ignore if you want to use websites like TaoBao (the Chinese eBay.) Unlike Paypal however, it requires ActiveX components or Firefox plugins to function. Getting this to work on Linux can be a pain if you don’t read Chinese. So here’s in English: Download http://blog.alipay.com/wp-content/2008/10/aliedit.tar.gz Extract […]

Read more..

niels / Software /

Google Gears 64-bit

Links to outdated and potentially dangerous binaries have been removed. While eagerly installing Offline Gmail on my computers I ran into the fact the Google Gears is actually not available for 64-bit Linux. I managed to find a number of builds out there, but none that would actually work for me with Offline Gmail or […]

Read more..