1. The beginning of a more conscious life

    September 29, 2016 •

    So, a few minutes ago I read this article about Cait Flanders that really really inspired me. It inspired me to start a new chapter in my life.

    The past few months have not been the best time for me, many things have gone wrong and without going into too much detail, I barely escaped burnout. In recuperation from the mental breakdown I made a few life-changing decisions, none of which I regretted so far. For example I dropped out of my master’s program, have taken up regular intense exercise, meditation, Yoga and other relaxing practices, and I decided against increasing my work hours—at least for a few more months. All these changes came at a fast pace over a very short period of time. It’s a weird how much my life changed in what wasn’t even half a year. But I feel better now, more alive and more energetic than I have in a long time. I enjoy things more now, I cherish my free time, the time with my girlfriend, the time at the gym.

    With having more energy and focus available to re-allocate on different life targets, I started keeping an eye on my weight and food consumption again. A few years back I lost about 90 lbs and became a new person back then—now I wanted to continue in doing that: there’s still 25-30 lbs to go, until I will be satisfied with the result. But as I started to focus on nutrition and exercise more and more, I noticed how much easier it was compared to the time I was stressed out and tried to do the same. Now with some strength to spare I can finally focus on achieving my goal. That alone is a great feeling, but I don’t want to stop there.

    Though, I have become more aware of having a limited amount of “focus points” to allocate to certain things in my life. And I have to re-evaluate the given shares of focus points as often as possible to assess whether or not I can cope with adding another thing to my target list. Right now handling my recuperation, weightloss, exercising, and a part-time job is working out pretty well. It even feels like I have a little room to spare.

    And that’s why the article about Cait resonated with me. Financials are another big topic in my life, I haven’t been handling them very well in my student days, and I will have to cope with the consequences for quite a while. Therefore I am always looking for ways to improve the immediate or future situation extrinsically. One big step I took quite a while back was using YNAB for all my financial planning. It works out pretty well so far, but I see in my habits there’s still potential to improve the overall trend.

    That’s why this post is titled the beginning of a more conscious life: All that happened before has been the start of being more conscious about myself and my situation. Mindfulness is a newly established corner stone of my life, and—in another sense of the word—a big part of the relaxation exercises I do regularly. Now it’s time to apply a little bit of accountability as well.

    I will start writing up detailed posts about spendings, just like Cait did, just to hold myself accountable for what I spend. I think this will enforce a more frugal lifestyle on me, and I need that. So stay tuned.

  2. It’s finally happening: HDD shipments starting to drop massively 

    May 13, 2016 •

    It’s finally going down: HDDs are on the decline. AnandTech has a (just as always) thorough analysis of the market in first quarter of 2016 and I see what I expected to happen for quite a while now.

    Looking at the data (most graphs on page 2 of the article), there is clear signs that the phase-out of HDDs for consumer products has begun. The declines are almost exclusively happening to the non-enterprise(-ish) products, and that is good. I swapped my last HDD into an SSD about three years ago and have never looked back. Especially when it comes to mobile computing in laptops, HDDs are just the wrong kind of storage. Spinning platters, and moving heads have no place inside of a device that moves just as much.

    Unfortunately I still see a lot of HDDs in today’s computers, even those that are currently being sold. Of course it’s a cheaper option, so entry-level devices will probably take a few more years to finally become SSD-only. But for anyone having just the slightest interest in future-proofness of a newly bought computer: for sakes of sanity—get an SSD.

    For the enterprise kind of storage (mass storage), the HDD has a lot more to offer versus SSDs. Even though capacity for solid-state storage is increasing rapidly, the sizes currently achieved by magnetic storage devices (especially the upcoming Helium-filled models) just dwarf SSDs in the grand scheme of things. And where latencies and vibrational robustness are not that important but priving is—a spinning platter will stay the number one choice for a long time.

  3. How to remove the Samsung Portable SSD Daemon

    March 14, 2016 •

    I recently got myself a Samsung Portable SSD T1. Basically a fantastic product, finally some SSD-based storage for even the tiniest pockets. I really like carrying like 3-4 USB thumb drives with me when I’m on the go, since there is always something to copy, and or reinstall or whatever.

    Anyhow, after unpacking the T1, the first thing you need to do is set it up. It comes with some fucked-up proprietary encryption software that is (of course) only compatible with the proprietary two of popular operating systems (Windows and Mac). So it’s the first thing I get rid of. But even if you don’t want to use the encryption you still have to click through some weird setup assistant, and only after that will you be able to actually use the drive.

    What you might not notice is the setup assistant instatiating a daemon for handling the encryption. Yes, even though you selected not to encrypt the drive. And—as you’d expect proper bloatware to behave—it doesn’t come with an uninstaller or other removal tool. I still managed to remove that thing and here is how:


    Open the taskmanager, and kill the “Samsung Portable SSD Daemon.exe” task. Now run “Taskschd.msc” via WIN+R or the “Run …” menu in the start menu to open the task scheduler. Inside the library that opens up look for “Samsung_PSSD_Registration” and delete the entry. Finally open Windows Explorer, navigate to C:\ProgramData and delete the “SamsungApps” subdirectory. Congratulations, you removed that sonbitch!

    Mac OS X

    On OSX, Samsung even installs something that looks like a SMART driver for the SSD. Don’t get me started. To remove it, open “Terminal.app” (in /Applications/Utilities/ folder, or via Spotlight), and paste the following two lines:

    sudo rm -r /System/Library/Extensions/SATSMARTDriver.kext
    sudo rm -r /System/Library/Extensions/SATSMARTLib.plugin

    That should remove the kernel extension. Now for that stupid daemon: first unload and remove the daemon’s launcher:

    launchctl unload ~/Library/LaunchDaemons/com.srib.pssddaemon.plist
    launchctl remove ~/Library/LaunchDaemons/com.srib.pssddaemon.plist

    And finally, remove the Daemon itself:

    rm ~/Library/PortableSSD/Samsung\ Portable\ SSD


    You should now be freed of what Samsung deems the right amount of annoyance when buying their products. I mean seriously, their hardware quality and design speak for themselves, and do not require poorly implemented and probably never updated software components. Cobbler, stick to your last, godammit!

  4. My next computer probably won’t be a Mac again

    February 18, 2016 •

    It’s been about a month now, since I ranted on the current generation of iPhones and how I’d like to try something new with Android. Therefore another rant has to happen and the target is the same as before.

    I don’t do this intentionally. It’s just that after more than five years in the Apple ecosystem the honey moon phase is finally over, and I want to regain some of the freedom that you give up with it. I’m not going to argue about the good of hardware quality or the bad of software quality. Others have done that for me. This is about a student (me, Riv, hey there) looking back on four years of a first degree course and contemplating if his current machine is still up for the task of completing a second degree course and what it would mean to switch devices mid-courses.

    Weirdest intro stanza ever. Anyhow, I’m going to study in a new field of expertise and my current machine is not really on par with what I expect a computer to do for me these days. Especially with new demands coming up from the new studies. In the past I’ve always just stuck with a reasonably well-spec’ed MacBook Pro. Basically one-click buying that thing.

    Since I have to keep an eye on money these days (allowing yourself to start over after already completing a degree course is not exactly easy on the budget), I really compared pricings this time. My current machine’s hardware is sort-of the baseline for selecting the next one, and with that in mind, things look pretty dim.

    Status Quo

    My current Mac is a MacBook Pro 13-inch late 2011. It was the upper entry-level build, meaning it came with an Intel Core i7-2640M, and 4GB of RAM initially. Over the past 4 years, 3 months, and 18 days (from purchase date) I bumped the specs a little bit, to adjust to my needs:

    • RAM upgrade to 16GB (greatly needed since I work with VMs a lot)

    • HDD swapped with first a 250GB SSD, later a 500GB SSD

    • Optical Drive removed in favour of a secondary SSD when I put the 500GB one in, giving me a total of 750GB SSD-driven “disc space”

    The processor has been a real blast up until recently. The last time I got the chance for a head-on-head benchmark with another MacBook Pro, it finished first by far (the contestant was the Mid 2012 MacBook Pro non-retina). Now it feels slow-ish, especially when it comes to graphics performance. It was already noticeable under OS X 10.10 (Yosemite), but it is just palpable under El Capitan that the HD 3000 graphics are not equipped for modern tasks anymore. Especially when run in a dual-monitor setup: animations are studdering, and even 720p Youtube gives you the signature sound of a blow dryer that previously I knew only from cheap PC laptops.

    Even worse than the overall UI studder is mouse lag. This is especially kicking in when the Mac is waking up from sleep or when MDM service is doing his magic of re-indexing something that was perfectly indexed just two hours ago. Believe me: mouse lag is the worst. It brings me close to a freak-out, and that is not something I need when switching classes at university and I reopen the lid in the next room.

    Ergo: that bitch has to go. Honestly I love that computer, we have been through a lot. But enough is enough, and that’s not only because of that piece-of-crap bloatware OSX has become the slightly dated hardware.

    To up the ante

    From all that arises the question what I want to buy next, and there lies a conundrum: Of course I’d really like to stick to the Mac, and OSX, and its integratedness with the rest of my digital lifestyle (buzzword alert!). But doing a bit of pricing research quickly kills that initial impulse1. Let’s take a look at the lineup: currently there are three base configurations available for the 13-inch retina MacBook Pro, differing most noticeably in SSD memory. I’d opt for 512GB of space, and I genuinely need it since this it’s supposed to be my main machine and supposed to store copies of my music and photo library. The only model that is equipped with 512GB of memory is the top of the line. No upgrade whatsoever available for any of the others. That sets the base price for “sticking to the Mac” to €1.879,66 (as per the Apple EDU store for Germany).

    Unfortunately for my nit-picky and fastidious self that base price only includes 8GB of RAM and a yesterday-ish Core i5-5287U Dual-Core, from the Broadwell mid-range. It compares well to my 2011 i7, with a 15% effective speed increase but is still 13% behind the Core i7-5557U of the maxed-out configuration.

    Even though I’d more likely go with the Core i7 ultimately, I’m sticking to the i5 for now, to not exaggerate the config. As for the RAM, 8GB are not an option. Especially considered it is fucking soldered to the logicboard. Outgrowing 4GB of RAM was a matter of months (held up til ca. May 2012), I don’t want to go through eternal distress when I break the 8GB barrier after maybe a year, and there is no way in hell to upgrade that. So 16GB it is, and that concludes the build-to-order steps for the latest rMBP 13-inch, setting the bar to a whopping €2.105,76, an amount of money that is just out of question for me right now.

    I’m not saying I wouldn’t spend that amount of money if split over the course of five years. But it’s an upfront payment, and it’s due pretty soon. So that’s not going to happen. Not with all the dissatisfaction I have accumulated for that walled Apple orchard.

    Going open

    So what’s the only considerable alternative if you still have an OCD for reasonably well-built hardware, but want to dump the price tag, and the crappy software limitations? Thinkpad! Even chance intervened, and Lenovo just recently released this years notebook lineup and it’s looking pretty good so far. I developed a strong crush on the T460s which is more spec’ed to meet my demands. In Germany Campuspoint.de has some pretty cool discounts, and amongst the configuration options there is one that seems fits me best. The top-shelf processor (Intel Core i7-6600U) in the T460s is not quite as fast as the rMBP’s i7-5557U, but it’s only a 2% difference ultimately. The base configuration costs €1.499,00 with 12GB of RAM and 512GB of flash storage. When upping the RAM to 16GB, the price increases to €1578,90, and … that’s it. The display is almost on-par with Apple’s Retina panel (210 vs. 228ppi), and so is battery life (ca. 10 hours for both). Apart from that I like that the T460s is even a little lighter than the rMBP (1,45 vs. 1,58kg). And there is better connectivity since the ThinkPad comes with a Gigabit LAN-Port (network-admin high five!).

    As for the openness of the hardware, ThinkPads are known to have unprecedented support for running Linux. And I really miss Arch Linux, dammit. And I would really miss opening my machine up every once in a while to get some dust out, upgrade components (NVMe will be going strong in the next years I bet!) and be my own genius whenever I want. Figure in a price difference of almost 500 european pesos1 there is no question about what happens next.


    I really love the Mac. And I’ll probably keep my 2011 MBP around for shits and giggles. But pricing just got way out of hand when Apple went Retina and not adjusting back, when Retina got mainstream (which it fucking is by now). So a little more time for me to save up the money, and then I’ll thinkpad away heavily. I’m looking forward to it. Yay!

    1. Please note that any named prices are from german EDU stores, so they include educational price cuts not generally available to anyone. Though relations still apply to regular prices in a way. 

  5. Getting to know Android (Part 1)

    January 27, 2016 •

    For a while now I’ve been thinking about trying out Android. I mean, for real. I’ve been an iOS user from the start but lately I grew a little tired of all the quirks. All first world problems, I know. But problems still, if you have to endure them at least a few times a day.

    I have a couple of friends who’d all rather have an arm chopped off instead of giving Android a real chance, and I get most (but not all) of the reasons they have for iOS and against Android. What I don’t get anymore is the unquestioned willingness to pay an awful lot of money for a properly spec’d iPhone. For a few years I was fine with it aswell. But the situation has changed by now and I have to keep an eye on spendings for at least a few more years. Which is a whole other story in itself. Maybe I’ll talk about that at some point in the future.

    I digress … I always looked at Android as an awesome idea for a mobile operating system. No doubt it has many strengths over iOS and ultimately the huge market penetration can’t be a total bubble, can it? So a few days ago, opportunity arose and an acquaintance of mine offered me to borrow his Motorola Moto G (2nd gen, 2014) for a while.

    It is certainly not the “properly spec’d” kind of phone I’d imagine using throughout the day. But it provides a chance to finally get a look at the OS. If I end up liking it, wanting more, I’d still have to get my own phone and therefore can make a more hardware-centric choice. All I know from recent digging, high performance Android devices that fit my requirement profile seem to be priced at about half of what the same iOS device would cost me.1 At the most! Considering more reasonable options maybe just a third. But if that’s gonna happen, remains to be seen.

    Now for a quick disclaimer: I am not trying to bash on either iOS nor Android just for the sakes of bashing. But I will not be beating around the bush to get my point across. At some time in the future someone might read this ramblings and think “that sucker just got it all wrong”. Go ahead, try to correct me. Still, my observations and opinions are my own. If you don’t like them, troll go away. This post is not about religious wars on platforms. It’s about me.2

    And by the way: this is a process. When this post goes live, it won’t be finished and concluded all the way. I plan on using the Moto G at least for a few months before a final verdict. But I’ll update this post whenever necessary. Feel free to subscribe to this feed. Or that feed. Maybe I’ll update this very post. Or I’ll split my findings into many. You’ll know it when you see it.

    Anyhow, let’s dig in.

    The transition from iOS to Android was basically nonexistent. Just throwing myself into cold water. My iPhone 5 went out of juice in the early evening of Monday, January 25th, so I decided this is as good a time as any. I threw it into a drawer, unpacked the Moto G and hacked away.

    From all I’ve read in the past3, I had no plan on using the stock image on the Moto G. I really dig the approach of Cyanogenmod and therefore I spent the first few hours reading up on the stuff, and eventually installing CM 12.1 on the unlocked phone. The biggest point I was trying to achieve by using a custom ROM was getting rid of all the Google apps.4 The most bearable thing for me is the pico version of the Open GApps, i.e. Play Store and its services only. I know shipping unwanted Apps from the iOS side of things. Keep Gmail, Maps, BloatXyz off my phone. If I end up needing them afterwards I can still download them.

    So here I am an iPhone user of many years with a clean phone. Next step: attaching the cords that are my digitally managed life. I keep all my contacts and calendars digitally, of course. And since I have been Apple-exclusive until now, I always went with iCloud. Not very privacy friendly but probably better than others. Since I still have a Mac and the possibility of migrating back to iOS after this shindig, I decided against moving to a selfhosted solution and instead invested a few bucks on the Play Store in some Apps that handle synchronization with iCloud servers. I know iCloud infrastructure basically glorified DAV servers. But I like myself some Klickibunti5 every now and then.

    Next up is email, and with that: the first conundrum, and the story of today’s introductory posting. I have an exchange account for work (which I prefer being run via IMAP and staying unsynchronized most of the time, since this is my private phone and if people at work expect quick responses via email 24/7, they should be paying for the phone), and an MiaB-based server for private stuff, run via IMAP.

    As I go about configuring my private account I expected to find in the account settings an option for activating S/MIME signing and encryption. You know, like one would expect it from a stock mail app being deployed on millions of devices that are used in corporate structures. You know, like iOS does. You know, like even the retarded poor stepbrother of a mobile OS Windows Phone does!

    Turns out: can’t be done on Android. You have to install a third-party email client to get it to work, and then you are stuck with … well a third-party email client, which is a slap in the face by itself. They are all ugly and not even by a long shot respecting/using Android’s interface guidelines / material design.

    At this point, about two hours in, I am already infuriated. I am okay with apps not providing GPG support. That protocols is practically dead anyway. But S/MIME? Guys, that stuff is in Outlook for ef’s sake. Even if I had been using Android with Gmail installed—not even that does it.

    So … tough times for a privacy enthusiast on Android. To be honest it makes me more sad than angry, since I really do want to give it a shot! I don’t want to have my prejudices strengthened that years of iOS indoctrination have taught me. I want to see a new world. An open world. A proper one. No unwalled garden, where you really just want to flee because the flowers are all dead or crippled.

    And I’ll keep on trying. And I’ll keep you posted. Because there is good things about Android. Like widgets on the home screen. Seriously Apple, how the fuck are you not copying that with your boring useless all-icons springboard?! But we’ll get to that.

    1. I assume my baseline to be a current model iPhone with a decent amount of memory, i.e. iPhone 6s 64GB

    2. Am I not a terrific person? 

    3. I guess nobody is without bias 

    4. I know, there is still rooting the device, yadda yadda. But I always liked a clean slate when trying something new. 

    5. A german netizens term for something being reduced to simple interactions; optimizing something for “the newbie consumer”. 

  6. Why I won’t migrate the new YNAB

    January 2, 2016 •

    I’ve been using You Need A Budget (YNAB) for a while now and I’ve been fairly happy with it. The concept of it is working pretty well for me and I finally got my financials straight with a reasonably small amount of work required. From the start I disliked that there was no real syncing infrastructure in place. One can use Dropbox integration, but as I value my privacy, Dropbox is not an option for me anymore. Therefore I stuck with the desktop version of YNAB and that was fine.

    I have been asking the YNAB guys for support of other cloud infrastructure and they hinted a new “web-based version”. At that time I was excited about it. But now that I know it will soon be the only version of YNAB receive ongoing support, I look at it differently.

    Why? Because minute details of my financials don’t belong in the cloud. Let alone a cloud under US legislation. Both the YNAB desktop and mobile app are very promising products. They worked flawlessly for me in the past. It should have been a logical step to extend their functionality to eventually support both cloud-based accounts as well as standalone “self-hosted” syncing solutions using for example BitTorrent Sync. Everybody would have been happy. Now they’re dropping support for desktop software entirely forcing even privacy-cautious people to upload financial details into the cloud.

    This is mostly a trust issue for me. First and foremost, since the Snowden Revelations, US-based cloud-providers have completely lost my trust and in almost two years they have not behaved as if they care about gaining it back. In addition to that, recent events are cause for suspicion of anything cloud-based. Major services like Patreon, Forbes, Sony, Adobe, and a ton of others have been subject to serious hacks, exposing millions of accounts and associated data to leak online. My records have been in a few of those dumps aswell. I sure have a lot of accounts. But none of the datasets did contain my personal financial records. Nor will they ever. After all that happend, that is a no-brainer to me. Financials are a huge part of personal privacy that nobody would want to have exposed for the whole world to see. Maybe even a few “I have nothing to hide” advocates will admit that.

    And that’s why I will not join the YNAB web app. I’ll stick to using YNAB 4 until support is eventually dropped and OS-updates will make it impossible for me to continue using the desktop client. Thank you YNAB for helping me sort through my financial chaos of the past. But this move is not helping.

  7. Setup a proper Python 3 environment on a Mac using Homebrew

    October 29, 2015 •

    I don’t know why, but I’ll probably never get this into my head so this is partly a reminder to myself but also small tutorial for other. Recently I am writing a lot of code in Python. And since it’s 2015, nobody would actually want to start Python programming using Python 2. Unfortunately Python 2 is the default version shipping with most of the OSes I know, to the least on Mac OSX.

    So what has to be done to get Python 3 properly up and running, right beside Python 2 that might be used by the system itself? The answer is Virtualenv. In the following I assume that you have Homebrew installed on your Mac. I am going so far as to say, this is mandatory Mac software!

    Using Brew, we’ll install a custom Python 2 via brew and VirtualEnv via Python Package Manager pip. In addition we’ll also install Python 3, but it is not usable yet! Well, it is. But not the way it is meant to be used.

    brew install python python3
    pip install virtualenv

    Now we are able to create a virtual environment. This will cause the default python call in shell to be forwarded to python3 as long as the Venv is activated. When it’s not activated, python will behave just like before and your system will keep on running. Before doing the following, you may need to close (quit!) and reopen your Terminal.

    virtualenv ~/.envs/python3 -p python3

    I like all my Venvs to be created in ~/.envs. That directory is hidden (henve the ‘.’ in front of the folder name) and it’s the same on all my machines. That makes it easier to maintain all my stuff. The above command will cause all the necessary symlinks to be created. Next step is to activate the Venv and finally use it!

    source ~/.envs/python3/bin/activate

    By default, the bash shell prompt will show the Venv on the far left. Now you are able to use not only simple calls to python to actually reach python3, but you may also use pip to install packages. Those will be saved to ~/.envs/python3/lib/site-packages/, far far away from the system-wide packages. And that’s one of the strengths of Venvs. It allows you to easily create complex dependency situations for single projects while leaving your system-wide configuration untouched, save, and sound.

    Of course new Venvs can even be created for Python 2. In that case you can just omit the -p python3 option on creation or specifically set it to -p python2. On omition, the system’s default python will be used.

  8. FreeNAS 9.3 on VMware ESXi 6.0 Guide 

    October 27, 2015 •

    I am running a fairly decent home server for about a year now. I always struggled with the old out-of-the-box Synology NAS system since it was painfully slow and I didn’t like the software very much. So I built a server myself (as I built many many computers before) and set it up to run FreeNAS, an open-source NAS operating system based on FreeBSD. I really love the way it just works and the machine it runs on has plenty of processing power to handle even the more elaborate tasks occuring in a small home network.

    But that power idles around a lot of the time and even when I finally put some strain on the system, the processor (a XEON E3-1230 v3) barely maxes out. Running some other tasks (that I would normally have my home office’s computer do) inside of a FreeBSD jail didn’t turn out to work so well and while FreeNAS is great when it comes to bare storage, it is kind of restricted when you want to go beyond just that. And all that made me a little sad until I finally stumbled upon Ben’s blog, where he writes about a lot of storage and server related things. And it presented to me the perfect solution to try: Running FreeNAS virtualized on top of VMware’s ESXi hypervisor.

    The setup is quite elaborate (at least in relation to: take a computer, plug some hard drives into it, and done), and requires a dedicated PCIe -RAID- storage controller but after all it’s really worth the hassle and a small investment! I can now run multiple (otherwise dedicated) systems on ESXi and my server is finally put to actual use.

    So if you care about the storage and configurational capabilities of FreeNAS but have a capable machine to run more than just that (or if you are just interested in storagy stuff, take a look at Ben’s site. I’ll probably write up something about my current ESXi setup very soon, especially since I got OSX Server running on “not exactly suitable” hardware aswell …

  9. How to remove trailing slash and file extension from pages served with Pelican

    October 25, 2015 •

    The work on this site continues and today I made great progress in minimizing the CSS and improving the general visual appeal of the site. As I am using the beautiful Bootstrap web framework I tried to encorporate most of the styling directives that already ship with my customized version of bootstrap, and at the same time reduce the number of CSS rules that I implemented to overwrite default Bootstrap behavior. The result is a reduction of about 50KB of data on every request and I am now down to about 170KB for the front page to be served.

    As I like load times to be fast and my custom CSS contains only 60 lines of code I include those rules directly into the HTML, eliminating another request from the equation. I am pretty satisfied with the load speed now, even without activating caching and/or compression. More on that soon.

    Now let’s turn to what we are actually here for: The visually appealing fact that I now have URLs without trailing slashes and without file extensions! One does not get around modifying the .htaccess to add the necessary mod_rewrite directives but of course Pelican can serve that aswell when rsync_upload-ing the site to the server: The htaccess file will be created in content/extra/htaccess (yes without the dot in front, so we can see it at all time) and referenced in the pelicanconf.py like this:

        'extra/htaccess': {'path': '.htaccess'},

    This tells Pelican to take the htaccess file from the extra folder and place it in the root folder of the compiled output of the site (of course then prefixed with a dot). For this method of removing trailing slashes to work, your URL patterns have to be modified as well, to something along these lines:

    ARTICLE_URL = '{date:%Y}/{date:%m}/{date:%d}/{slug}'
    ARTICLE_SAVE_AS = '{date:%Y}/{date:%m}/{date:%d}/{slug}.html'
    PAGE_URL = '{slug}'
    PAGE_SAVE_AS = '{slug}.html'

    All _URL settings have to have their trailing slash removed, and all _SAVE_AS settings have to end in the same thing but with .html appended. The only thing missing now, is the contents of our content/extras/htaccess:

    RewriteEngine On
    RewriteBase /
    # Check if request is for an actual file, serve the file
    RewriteRule ^([^\.]+)$ $1.html [NC,L]
    # Catch request to HTML file, remove extension
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.html
    RewriteRule ^/?(.*)\.html$ /$1 [L,R=301]

    Now your webserver will present the correct file when you call on it with no extension attached. If you call it with an extension, you will be permanently redirected to the version without the extension (or slash). Looks good!

  10. Adding link posts functionality to static sites generated with Pelican

    October 24, 2015 •

    In my quest to world domination using just my words and a blog I have created a slightly modified version of the default Pelican site template. One of the most important things for me to post to my readers are link posts. A lot of people out there use them to share other articles or websites and add comments to them. John Gruber for example is doing most of his posts on Daring Fireball as link posts (and I can’t even remember the last time I did see any other content over there). I really love sharing the thoughts of others and I am a very frequent retweeter on Twitter. Unfortunately Twitter has a hard limit on how much I can comment on the shared things, ergo this blog of mine needs to have a “retweet” functionality built-in.

    As it turns out, implementing it into the Pelican static site generator is extremely simple and requires only a few changes to the theme: Wherever the site may show the title of an article an if-clause will be added. In my case the article.html template contained the following as part of an article titleage:

      <h2 class="entry-title">
        <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>

    So when looking at other people’s implementations of commented link posts, they universally agree on presenting the link as the href of the article’s title whilst marking the title as “external” by using some fancy symbol behind it. Since Pelican allows me to have any content tag I want in a markdown article file, I chose to add the link: tag for articles that are supposed to link externally. Therefore I simply start my upcoming article template with

    Title: Fancy article on that site tells us a crazy story
    Date: 1970-01-01 00:00
    Link: https://that.site/fancy-article-with-crazy-story

    and the content is ready. The only thing missing is querying for the link: tag in the template, changing the link, adding a cute symbol next to it, and we are golden:

      <h2 class="entry-title">
        {% if article.link %}
          <a href="{{article.link}}">{{ article.title }}</a> &rarr;
        {% else %}
          <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
        {% endif %}

    That should be it: the blog now supports commented link posts that link directly to the original location. Of course such an article is still linkable locally as well – the page is created after all. I used a little chain link symbol to provide a permalink on this blog, that always links to the local reference of the article.

    So dear Pelicans out there: you’re welcome! By the way: I have an example article up here: The Anandtech Samsung 950 Pro PCIe SSD Review.

Page 1 / 2 »