Hot Dog Coma

I’ve been in New York City for two days now. One of the greatest cities in the world; center of the universe, a culinary heaven, full of Michelin star restaurants, and all I keep eating is Gray’s Papaya Hot Dogs and cheap slices of pizza.

I’ve been walking in circles around the 4-5 block radius between 35th and 45th street and 8th avenue with papaya juice in one sauerkraut smelling hand and a cigarette in the other.

There is a mustard stain on my hoody. I am getting ready to fall into a hot dog coma. I couldn’t be happier.

Posted in travel | Leave a comment

Continental Freshwater People

In a recent blog post on the Vonnegut Library blog, Rai Peterson, an English Professor at Ball State University writes about the perception of how writers only come from

“that cluster of states on the east coast that were so small their names on maps had to be written on the ocean.”

One of my favorite quotes from “A Man Without a Country”, is when Vonnegut describes himself as a “continental freshwater person”. This is one of the more interesting ways that I have heard someone describe the mindset that comes with growing up in the midwest. Despite my love for Vonnegut’s work, I am a bit ashamed to admit that until I visited the Vonnegut Museum and Library I had no idea that he was from Indianapolis.

Growing up in Cincinnati Ohio, I also dreamed of becoming a writer and the sentiment that Peterson describes rings true to me to this day.

Later in life, like many others, I escaped the continental freshwater, and found my way to a city by the ocean. Over the last few years I have been visiting every state capital and reading a ton of books along the way. Vonnegut, along with all of the other writers in those lists who did not come from a city by the ocean give me a lot of hope that although writers may end up in the same place, but they can come from anywhere.

Posted in writing | Leave a comment

Lies

I saw a man this morning burning a bible on the sidewalk. He had a blanket over his head and was screaming “LIES” into the street.

Commuters passed him by on their way to work like nothing interesting was going on. Just another day in San Francisco.

I wonder which translation it was.

Posted in thoughts | Leave a comment

Killed the bird

I deleted Twitter the other day. I got tired of the bullshit.

I wanted to tell the world that I did this. But I have no idea how to do that now that I don’t have Twitter.

I’ll probably post brief thoughts here more often. Or better yet, I’ll keep them to myself.

Posted in thoughts | 2 Comments

Bukowski On Writing

I finished reading a book by Charles Bukowski which was supposed to be about his thoughts on writing. What it turned out to be was a collection of stories, letters, and book forwards over the years that are tangentially related to writing.

I enjoyed the book overall but I think that only a Bukowski fan would really appreciate it.

My biggest takeaway from the book is that if I want to be more like Bukowski then I should listen to classical music and drink more wine.

Posted in books, writing | Tagged | Leave a comment

Docker Based Development Environment for Packaging

I started a new repo called sid-builder which provides a docker based development environment for debian packaging. This project follows all of the best practices that were outlined in the Guide for New Maintainers. The benefit of this approach is that you should be able to easily reproduce your development environment on any machine that supports docker. It also allows you to easily run sid without worrying about breaking your system.

I have not actually built any packages using this setup just yet, but I am going to give it a try over the next few days and report back here.

Posted in debian | Leave a comment

Becoming a Debian Developer

I’ve been using debian for as long as I remember. I’ve always wanted to play a more active role in debian development but for whatever reason I never got around to it. Now that I am 30, older, wiser, I am starting a new push to become a debian developer.

So far I have gotten involved in the debian-qa team. Specifically I have been working on fixing some of the newcomer bugs on the distro-tracker project. It’s actually been really fun. The code base is django which I am pretty comfortable with. For the first time in many years, I have been rushing home after work so that I could keep hacking on the bugs that I am working on.

Code contributions are one thing. The thing that I am going to need more practice on is debian packaging itself. This is pretty complex process and I think that becoming someone who can debug and perform packaging issues would bring a lot of value to the project.

I am going to start working on some of the RC bugs (which typically involve at least re-packaging software) to get more comfortable with how other folks have been doing packaging.

In the next few months I would love to bring a new package through it’s full lifecycle.

I hope to be able to look back on this blog post in the future and see how far I have come.

Posted in debian | Leave a comment

Dealing With Flakey CI Commands With a Retry Loop in Bash

One of the most frustrating things to deal with in Continuous Integration is flakey commands. Whether it’s flakey tests, or intermittent networking issues, when your build fails for issues outside of your control not only does it cause frustration, it reduces the trust in your CI process.

One strategy for dealing with this type of issue is to introduce some retry logic into your commands. This can easily be accomplished with good old bash.

For example, pretend that I have $FLAKEY_COMMAND and I want to retry it three times before finally failing my build. I could wrap the whole thing up in a bash loop like this.

counter=1
max=3
$FLAKEY_COMMAND

while [[ $? -ne 0 && $counter -lt $max ]]; do
    counter=$((counter+1))
    $FLAKEY_COMMAND
done

This script will run my command, if the exit code (the output of $?) is non zero (i.e something went wrong) and my counter is less than three, then it will retry the command. You can increase or decrease the number of attempts by adjusting the max variable.

This is not a foolproof strategy, but is one approach to handle flakey commands in your CI pipeline.

Posted in programming | Leave a comment

Notes On Installing CentOS 7 Server

I’ve been on a fedora kick lately, and naturally for my server needs I am using CentOS 7. I have never really used CentOS in production and there are a couple of gotchas that I ran into while getting everything set up that I wanted to jot down for future reference and also in case its useful to someone else.

Install Some Useful Packages

The default install of CentOS is pretty bare bones. I installed several packages to make it a bit more usable.

sudo yum install wget unzip git htop vim epel-release

I tried to get away without installing epel[3], but it’s too darn useful.

Enable SSH Login

I have no idea how or why this works (I think it might have something to do with SELinux), but in order to be able to SSH into your server you need to set up your authorized keys file like this[1]:

mkdir .ssh
chmod 755 .ssh/

# copy your id_rsa.pub file to .ssh/authorized_keys 
# you can do this with a text editor, or if its on github
# download it with wget https://github.com/$USER.keys and 
# rename it to be the .ssh/authorized_keys file 

chmod 600 .ssh/authorized_keys
sudo restorecon -R -v .ssh

After that be sure to set PasswordAuthentication no in /etc/ssh/sshd_config and restart the sshd service for this to take effect. sudo systemctl restart sshd.service.

Install Docker

I used a convenience script from the main docker docs [2], I also added myself to the docker user group in order be able to run docker commands without root.

curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

I am not using the root user to log in, I am using my own user.

If you want to use docker-compose, then (assuming you installed epel-release) you should install pip and docker-compose.

sudo yum install python34-pip
sudo pip3 install docker-compose

Allow outside connections

CentOS uses firewalld[4], it is a bit more complex than what I am used to with UFW, but certainly easier to use than iptables.

You can allow traffic on http and https with the following commands.

sudo firewall-cmd --zone=public --add-service=http
sudo firewall-cmd --zone=public --add-service=https

References
[1]Creating .ssh folder
[2]Install Docker on CentOS
[3]Extra Packages for Enterprise Linux
[4]DO firewalld guide

Posted in linux | 1 Comment

Installing Sage Math on Fedora 28

Sage Math is a massive collection of open source mathematical tools. I am using it as a part of going through the Free Linear Algebra Book.

On a fresh install of Fedora 28, when you run dnf install sagemath you will install dozens of different packages. However, when you try to launch the sage math program you will get an error message saying that sage math crashed.

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.0, Release Date: 2017-07-21                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘

**********************************************************************

Oops, Sage crashed. We do our best to make it stable, but...

A crash report was automatically generated with the following information:
  - A verbatim copy of the crash traceback.
  - A copy of your input history during this session.
  - Data on your current Sage configuration.

It was left in the file named:
    '/home/levlaz/.ipython/Sage_crash_report.txt'
If you can email this file to the developers, the information in it will help
them in understanding and correcting the problem.

You can mail it to: sage-support at sage-support@googlegroups.com
with the subject 'Sage Crash Report'.

If you want to do it now, the following command will work (under Unix):
mail -s 'Sage Crash Report' sage-support@googlegroups.com < /home/levlaz/.ipython/Sage_crash_report.txt

In your email, please also include information about:
- The operating system under which the crash happened: Linux, macOS, Windows,
  other, and which exact version (for example: Ubuntu 16.04.3, macOS 10.13.2,
  Windows 10 Pro), and whether it is 32-bit or 64-bit;
- How Sage was installed: using pip or conda, from GitHub, as part of
  a Docker container, or other, providing more detail if possible;
- How to reproduce the crash: what exact sequence of instructions can one
  input to get the same crash? Ideally, find a minimal yet complete sequence
  of instructions that yields the crash.

To ensure accurate tracking of this issue, please file a report about it at:
http://trac.sagemath.org

Hit <Enter> to quit (your terminal may close):

If you inspect the error file found in $HOME/.ipython/Sage_crash_report.txt you will see that there is a missing python dependency.

ImportError: No module named cypari2.gen

You can fix this error by installing the missing dependency with:

sudo dnf install python2-cypari2

Now you should be able to launch Sage Math without it crashing.

Posted in linux | Tagged | 2 Comments