New Tools for an Improved Workflow

 — 

Kasim Tuman recently wrote that Emacs is like a workbench. It evolves as you get better with your work – or changes as your works changes. I think that is a great metaphor of not just Emacs, but software development tools in general. So this post is about my evolving workbench. My workflow has changed a lot in the last few months to a year because of different tools I discovered and have put into practice. This came as I switched from Java to Python as my primary language. Some of these changes are Emacs-related and some are not. Yet everything kinda coalesces together into one harmonious system and suddenly things become a lot easier.

As I said above, I've been using Python almost exclusively in the past year. I haven't fired up Intellij in months and, frankly, I haven't missed it. Yes a full IDE would give me things like refactoring support but in Emacs I can open up many files and look (and switch to them) with ease – something that Intellij never did for me. It's effort in the JetBrain's world – in Emacs, I do it with muscle memory and routinely am looking at 4 files at once. One time a co-worker was working with me on something and I quickly deleted some files with Dired and he stopped talking. I asked him if I messed something up and he said, "No I just saw you manipulate files while inside Emacs and I'm still recovering from that."

Anyway my independence from Intellij has freed me up to explore other tools to help me with my software development work and I like what I have built up.

Docker

Just as a development tool, things get a lot easier with Docker. Setup a docker-compose.yml file for a database and another other extra services for my projects and suddenly I have a solid local development environment where I don't have to sweat if it will work on a server. You can setup multiple services in one Docker file (I had PostgreSQL and RabbitMQ in one file, for example). It's really as easy as a google search for "docker <service you want>", click one of the first links, and put their snippet into a docker-compose.yml file, and then run docker-compose up -d.

tmux

Tmux has been in a my tool bench for a long time, but I have started using it with a renewed fervor. Mostly because I have 2-3 projects (if not more) going on at once. It's hard switching CLI's back to that and having a config for it. direnv helps a lot, but doesn't give everything. I found tmux-ressurect, which saves the state of my Tmux prompts. So now when I need to switch a project, I just go to my Tmux-powered prompt and switch. Forced to reboot? I just start Tmux and run my tmux-ressurect command (Ctrl-\ Ctrl-r) and I have everything back from before the reboot.

I will say that I've been using the zsh less and less lately, mostly because Projectile has been taking most of my shell usage away from me. I have been using eshell a lot lately and that is good enough for simple things. The Emacs terminals like ansi-term just fail on REPLs, etc. I played a bit with the vterm module and it shows promise but has a ways to go for my usual workflow. I like that tmux is always there and switches contexts with few problems. It's hard giving up years and years of aliases that you are used to. See my tmux config to see how I set things up.

direnv

If Emacs is my IDE, then direnv runs my config file that the IDE reads. So as the .idea folder is for Intellij IDEA, so is my .envrc for my Emacs/shell setup.

I use direnv for project-specific environment variables (like AWS_PROFILE and even custom PATH). But you can do more than that: I talked about this on my employers blog but I use it to manage my Python environments as well. It took me a bit to find it, but emacs-direnv makes Emacs read it and follow it. Then Emacs knows all about which Python environment I'm using. That makes a lot of things easier. All I have to do is open the project in Emacs and poof it's pointing at the proper Python environment. My only real complaint about direnv is that it doesn't have a parent structure – that I can't declare environment variables on the top level (like AWS account info) and have that go into the direnv-enabled folders below. Recently I started doing source /path/to/some/common/file and that works – you need to use the fully-qualified name to make sure it works. Not quite as nice as just using a parent folder, but it works really well.

Emacs Stuff

Yes, Emacs needs it's own list of things. This part of my workbench is always evolving but I got into a group of tools that have been fairly consistent lately. You can see my Emacs shortcuts here, which give you an idea of what kinds of things that I use.

Projectile

I've had Projectile in my Emacs config for a long file, but haven't used it until the last eight months of so. It has now become the general way I interface with files and buffers in Emacs. Everything is a project (which is easy – it just has to have a .git folder in it). Then I can find files in the project, switch buffers in the project, search files in the project, and compile (or run) the project from any buffer opened in the project. This integrates with ease with direnv and Helm. So, I can find a file in the project via Helm and the search project results buffer is also in Helm.

Let's also not forget that Projectile comes bundled with Prelude, which is a really nice little Emacs starter. My favorite part is that you can put your own Emacs configs under ~/.emacs.d/personal.d where you put your own configs… not having my mess with the main Prelude/Projectile part is nice.

Helm

My newest Emacs addition and, honestly, I'm not sure how I got by without it. I tried to use it before but I didn't get the hang of it. As I mentioned above, Projectile can use it and that got me going with it again. Now I flip through buffers and filenames with ease. So easy to switch to another file. And the interfacing it with M-x to find functions is great I find useful functions I didn't know existed – like pytest-one and pytest-all, which now I use all the time.

Magit

When I first started using Magit, I found it confusing and didn't know what the hype was about. I stuck with it, and figured out how it was structured and the way that it wanted me to work. I found that it's way of dealing with git was smarter than my way. It has now became my preferred way to deal with Git – not just committing, pushing and fetching, but also looking at logs and branching and everything else. I never would have believed I would have given up the command line with git, but yet I have.

Closing

I'm enjoying this freedom from in my current set of tools. I find it much quicker to get a lot of things done, switch projects, etc. Some of these things have been kind of "set it and forget it", which is nice until you need to setup it again.

A big question – how will this work when I go back to Java development? Not real sure that this setup is good for 100% Java… but I could see myself using both this sort of setup with Intellij… use the strength of both. Of course, maybe I will find a different list of things to be using a different list of tools from this list by then.

Category: tech

Literate Dotfiles

 — 

For several months, I've been converting a few of my dotfiles into OrgMode files and using tangling to generate the config file and the same file generates HTML documentation. The point was to always publish them – and I finally have. See the HTML version or the github project. Note that the Org files are rendered in Github because Github is smart like that – it treats them the same way that it does with Markdown.

I stole, er, borrowed the system from Toon Claes. And, yes, I have had to edit a Makefile to do this.

I found this documentation on my files to be more useful than I thought. Besides just the documentation of "why is this here" but it also helps in "why am I adding this?". Because the ultimate source is an Org file, I can do a better job documenting why I did something in the file then in the comments of the file. I can (and really should) link my config file to my OrgMode-powered knowledge base about what each thing does. That doesn't give the Internet reader much help, though. But is this documentation more for me for them? That I'm uncertain about.

So why call this "literate"? It's not my word – it's Donald Knuth's. Basically it's keeping the documentation and the code together. Wikipedia has a good overview on it.

I already repeated a lot of links from the Readme of this project. Hopefully these files are helpful to someone.

Category: tech

On Music

 — 

It's funny as I have hit solidly middle age, when you figure things about yourself that have always been there – but you have just noted it. I can list quite a few things – both positive and negative. But what the one I have just simply noticed is music.

This should be a surprise when I talk about managing a mount of music but cognitively it didn't hit then. It started when I told people about it and said "I imported in about 5k MP3's with it" and their eyes get wide. I guess people delete MP3's? is that a thing? Well it's not for me.

I think music has always been there. I mean, old hymns in church bring back a lot of nostalgia for me. And my kids are constantly amazed how I can sing along songs on the radio. Or on my 5K collection that I put in the car (which of the big triumphs of my nerd career). I generally can pick out a song I know within the first few seconds of it starting. I have less success with some songs but most of the time I can pick out at least the artist. I don't need music on all the time (though I do prefer working some playing on my headphones).

I'm not sure why I'm wired this way. I didn't come from a musical family. I can't sing very well (doesn't stop me from singing along) and I played instruments in grade and high school but haven't kept it up. But there is something about music playing that soothes me.

And some random notes about this subject:

  • I don't have a favorite song, or a favorite genre. I like about everything – jazz, country, heavy metal, pop….
  • That said, I think Stevie Wonder's Songs in the Life is probably one of the greatest albums ever recorded.
  • In my post I linked to above, I said I use Nightingale to play music. Well, Nightingale hasn't been updated in a long while and Mojave said it may not work in new versions of MacOS. So I moved to (and purchased) Swinsian and haven't regretted it. I don't use most of it's power but, at it's core, it's like iTunes before iTunes sucked.
  • This old Lifehacker article was my guide for putting together Smart Playlists to keep things fresh and manageable. They do it with iTunes but the same functionality exists in Swinsian
Category: misc

Review "Relay"

 — 

I'm not sure how many other people remember Nextel but I do, maybe because my first job out of college used them a lot. They had one really cool feature on their phones – a walkit-talkie like functionality. You could hold a button and talk, and people on your list of numbers would get it. You could have a conversation or call for help. It worked pretty slick. Sprint bought, or merged, with Nextel and this functionality faded into history.

I was reminded of this great idea when my first told me about Relay, which is a little square device that lets you do something similar. Its designed for kids and it's literally a button with a speaker – you push it and talk into it. People on your same plan with a Relay, and with the Relay app on their phone, can hear what you say and you can talk back and forth. It also has GPS so you know where your child currently is. The Relay is created by Republic Wireless, and you have to use their network, which is one of the bad things, IMHO. At least for us, not all the networks that RW used (TMobile and Sprint) aren't always great where I live. But I have found Relay support is good – for example, they sent me a replacement SIM card when I was, er, mu cking around with ours. The support person noted that Sprint would be better for us than the TMobile card that they originally sent us, so they sent us a Spring SIM instead. And, yeah, it does work.

Now I can run errands while my son is home during the day and I can message him where I am, and when I'll be home. Or he can be at a friend's house and I can make sure that he is there. We love it and it has made our lives a lot easier. If you are interested, here is an affiliate link for a free month of Relay. I think it's very worth it.

Category: tech

RSS Reader

 — 

I've gotten back to blogs again. And that meant I needed an RSS Reader. The qualifications:

  • web-based but have an Android app
  • interface gets out of my way to read an article
  • favorite support
  • syncs often
  • still under active development
  • ability to pay a reasonable price for the service (because it's useful for me)

In the past, I've installed readers myself and had it fetch updates, but I don't have the time to really monitor a server anymore. I once used Feedly so I loaded that back up. I paired down the feeds to blogs I was more likely to read and ones that were still updated. And went from there.

Here was what drove me crazy about Feedly:

  • Feeds weren't refreshed very often. Faster updates were a feature of a paid account. I can see that (but didn't like it)
  • Searching for stories/feeds was limited if you didn't pay. That never sat well with me.
  • The Android app didn't sync very well. So an article I read an hour ago on the web would be unread on Android. Apparently this has gone on awhile and it's not solved by paying money.
  • The paid price was too high for me. I'd like something in the middle with fewer features. But it was all or nothing.

I started looking for an alternative this spring. I thought seriously about The Old Reader but the lack of an official native app stopped me. Somehow I stumbled onto Inoreader – not sure how. I had never heard of it before and did some digging and it's ran by a Bulgarian company. No matter – it got good reviews and from what I read it's "for power users". And that's kind me. And it's what I stayed with.

It's interface is seemingly like Google Reader or, er, The Old Reader. Starting was easy – I exported my OPML from Feedly and imported it in. My categories and everything were moved over as well as starred items (i.e. favorites) where there. I've been using it for a few months and finally paid for the lowest plan and may upgrade a tier.

What do I like:

  • It's fast.
  • The Android app syncs my feeds!
  • They have a tiered pay structure so I don't have to pay a high price for features I won't use.
  • Rules is a paid feature. The lowest paid tier that I have only allows for one. I used it to mark certain stories as Read (because I'm not interested in them and they flood my feed). I may need more now that I have it working…
  • Integrations are free! So I can send stories to Pocket without having to login to Pocket on my work computer.
  • A customizable dashboard that I find pretty useful

But there are a few annoyances:

  • There are ads. And no I can't blame them for that.
  • You can add the same feed to multiple folders. This is obviously a feature but when I did it on accident, I found it annoying. YMMV
  • The Starred items are hidden away in a folder that I tend to overlook

Overall I'm pretty happy with it.

Category: tech

A Wii Bit of History

 — 

In an odd series of events, we played our Wii again for the first time in years. We had a lot of fun bowling and my son discovered how hard Wii golf can really be, but then he cleaned us up on the tennis court. He was a baby in the heyday of our Wii so he doesn't remember much. And let's not talk about Just Dance Kids.

The Wii was clever in it's design and controls. But this post isn't to wax poetically about this game console. Instead, it's an artifact of our family history.

While my son was young in our Wii-hey-day, my now-teenaged daughter was in the thick of it. Opening up and looking at the Mii's we got to see all the avatars she made over the years. Most of them were blonde girls name "Lily" but there were other names too. There were Harry Potter characters. There were also Miis named after foster kids we hand in our home… and Miis made by uncles who visited as well as by myself. My Daddy Duff Mii is still one of my favorites.

It was a weird bit of nostalgia to see all those old Miis running around. And then go bowling with them.

Category: tech, family

The Year of Emacs

 — 

Somehow, by accident, 2018 has become the year of Emacs. I did write about some Emacs improvements I was doing, but it seems to be something I have come back to time after time. My latest work project is a large, mostly-standard Java app with some Spring sprinkled in here and there. I'm using Magit for using all my Git interfacing, which I never thought would happen – I always did the heavy work on the command-line but find Magit much more friendly now. For coding, I'm moving back and forth between Emacs and Intellij. Intellij still does a lot of nice things (like auto-import, syntax checking, etc) but I can type faster in Emacs. And, since this codebase is large and, er, not necessarily well arranged, Intellij can be slow with it. But Emacs with gradle-mode let's me do the TDD things much faster.

All this to say – last week I ascended onto even a higher level of Emacs karma.

Our dev team is transitioning between from Windows to Mac and some are still pedaling away on their Windows machines. This causes our commit-hook to put our ticket name (which comes from the branch name) to go from working to non-working on the Mac, because of permission issue. If I fix it, the next pull may break it. So I'm having to remember to put it in, which, so you know, just isn't going to happen. On a check-in last week, I noticed that Magit has the branch name in the comments when making a commit message. I thought "I could make a keyboard macro that uses the branch name to put in the ticket name." So I quickly created it and tested it out – it worked fine. I didn't know how, but knew I could save it for later. Sure enough I could but first I had to name it – so that was a quick C-x C-k n . I had already setup emacs-bind-map to make my own prefix to put come shortcuts. Of course, I had to run insert-kbd-macro to put in the Elisp code and the named function (the code looks like gibberish… mostly numbers) and then assigned it in my bind-map command.

This is not rocket science, especially for Emacs but my shift in thinking of simply thinking "I know I can do this… let's figure it out" as opposed to "I wish I could…" or simply googling for someone's blog post.

Category: tech

Misc Bits and Bobs

 — 

Lots of little ideas in my head that don't seem to make up a good post for each one, so I'm putting them into on. Be prepared for utter chaos.

  • I read about a compact microtool on the Cool Tools blog and I had misplaced my (larger) Leatherman I carried in my workbag, so when we did a large Amazon order, I threw that in it. I'm so glad I did – it fits very well in my pocket and have used it lot (including using the pliers to fix a broken zipper on my son's backpack while still at school). The size is small but it's really well built. I highly recommend it. Buy it with Cool Tool's Affiliate link. It may never leave my pocket if I'm not on an airplane.
  • I found this video about the history of orchestra hits in music absolutely fascinating.
  • I noted that my alma mater had a story about them on This American Life. I don't have any particular love or loyalty to that place but I am interested when it gets national attention outside of athletics. I went in expecting a story about how backward of a place Nebraska is (which the reporters did do, in a very snarky way) but I left with a concrete story on at what is wrong with political discourse in this country. Highly recommend listening, regardless of your political bent or your opinion of This American Life.
  • For reasons that I may share later, I setup ArchLinux on a Virtual Box machine to play around with. But I couldn't get the video working right – I couldn't get it to use "real" 3D animation but instead use software rendering, which made Cinnamon desktop a bit laggy. After much searching and gnashing of teeth I found this SuperUser answer which basically says that Arch is using too new of a version of Xorg and Virtual Box has no video module for that version. That… .angers me. If this posts helps the Google Ranking of that explanation, then this is all worth it.
  • I think I need to watch this video a few more times to totally grok it but watch Karl Voit's "The Advantages of File Name Conventions and Tagging" to a new way to think about files. His date2name script is now in my permanent install list.
Category: misc

Quick Editor Thoughts

 — 

Some things on editing I found this weekend:

  • EDITOR vs VISUAL . I didn't know there was a difference between the environment variables EDITOR and VISUAL and I always set the former. But I was way wrong. There seems little point in setting EDITOR unless you still work inside serial connections but most of us don't.
  • Autoinsert mode. I wanted to put in a few options by default when I created an OrgMode file and a few web searches later I was reminded of AutoInsert mode. I had this setup a while back, before I declared bankruptcy on my Emacs config and went to Projectile. Now it's back… at least for OrgMode
  • Ivy, Counsel, and Swiper. I had used Helm since I read about it in Mastering Emacs. I think found this page/presentation on Ivy and friends… and I switched. I'm glad I did. Ivy display things better but it will take me a bit to getused to how Swiper displays in isearch but I'll get used to it.
Category: tech

Adventures in Homebrewing

 — 

Sh7r8I4.jpg

I started brewing beer over a year ago and, for some reason, I haven't blogged about it. Which is funny, since beer and homebrewing have become popular keywords for my web searches over the past year. And, yes, that pic above is one of my home-made brews.

This started because I was an at an after-Christmas sale at my local hardware store, and oogled their 1 gal brew kits but decided that I didn't have the time nor the clearance from my wife to do it. When I got home, my wife presented me with a late Christmas present – a Mr Beer kit with an American ale. I made it that night and honestly haven't looked back. Since then I bought 3 of the kits from the hardware store when they got on lower and lower clearance and that is what I generally brew from. They are only one gallon and Mr Beer is 2. One gallon is easy to make and cleanup after, though I still use my Mr Beer fermenter to help me with bottling (a "bottling bucket" in homebrew terms). Though I may make use the Mr Beer for 2 gallons of my Christmas beer this year.

Brewing your own beer is a funny thing… it's decidedly slow by our modern standards, but no technology can speed up the process. Certainly technology can (and does) make it easier for you, but fermentation is fermentation. It will take weeks, not hours, before you can taste the fruits (or hops or esters, what you will). The yeast does has the yeast does.

I've make quite a few beers in the last year or so. Most OK, one was outstanding (my Christmas beer) and one was so bad I just poured it out. I found out later it got infected by a foreign yeast and that made it taste horrible. Why? Because I didn't clean my siphon out when I was testing it. That brings up the most important thing about homebrewing – it's all a learning process.

You can learn a lot by reading and researching the forums but, ultimately, it comes down to your setup and equipment. I only do 1-2 gallon brews and I boil my wort on my kitchen stove. I have different problems and advantages that someone brewing 5 gallons (like they have to do it outside, they deal with more grain, but they make a lot more than 4-5 750ml bottles at a time). And my equipment and setup is different than another small-batch brewer, so any kind of idea they may have I have to think about how to add it to my arsenal. So there is a lot of trial and error involved, even if you think you have it all figured out.

I'd love to step you through how I brew my beer but I basically follow the excellent directions in BeerCraftr's How-To Guide with a few changes. I found BeerCraftr to be a tremendous resource and I can't thank Joseph enough. My changes are:

  • The Mash After removing the bag of grains, I put them in colander in it's own separate clean pot, and take a few coffee cups of the wort and pour it over the bags a few times. This is called sparging or lautering. This may not seem like a big deal with my 1 gallon batches but since I've been doing it, the flavor of my beer has gotten better.
  • Bottling Hours before bottling, I boil some water and put the amount of sugar I need in a coffee cup and pour the water in it with a spoon. Every once in a while, I give it a stir with the spoon. This is less trouble than measuring each tab of sugar for each bottle. How do it do this?
  • Bottling After I have my fermenter ready, my bottles sanitized, and sugar dissolved, I pour the sugar water into my sanitized Mr Beer and then siphon the beer from the fermenter into the Mr Beer. I wait a minute or two for the sugar to spread out through the beer and then use the spigot to fill each bottle with beer. Easy-peasy.
  • Bottle Conditioning I've found 4 weeks isn't enough time to leave it in bottle. I've found I don't get enough carbonation with it that long, or flavor. I have a Belgian Wit on Month 4 on the counter and it's just starting to be good. Maybe it's because of the temperature in my house, etc, but just doesn't work.

Lastly – the best change I ever did in my homebrew experiments is to change my sanitizer to Star San. My beer came out better, and it actually carbonated. It seems pricey but a little bit goes a long way. I make a gallon and keep it in a glass jar for a few months and just re-use it. Worth the effort and don't fear the foam! (because, yes, it does foam. a lot).

Category: homebrew

© Mike Hostetler 2016

Powered by Pelican