Subscribe

  • Write protecting resolv.conf might stabilize your VPN connection

    Setting up your headless Linux machine to connect through a VPN is straightforward. Install OpenVPN and download the configuration provided by your VPN service. That’s usually all there is to it.

    Making sure it stayed connected took a little more effort on my Raspberry Pi, unfortunately. It would connect quickly, but after an hour or two the connection would drop with the following error in my syslog:

    ovpn-nl[23140]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
    ovpn-nl[23140]: TLS Error: TLS handshake faile
    

    Nothing I changed in the configuration fixed the issue.

    I did remember how switching the VPN connection off and on would change the contents of /etc/resolv.conf. It would apply the name servers belonging to either my router or my VPN service. Instead of replacing the ones already there, it would just add them to the list. This is incorrect and seems to be the source of the problem I experienced.

    After setting my prefered name servers and then write-protecting /etc/resolv.conf my connection has been stable. The command to prevent changes being made to resolv.conf is this:

    $ sudo chattr +i /etc/resolv.conf

  • Restarting your MacBook resolves right-click Touchpad issues

    Right-clicking is a pretty common, simple procedure. On a MacBook you put two fingers on the Touchpad and push down. A menu pops up, you select one of the options and that’s it.

    Now, imagine you need to apply double or triple the amount of force for this to happen. You really need to push hard and put some effort into it. That’s how my MacBook right-clicked up until five minutes ago. I have one of the infamous 2016 models and immediately feared its end was neigh. Luckily I tried ‘turning it off and on again’ before writing it off then and there.

    After a quick reboot the issues seems to be fixed. 🎉

  • jekyll-admin is pretty convenient

    Jekyll has been my go-to tool for all my websites for a few years now. From a technical perspective, it’s ideal:

    • The server requirements are minimal (because it’s all statically generated).
    • Hosting is relatively risk-free (because it’s all statically generated).
    • It’s highly customizable and flexible.
    • Jekyll plays nice with various front-end frameworks.

    I could go on.

    The two major downsides are deployment and creating content. The former because you’ll have to manually generate and deploy your site after each change. I’m aware that there are ways to improve this, but haven’t seriously tried any yet. Creating content is cumbersome because you’ll have to create a new file (or rather copy an existing post or page) and edit its content in your prefered Markdown editor. I enjoy writing pots in Vim, but having to manually create a file, add the proper metatags etc. keeps me from adding quick entries.

    Today I came across jekyll-admin.

    A Jekyll plugin that provides users with a traditional CMS-style graphical interface to author content and administer Jekyll sites.

    The jekyll-admin post editing interface

    Benefits

    It takes away many of the manual labor involved in creating a new post and introduces an easy to use interface to write content. I’m using it to jot down this entry and I could easily get used to this.

    • The WYSIWYG editor is nice, eventhough I’ve used the Markdown tags enough to not depend on the buttons provided.
    • Adding a new post is accomplished by pressing a single button.
    • Previewing is another press of a button.

    Small improvements, but I welcome anything that lowers the threshold to start writing. The installation takes about ten seconds:

    Installation

    1. Add the following to your site’s Gemfile:

       gem 'jekyll-admin', group: :jekyll_plugins
      
    2. Run bundle install

    Downsides

    Vim shortcuts are not available, obviously. Maybe I’ll end up just using the UI to create posts, then do the writing in a terminal window.

    Another thing – that honestly feels like a bug – is that the metatags have to be entered from scratch, for each post. It’s worth the effort to go in and see if I can add my prefered behavior to the project.

    Update: The admin interface automatically picks up on the front matter defaults. Simply adding the following few lines to the _config.yml file will prefill the corresponding fields in the content management system.

    defaults:
      - scope:
          path: ''
          type: posts
        values:
          layout: 'post'
          tags: []
      - scope:
          path: ''
          type: pages
        values:
          layout: 'page'
          menu: true
          menu_title: ''
    

    jekyll-admin does not automatically set the proper metatags

    Conclusion

    This is hardly a thorough review; all I did is write this signle post. The added convenience is undeniable, though. I’m positive jekyll-admin will help me to post more often. Famous last words.

  • Install and use pip without sudo

    I’m used to installing and running my Ruby gems in user space with the help of rbenv. I wasn’t aware of a similar setup for Python, until today.

    This Gist by Matthew guides you through all the steps you need to take. It’s quite simple, really.

    # Uninstall sudo-requiring pip (only if pip is already installed)
    sudo pip uninstall pip
    
    # Download pip
    curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
    
    # Install pip with the --user argument 
    python ~/Downloads/get-pip.py --user
    
    # Add Python's bin folder in ~/Library to your PATH environment variable
    echo 'export PATH="$HOME/Library/Python/2.7/bin:$PATH"' >> ~/.bashrc
    
    # Reload your config
    source ~/.bashrc
    

    Matthew mentions to remember to append --user when installing modules:

    $ pip install <package_name> --user
    
  • Some lubrication all but silences your Dreamcast

    I recently purchased a Japanese Dreamcast, after getting a Japanese Sega Saturn before. They’re pretty great. The main benefit being cheap hardware and relatively inexpensive games. Here’s a pretty good example, check out these two Saturn Bomberman games:

    Saturn Bomberman US

    Saturn Bomberman Japan

    Anyway, the downside of getting a Japanese Sega Dreamcast, is that it is loud. Extremely loud. Just listen to it:

    After switching mine on for the first time I was convinced it was broken. PAL Dreamcast aren’t exactly whisper quiet, but this is something else.

    Luckily there’s a way to reduce this dramatically. This video by Mark Fixes Stuff goes over the process of lubrication the gears in the Dreamcasts’ GD-ROM drive. Disassembling the device takes some time, but it’s a very straight forward process that pays off immensely.

    At the 18.48 second mark, you can hear the difference. Definitely worth the effort. If only my step-down converter (European 220V to Japanese 110V) could be silenced the same way… I currently use one half of a clothespin that’s wedged between a radiator and the converter in such a way that it presses down on a specific part of the container, which reduces the buzzing to a minimum.

    Step-down converter silencer

    While the Dreamcast was disassembled I also replaced the internal battery, so it saves the date information when it loses power (every time I turn off that horrible step-down converter).

    Replace Dreamcast internal battery

    If you’re comfortable around a soldering iron, it’s a trivial procedure. Desolder three points and install one of these. Pro tip: don’t pay any more than a few cents for these vertical holders.

    And that’s it, my Dreamcast runs pretty silent for a Japanese model and it remembers the date. 👌