Static Websites with Hugo

I created a website back in 2010. It’s a professional website. It has a personal profile, description of the work, location and contact page. None of these change with any regularity. So, I just needed a few static pages.

I wanted to get up something quick. So, I had coded what I needed over a week, wrote all the copy and put the site up. Back then, around a quarter of the population had a smart phone, so it did not seem necessary to worry about mobile access to the site. So, I have a great site that works well for the PC. But, it’s useless on mobile. That’s not going to work in 2019.

But, I’ve been dreading doing the update. I figured it would be an unmitigated pain to code a site that worked across platforms. Being inclined to take the easiest route to solve a problem, I thought I might check to see if there was some free software that would help me make the transition with a minimum of fuss.

Turns out, there’s a lot of open source software to build static websites. Jekyll and Hugo are probably the most popular. But, Wintersmith, Harp, Middleman, and others are all viable options. I ended up using Hugo because of the two top options it didn’t require installation of any additional software on my system.

It ended up taking about two days to port the website content to Hugo. Most of the time was just understanding how Hugo works, such as the need to create directories and then put an index.md in each of them to get the content to link up right from the main page.

In retrospect, there are two main considerations in this process. One, pick a system that will convert your old website for you, if you have a large site. For small static sites like mine, this really isn’t a problem. Two, make sure whatever you use has good theme support and choose a theme that has the built in look and feel you want for your site.

For example, I looked at Nikola first, but its theme support is largely non-existent. It became apparent I’d have better luck choosing the top two options after looking at this one.

Once the choice of system and theme is made, the coding and porting of sites is pretty straight-forward. I did have to noodle around a bit with templates to get the result I wanted, but it wasn’t much different from using HTML, just at one level of abstraction.

If you have the need to put up a small website that works on both PCs and mobile, using a static site generator like Hugo will save you a lot of time and be relatively painless. Recommended.

Personal CRM Done Right – Monica

“Monica helps you organize the social interactions with your loved ones.

Organize. Follow-up. Strengthen your relationships.

Monica is for people who have jobs, a family, and are busy trying to find a good work/life balance. So busy, that they don’t have time anymore to remember to call a friend, say happy birthday to a nephew, or remember to invite someone special for dinner next week.”

Monica

Either a sign of an impending Apocalypse or exactly what you’ve been looking for. Take your pick.

Why I Use Old Hardware

“My 11-year-old laptop can compile the Linux kernel from scratch in 20 minutes, and it can play 1080p video in real-time. That’s all I need! Many users cannot afford high-end computer hardware, and most have better things to spend their money on. And you know, I work hard for my money, too – if I can get a computer which can do nearly 5 billion operations per second for $60, that should be sufficient to solve nearly any problem. No doubt, there are faster laptops out there, many of them with similarly impressive levels of compatibility with my ideals. But why bother?”

—Drew Devault. ” Why I Use Old Hardware. drewdevault.com. January 23, 2019.

One of the advantages of using free software is that support for old hardware tends to get better. The more free you go, say to the level of wanting a free bootloader such as libreboot and all free software drivers, the more likely you are either using old hardware or you are spending a lot of money for a free machine from companies like Purism.

My main computer is a Lenovo Thinkpad T400 with libreboot. You can buy one for <$150 on eBay.

Setting DNS Manually on Ubuntu Linux

Introduction: Domain name servers (DNS) provide the numerical addresses for sites on the Internet. When you type cafebedouin.org into your browser, your computer queries a DNS name server to get a numerical address. This numerical address is then used to contact the site.  Normally, configuring DNS is handled behind the scenes by Dynamic Host Configuration Protocol (DCHP) automatically.

For some situations, you’ll want to set a different DNS server than the one set by DCHP. Maybe your Internet Service Provider (ISP) uses their own DNS server that is slower than Google’s DNS server. Maybe you use a Virtual Private Network (VPN) and want to stop DNS leaks to your ISP.

In Linux and other UNIX-like operating systems in the past,  you would change configuration files, such as /etc/resolv.conf or /etc/dchp/dhclient.conf, to set DNS manually. 

The problem: Changing resolv.conf and dhclient.conf configuration files does not work in Ubuntu.

The solution: Starting with 17.10, Ubuntu uses netplan to set DNS. On my test machine, netplan’s configuration file looks like this:

version: 2
   renderer: NetworkManager

It is possible to manually do the job of DCHP in netplan, but it’s complicated. If your objective is to just change the DNS servers, there is an easier way to do it. Use Network Manager.

There are files in the directory /etc/NetworkManager/system-connections that define how DCHP should work for each network connection. To the files listed in that directory, add the following with DNS server IP addresses under [ipv4]:

dns-search=
method=auto
dns=84.200.69.80;84.200.70.40;45.33.97.5;
ignore-auto-dns=true

The DNS servers in this example are from FreeDNS and DNS Watch.

After adding the DNS IP addresses, separated by a semi-colon, then from the command line, do: sudo service network-manager restart

Once completed, you should be on your DNS server of choice. It’s a little inconvenient to have to add these lines to each network-connection file, and there might be a better way. But, this will work.

Freedom & Limits: The ASUS C201 with libreboot and Parabola Linux

Unfree BIOS Software

Surfing the web one day, I came across a mention of libreboot, a free software replacement for BIOS firmware used to load and run operating systems that’s been around since December 12, 2013. For many years, the only system you could buy with a free BIOS that could run free software was the Lemote Yeelong. Prior to that, every system ran nonfree BIOS system to initialize the computer prior to starting the operating system.

Unfree Software Everywhere

Unfree BIOS software is not a unique problem. Most elements of a computer are run using software that’s secret. For instance, none of the modems that are responsible for cell phone network communications run on free software. No one knows exactly what that software does, except, perhaps, the people that created it.

Same is true of wifi. There are also only two wifi chips with free software drivers. The rest require blobs. Blobs are black boxes. You can know what goes in. You can know what comes out. But, you’re not entirely sure what happens in the middle.

Controller firmware, CPU microcode, graphic acceleration and many other elements of a modern computer system are almost always proprietary. Unfree software is the norm.

Free Software: Who Cares?

If it is a norm, why should anyone care about free software? People in the free software world often talk about free as in beer, i.e., it does not cost anything, opposed to free as in freedom, which enables people to do things they otherwise wouldn’t be able to do.

One example is a car. All modern cars have a series of electronic systems that control every facet of the car’s operation. When those electronic control systems are proprietary, it can mean that owners of the car can be compelled to see an auto mechanic rather than repair the car themselves. Or worse, a manufacturer could decide to not share information with auto mechanics and establish a system where car owners would have to go to a dealer to get their car repaired.

Proprietary software puts the owner of the software’s copyright in control. Free software, at minimum, reliquishes the copyright and gives that control over to the user of the software or the hardware it powers. In some cases, it tries to exert control over the process, making it a requirement that improvements also have to be shared under the same conditions that the original software was shared.

Free software is fundamentally about empowering people. You might not care about the code running your car, but you likely do care if that code limits the supplier of repair services to a monopoly that charges significantly more than it would if it had competition.

Enter libreboot

Looking over the libreboot site, it is clear the BIOS problem persists. There are a handful of systems that can run libreboot. Most computer systems run a lot of proprietary software, e.g., BIOS, device drivers – such as wifi, controller firmware, CPU microcode, graphics acceleration hardware, etc. Under these conditions, is it even possible to run free software? If there is going to be compromises, what is an acceptable level? How much inconvenience will it entail?

Freedom always comes at a cost. In the modern world, the cost is often in convenience or capability. But, the reality is that we often have no idea what something costs us, as individuals or as a society. It’s not until we struggle with a different, perhaps even radical position, that the standard quo has a foil to make these costs visible.

I found such a foil while looking at the libreboot site and read this quote in the documentation for the only ARM laptop compatible with libreboot, the ASUS C201:

In practise, you can (if you do without the video/wifi blobs, and replace ChromeOS with a distribution that respects your freedom) be more free when using [an ASUS C201 than other libreboot systems that are Intel based].

What does “more free” mean? On the ASUS C201, the embedded controller firmware is free software, and there is no microcode. On ARM CPUs, the instruction set is implemented in circuitry, without microcode. If you choose not to use the wifi/video blobs, you can make the system about as free as is possible in the modern computing landscape.

Getting There From Here

It’s a bit of work to make the ASUS C201 run with free software. I bought one with faulty wifi from eBay for $52 dollars and a wifi dongle with a free Artheros chipset for $31 from Think Penguin. I then got the low end iFixit tool set to take apart the laptop for $25, removed the write protection screw, installed libreboot, installed Arch Linux on a SDCard I bought for $20 and then converted Arch Linux into Parabola by switching the depositories. For ~$130, there was a lot of educational value in the exercise, and the end result was a usable laptop that is my daily driver. Not bad. But before you go off and try it yourself, let me share some of the bad news.

All the instructions mentioned the possibility of making the computer unusable or damaging it while installing libreboot. In my case, I did manage to put a small crack in the top of the laptop in the course of prying it open. I ended up covering it with a sticker. Problem solved.

It is also possible to make a mistake flashing the firmware with libreboot and “bricking” the machine, which is always a possiblity when flashing firmware. It didn’t take the first time for me, but it didn’t seem to cause any problems either.

There are also other issues that can come up. For example, if you are not familiar with the command line and mounting usb or sdcards, you might not know that you need to use a set of commands like the following to transfer the libreboot files from a usb drive to the C201 in the first place, which the instructions assume you know how to do and don’t specify:

# cd /
# mkdir libreboot
# mount /dev/sdb1 /libreboot
# cp /libreboot/libreboot.img /

You can also make mistakes when installing the operating system, such as missing part of the long command to partition the table properly. Assuming you can get the whole thing to boot, then you have to set-up the Arch Linux distribution from scratch.

Arch Linux starts with a minimal distribution, and it is built around the idea of you create the distribution you want, with only the most up-to-date software. Prior to this experiment, I used primarily Debian. Arch Linux showed me was how many decisions Debian was making for me during the installation process. You could say that Debian is more focused on stability and ease of use.

July 2019, Update: After installing Arch, Parabola and Devuan on my ASUS C201 machine. I finally got the Debian-based distribution PrawnOS working from internal storage. At this point, this is the distribution I would recommend for this machine.

So, the initial process was reevaluating software. On Debian, Gnome is the default, but it will not run on an ASUS C201 because it doesn’t have the video acceleration required to run it well. I found myself trying a number of window managers and eventually settled on ratpoison, a tiled window manager, that would work well with the limitations that free software on the ASUS C201 required. Hot tip: “ctrl-t :” will bring a text box up in the corner, then you can type “quit”, without quotes to exit. It took me a bit to learn that detail.

The graphics limitations of the ASUS C201 tended to encourage the use of the command line, just as working with OpenBSD did. The command line is something every user of a UNIX derivative should know in some detail, including Macs.

Debian also does some of the basic set-up for you, such as creating users, installing base software like sudo, or getting wifi to work. Arch Linux largely doesn’t, although setting up wifi through wifi-menu was easy.

Then, there is switching your distribution from Arch, which allows some proprietary drivers, to Parabola, which doesn’t. This leads to additional issues, like an update of the machine made a fully-functional touchpad useless. Was it a software upgrade of X or a firmware upgrade to the touchpad driver? Probably the latter, but the end result is that I try to keep to the command line where using a mouse isn’t necessary.

Another thing cutting down on my use of graphics? Apparently, the icu package (International Components for Unicode) updates every 3 months, but it breaks iceweasel, the only free software graphical browser that will run javascript and render pages correctly. I’ve since learned how to downgrade packages from cached packages on the machine. However, in the process of learning, I cleared the cache. I ended up having to wait six weeks to get an unbroken graphic browser package. Part of the delay is because the dependencies in the browser are written for specific versions of icu, and so they break every time it is updated. Part is because the ARM architecture doesn’t get the same kind of support as other architectures, because the number of people using it is much smaller.

The Point

So, what’s the point of this long litany of issues with making an ASUS C201 a free software machine? I think the main value is the exercise of rejecting the default option and choosing for ourselves. That’s what free software offers. You may not want the freedom, but sometimes just making an effort in that direction helps us to evolve into people that appreciate options beyond those that are offered by default.

In this case, the default is to use ChromeOS. It provides a safe, relatively secure computing environment where people can browse the web, read email, use networked Google software applications and such, and the price for the machine is minimal. However, there is a price to be paid in freedom. Convenience is offered in exchange for agreeing to become the commerical product of Google. For some people, this doesn’t bother them. They might even view it as a benefit. Since Google knows so much about them, the advertising driven by Google might help them to make better purchasing decisions.

Trying to swim against the default stream, whether it is the defaults of Google or a particular Linux distribution such as Debian, means a lot of work. It also means inconvenience, where hardware doesnt work like it should or graphical browsers remain broken for months. But, I would argue that taking the risk of bringing your computer, accepting a restraint like “free software only”, having to try new alternatives, etc., all leads to a mindset worth cultivating.

Even if you think concerns about free software is a kind of zealotry, there are kinds of knowledge that only a zealot can know because they are willing to accept limits others will not. There’s an education to be obtained in doing it. The only question is whether it is worth it to you.

The Plain Person’s Guide to Plain Text Social Sciences by Kieran Healy

The Plain Person’s Guide to Plain Text Social Science is written for graduate students in the social sciences, but useful for any writer. For people not doing sophisticated data analysis, the key suggestions are to use a text editor like Emacs for writing, Markdown for formatting, git—such as on GitLabs—for version control, and a translator program like Pandoc to translate your text file into a variety of formats, such as epub, pdf, doc and so forth. Additionally, he strongly recommends automated backing up of your data with a cloud service. He mentions two standards but if you go that route consider a privacy focused service like SpiderOak, or the free software alternative, NextCloud.

Details

The Plain Person’s Guide to Plain Text Social Science is worth reading for anyone involved with writing, research or data analysis. It introduces the problem of thinking about the tools that we use to do our work and serves as a technical primer for a particular style of writing.

Kieran Healy starts with a dichotomy, c.f. Section 1.2. There are two computer revolutions. One revolution is trying to abstract out the technology and present people with an easy, touch interface to accomplish specific tasks. Using your phone to take a picture, send a text message, post to social media, play YouTube videos, etc. are all examples of this type of technology. It’s probably the dominate form of computing now.

The other revolution are the complex computing tools that are being developed that cannot be used via a touch interface. At this point, there is no way to use an open source neural net like Google’s TensorFlow in a way that is going to make sense to the vast majority of people.

As we move to using a keyboard, this tension can be seen in the different types of tools we can use to write, research and do analysis. Microsoft Word, PowerPoint, Excel, Access, etc. were designed to be digital equivalents to their analog predecessors – the typewriter, the overhead projector, the double entry account book or the index file. Of course, the digital equivalents offered additional capabilities, but it was still tied to the model of the business office. The goal for these tools, even as they include PivotTables and other features, is to be relatively easy to learn and use for the average person in an business office.

The other computing revolution is bringing tools to the fore that are not tied to these old models of the business office and is combining them in interesting new ways. But, these tools have a difficult learning curve. For example, embedding programming code that can be written into a text analysis to generate calculations when it is typeset is not a feature the average person working in a typical office needs. But, it clearly has some advantages in some contexts, such as for data analysts.

Complexity makes mistakes easier to make. So, it requires a different way of working. We have to be careful to document the calculations we use, track versions from multiple sources, be able to fold changes back into a master document without introducing errors, and so forth. The Office model of handing a “master document” back and forth and the process bottlenecked waiting for individuals making revisions isn’t going to work past a certain minimum baseline level of complexity that we are slowly evolving past.

So, laying out this case, he then suggests various tools to consider: a text browser such as Emacs, Markup for formatting, git for version control, Pandoc for translating text documents into other formats, backup systems, a backup cloud service, etc. All of these tools are equally important to complex writing of any sort, whether it be for writing long works of fiction, research analysis, collaborative writing, and other circumstances we are more likely to find ourselves in, which these more powerful tools help make possible.

2018 Experiments, 1st Quarter Follow-up

New Year resolutions always seem like an exercise in futility. Everyone does them. But, it is difficult to get the social support to make any kind of New Year resolution work. Failure is expected. Starting out in the aftermath of a holiday like New Year’s Eve probably doesn’t help much either.

New Year’s resolutions tend to focus on one big change, and they are rarely conceived in such a way as to accommodate the inevitable failures of implementation that come with trying anything new. And when doing something, you always learn things that differ from our preconceptions when starting out. So, you have to build in some flexibility into your program, and a resolution tends toward absolutes.

All of this is true of the changes I tried to make at the start of 2018. I started in December 2017 trying to eat a ketogenic diet, start a HIIT Burpee and Running Program, and consistently do some form of meditation.

On the ketogenic diet, it is possible to lose a significant amount of weight. Within a few weeks of starting it, I lost just over ten pounds, probably the bulk of it due to water weight.

However, I found it difficult to stick to because eating is such a social activity. Invariably, there was a birthday party, a holiday, or some other social occasion where people encouraged me to come off diet. If I ate one thing, the next comment was, “Well, since you already ate cake, why not have some cookies too?” The holiday season was particularly challenging.

In retrospect, my suggestion is to not tell anyone that you are on a diet, whether it is ketogenic or some other type. As soon as people hear that you are on a diet, I believe social forces kick in, and people will try, likely not even consciously, to bring you back to your default routine. Few people will support your effort, particularly if your diet impacts them in any way.

If you are lucky enough to have a spouse or significant other joining you, it will be much easier to keep on diet. If you are on your own, you’re on your own. Keep a low profile and use excuses like you aren’t feeling well, aren’t hungry, and so forth to skip eating when out. Socializing is a killer of diets. If you like socializing, eat before you go and try to find activities where you are active and not eating.

I haven’t been following a ketogenic diet closely for several weeks. I started again in April, but I plan to keep it low profile. Thankfully, the few people that might read this post don’t care what I eat.

The HIIT Burpee program has been the biggest success thus far. Doing the program is probably another factor in why I am not taking off any weight, quite the opposite actually.

I started with the idea of 12 sets of timed burpees. But, in retrospect, the key issue is not time but the number of burpees per set.

The program probably should just be setting an interval timer with budgeting about 3-5 seconds per burpee in the set and then take a minute rest in between sets. With 12 sets, the whole thing can be done in less than 20 minutes. But, it should be noted that it hurts, and it probably shouldn’t be done more than twice a week.

Start from 1 per set and work your way up. If 12 sets is too much, do 2 rounds of 6 sets or 3 rounds of 4 sets, with 3 to 5 minutes of rest to catch your breath per round. If you do these exercises on concrete, it helps to wear a set of leather work gloves if you don’t want bloody finger tips.

In the beginning of the HIIT program, I also laid off doing any running because the program is punishing. Until you adapt to the program, don’t try to do anything else. I went from 3 per set and a total of 36 burpees to 6 per set with a total of 72 burpees, for the last five weeks. There has been significant increases in tone and muscle, even over this short period. I have missed 3 out of 28 sessions. I think it makes sense to plan for a week off every quarter, which wasn’t in my original plan. I am going to start trying to work in some running sessions this quarter.

As for meditation, I did manage to do around 50 consecutive days of meditation. Overall, I think it is a good practice. However, I had problems with my android phone I was using to time the individual sessions, and thereafter, I haven’t been regularly doing it.

The problem with my phone ended up being an opportunity. I learned how to get an inexpensive phone set-up with LineageOS. Then, I used the same idea and changed my primary computing platform, buying an old ASUS 201 laptop with bad wi-fi and adding a usb wi-fi adapter and installing Libreboot and Parabola Linux, all for $83.

Parabola is an Arch distribution, which took some getting used to changing from Debian. But, it was not too bad a transition. I find I spend more time on the command line and associated tools in it, e.g., this post was written in Emacs and posted to cafebedouin.org using org2blog. Hopefully, the org2blog set-up will help me to write more original content for cafebedouin.org.

Also I also am trying to stick to a reading list. I have been putting any new books I hear about on a preliminary list for next year rather than trying to read them. I haven’t really been reading much over this quarter. I have been sidetracked on a series of other projects. But, today, I am recommitting to reading and writing more, doing daily meditation, twice a week physical training, and eating better. I’ll follow-up in three months, and we’ll see how it goes.