Today I Moved to Silverblue

Today I took the plunge replacing my aging Fedora 26 install with Fedora Silverblue. What is Silverblue you ask?

Silverblue is the new face of Fedora Atomic Workstation from Project Atomic. With good support for container-focused workflows, this variant of Fedora Workstation targets developer communities. If you want to emphasize that it is part of the Fedora project, calling it Fedora Silverblue is fine, too.

Source: https://docs.teamsilverblue.org/

giphy

As a long time member of Project Atomic I had always wanted to use Atomic Workstation for my work laptop. I was keenly aware of the advantages of using an ostree based system on servers and it only made sense to use the same technology locally. However, time generally kept me from making the change. Switching to Atomic Workstation was always the 3rd or 4th thing on my TODO list. Today there was time.

Step 1: Backing Up

Technically speaking, one should be able to install an operating system without the need to back up everything up. However, if backups don’t happen and something goes wrong you’re going to have a bad time. Today I spent multiple hours combing through my home directory looking for things that must be backed up just in case. After finding everything required and placing it on local removable encrypted disk I moved on to step 2.

Step 2: Creating the Media

I grabbed the ISO from the Silverblue site and created the media the old school way. The instructions on the download page are great and I’m sure they work fine, but I’m so used to using dd for media copies I just went with that:

$ sudo dd if=Fedora-AtomicWorkstation-ostree-x86_64-28-1.1.iso of=/dev/sdb

Warning: If you do end up using dd make double sure your output file (of=) is pointed at the disk you are expecting!!!

Step 3: Install

And here is where the excitement for me really began. The official installation guide is quite good. I ended up following the manual partition instructions as it was similar to how I normally install vanilla Fedora. I set up my disks, and kept my old /home partition and mounting it to /var/home per instructions. The only additional thing I did that wasn’t in the instructions was I went into the Network & Host Name where I connected to WiFi and changed my host name before clicking Begin Installation.

Boom

img_20180706_123733520797202021912045-e1530902678123.jpg

This gave me some anxiety because at this point I had blown away my root partition so I didn’t really have a workable system to use if the installation didn’t work. So I did what any sane person would do and I decided to reboot and try again.

Second time’s the charm

This time I followed the same pattern except I didn’t connect to WiFi. I did still set my host name though. Installation went without a hitch and within about 7 minutes it was time to reboot into my new system.

Step 4: Initial Set Up

The machine rebooted, I unlock my encrypted partition, and everything looks good. A greeter popped up to set up a user, etc.. Everything you expect from a modern GNU/Linux system occurred. I figured this is the best time to update the system to the newest image so I drop to a terminal and execute:

# rpm-ostree upgrade

For whatever reason pulling the update ended up being slow. Really slow. After 25 minutes the update exited with failure. I tried adding –check just to make sure there was literally an update, and it failed as well. For the heck of it I rebooted and did it again and upgrading succeeded. Again, the network download was really slow. This time it took around 35-40 minutes to pull the update but once it was pulled down the deployment happened perfectly.

Most things on Silverblue should be installed via Flatpak or executed in a container via podman or docker. There were a few tools I decided to overlay onto the deployment. These packages were:

  • tmux – terminal multiplexer
  • weechat – console IRC client
  • rpmdevtools – mainly for rpmdev-extract

In fairness weechat these could all easily run via container, but to get up and going quickly I decided to overlay them for the time being. The most important one (for me) was rpmdevtools as there were a few packages which refused to overlay and my best move was to extract the contents (which were config files) and move them to the right locations in /etc. Not ideal, but not Silverblue’s fault.

Step 4: Install Editor

For this I decided to go with flatpak. First I needed to add the flathub remote which can be found here. Next I needed to add it as a remote:

$ sudo flatpak remote-add flathub /etc/flatpak/remotes.d/flathub.flatpakrepo

Then install my editor:

$ sudo flatpak install flathub com.visualstudio.code
Required runtime for com.visualstudio.code/x86_64/stable (runtime/org.freedesktop.Sdk/x86_64/1.6) found in remote flathub
Do you want to install it? [y/n]: y
Installing in system:
org.freedesktop.Sdk/x86_64/1.6 flathub fd7d657c9a36
org.freedesktop.Platform.VAAPI.Intel/x86_64/1.6 flathub 82006efc71d3
org.freedesktop.Platform.ffmpeg/x86_64/1.6 flathub d757f762489e
org.freedesktop.Sdk.Locale/x86_64/1.6 flathub 346dd3511a8c
com.visualstudio.code/x86_64/stable flathub 6cba55350228
 permissions: ipc, network, pulseaudio, x11, dri
 file access: host
 dbus access: org.freedesktop.Notifications, org.freedesktop.secrets
Is this ok [y/n]: y
Installing: org.freedesktop.Sdk/x86_64/1.6 from flathub
[####################] 17 delta parts, 148 loose fetched; 324907 KiB transferred in 35 seconds
Now at fd7d657c9a36.
Installing: org.freedesktop.Platform.VAAPI.Intel/x86_64/1.6 from flathub
[####################] 1 delta parts, 2 loose fetched; 2623 KiB transferred in 1 seconds
Now at 82006efc71d3.
Installing: org.freedesktop.Platform.ffmpeg/x86_64/1.6 from flathub
[####################] 1 delta parts, 2 loose fetched; 2652 KiB transferred in 1 seconds
Now at d757f762489e.
Installing: org.freedesktop.Sdk.Locale/x86_64/1.6 from flathub
[####################] 4 metadata, 1 content objects fetched; 14 KiB transferred in 0 seconds
Now at 346dd3511a8c.
Installing: com.visualstudio.code/x86_64/stable from flathub
[####################] Downloading: 94.7 MB/94.4 MB (3.6 MB/s) 
Now at 6cba55350228.

Lastly, verify it installed as expected:

$ flatpak run com.visualstudio.code

For the heck of it I also checked to see if it would add the program to the Gnome Menu and it was there!

My next steps will be getting some dev containers for languages I tend to use the most frequently.

Step 5: Be Happy

The end result is that I’m sitting here using Silverblue writing a blog post on setting up Silverblue. Was it 100% smooth with no issues? No, but it was smooth enough. The change should force me to start doing things I should already be doing in containers … in containers.

If you are interested in running on Silverblue as well I recommend giving it a shot. Take a gander at the main website and, if you’re ready to truly move your workflow to containers and flatpaks, join in!

flask-track-usage 2.0.0

flask-track-usage 2.0.0 has been released! Thanks to all who helped provide patches and test. Note: 2.0.0 is the recommended upgrade version from 1.1.0. 1.1.1 was released for those who are unable to make the needed changes to move to 2.x. You can check out the latest docs over at readthedocs.

The changes include:

  • MANIFEST.in: Add alembic to dist
  • CONTRIBUTORS: Add John Dupuy
  • py3: Fix import issue with summarization
  • .travis: Change mysql driver
  • test: Fix summerize tests for py3
  • travis: Add 3.6
  • docs: Quick fixes
  • README.md: Update docs to rtd
  • Use parens for multilines
  • Update versions to 2.0.0
  • sql: Increase ip_info from 128 to 1024
  • alembic: Upgrade ip_info from 128 to 1024
  • alembic: Support for upgrading SQL schema
  • sql: Create table if it is not present
  • couchdb: Add track_var and username
  • redis: Add track_var and username
  • Adding user_defined variable field to storage
  • Hooks: add new hooks system
  • test: Skip mongoengine if connection can not be made
  • storage: Rename to PrinterWriter
  • output: Add OutputWriter
  • storage: Create base class and Writer
  • requirements: Added six
  • Copyright now a range
  • Add CONTRIBUTORS
  • doc: Add note about py2 and 3
  • py3: Fix most obvious offenders
  • Move mongoengine ref in Travis CI config
  • Update Travis CI config to include mongoengine lib
  • pep8 fixes
  • MongoEngineStorage: updated docs; added get_usage
  • added testing
  • moved MongoEngineStorage to mongo.py
  • doc: Minor updates for a future release
  • Initial support for multiple storage backends
  • Update versions to denote moving towards 2.0.0
  • Added MongoEngineStorage code; adding test next.
  • docs: Update version to 1.1.1
  • release: v1.1.1
  • Updates for freegeoip function
  • test: Update sqlalchemy test for updated flask
  • test: Update mongo test for updated flask
  • test: test_data works with current Flask results
  • travis: Force pymongo version for travis
  • storage: Minor doc and structure updates for new backends.
  • Redis support
  • Added CouchDB integration. (#30)

flask-track-usage 2.0.0 testing

flask-track-usage is nearing a new milestone: 2.0.0. This new release will include a few bugfixes and a number of enhancements. The two that stick out are time aggregate functions in the form of hooks, split between Storage and Writer classes, and the ability to store custom date via a track_var global. Currently the work is being housed in a branch but will be updated and merged once 2.0.0 has a little time for testing. Some highlights in 2.0.0 include:

  • alembic: Support for upgrading SQL schema
  • sql: Create table if it is not pres
  • entcouchdb: Add track_var and username
  • redis: Add track_var and username
  • user_defined variable field to storage
  • Hooks: add new hooks system
  • test: Skip mongoengine if connection can not be made
  • storage: Rename to PrinterWriter
  • output: Add OutputWriter
  • storage: Create base class and Writer
  • requirements: Added six
  • doc: Add note about py2 and 3
  • freegeoip: Fix missing attribute
  • py3: Fix most obvious offenders
  • Move mongoengine ref in Travis CI config
  • Update Travis CI config to include mongoengine lib

Help test the 2.0.0 branch by cloning and installing in your development environment!

More Editors/IDE’s

In my last post I talked about not being able to find a good Python editor/IDE other than vim. Nothing has really changed since then but there was another editor and IDE that was brought to my attention which I failed to point out. Let’s talk about them!

Editors/IDE’s

Emacs

While talking with Tim Bielawa I was reminded about Emacs since it’s what Tim uses. Emacs has such amazing integration that people sometimes say it’s an operating system itself! I’ve really only ever given Emacs two real shots at being my main editor. The first time was when I was just starting to get into programming and was reading a lot about what other programmers and system administrators used. At first it seemed a lot easier than vi but I ended up running with vi/vim since, at the very least, vi seemed to always be present on every Linux/BSD box I worked with by default. The second attempt was after I promised a few Emacs users at work that I’d give it another fair shot. I said I would use Emacs when I’d normally use vim for a full week knowing that it would force me to learn more about the editor. It wasn’t easy to stop trying to use mode editing but I was able to code without feeling too contained by the editor (Note: the contained feeling was me not knowing the editor well, not Emacs itself. It was really obvious that Emacs is a powerful editor). My biggest gripes from the week long test were around needing to install emacs on systems for use (which is sort of a silly one, I admit) and I felt some of the commands were way to long. I don’t remember the last one off the top of my head but I do remember that one command had a bunch of dashes and was frustrating every time I needed to use it. I think it’s about time I try it again and see if I can overcome my hurdles trying to use it efficiently. Who knows, maybe third time’s the charm!

Cloud9

Cloud9 is really cool. It’s not your grandfather’s IDE by any stretch. As the name implies the application exists out in the cloud (They use Openshift). I love the idea that I can start editing code with full IDE features from any machine I’m currently occupying. I have not tried using Cloud9 with a tablet (with keyboard of course!) yet but if that works then this thing would have rockstar status in my mind. I’ve used it for a few projects for both ease of use and to test out some of the features Cloud9 boasts. Being that it is on Openshift the IDE has it’s own platform letting you install tools and dependencies. There are also some collaboration features which I have not tried out yet mainly because I’m not sure how that works when you are using Github (IE: can they push code under your name or are they restricted?). I would use Cloud9 a lot more if it wasn’t for the Internet. While Cloud9 is pretty responsive in most cases but due to some point in the network connection between “here” and “there” things slow down or stop responding for a second or two. If this was something other than coding I probably wouldn’t care that much … but this is coding. Any hiccups while editing breaks concentration and slows down progress. One other issue I noticed was the lack of preferences across ones instances. Say you have two projects in Cloud9. Each project has it’s own IDE instance. If you want to set preferences for both IDE instances you will have to open each on it’s own and set them. You can not set any kind of global default preferences for all your instances. Hopefully they will add that functionality as I’m pretty positive I’m not the only person who finds that a bit weird. Over time Cloud9 and similar IDE’s will find ways to speed up and add better preference support but until then, in my mind, Cloud9 is straddling the line between full contender and really cool tech preview to keep my eye on.

Why I Chose NewsBlur

Not all that long ago Google Reader closed it doors pushing millions of users off the platform. Many users were frustrated to lose their long time place to get their news not all that different from someone in yesteryear losing their favorite newspaper.  The whole thing was far from ideal but did go to teach users that you can’t expect cloud services to last forever (which is a good wake up call). But in the fall of Google Reader came many possible replacements which added their own spins on how one reads news. Feedly, The Old Reader and NetVibes were a few of the popular replacements. But I settled on NewsBlur and eventually became a paid user.

NewsBlur is mainly written by Samuel Clay (more on why I say mainly later).  He seems like a friendly, hard working fellow. He responds to bug reports and is active in his products community.  While this may seem like common sense just take a few minutes to look at random SaaS products on the Internet. You’ll find many of the developers are hidden behind customer service groups who, at worst, are outsourced and are more of a dead end than a way to get things fixed. Long story short, it seems like Samuel really cares about his product.

It is possible to have a Free account on NewsBlur. While you are limited to a specific amount of feeds many people will find the limits are higher than the feed counts they had in Google Reader. At the time of writing the limit is 64 sites.

There are some social features provided by NewsBlur yet these features are not required nor forced into general workflow. For instance, there is a concept of the BlurBlog which looks like it could be fun. But I tend to read the news and share elsewhere. If I ever decide to use the BlurBlog functionality it’s there. Otherwise I can just use NewsBlur as a fantastic reader.

NewsBlur is Open Source under the MIT license (also known as the Expat License). This gives me peace of mind knowing if Samuel ever decided that he was done with NewsBlur I could export my feeds, setup my own instance, and continue using the product on my own infrastructure. Yeah, it’s not trivial but it’s possible which is a huge advantage given the last reader I used shut down.

No software is without it’s bugs but Samuel does a good job bug squashing. And if you are developer who wants to give a hand you can patch the issue yourself and submit the fix (another win for Open Source). At the time of writing there are 43 development contributors to NewsBlur. This is a much better solution than waiting for a customer service representative to reinterpret your bug submission to a developer so that the fix may be done someday in the future.

If you are still looking for a replacement for Google Reader give NewsBlur a chance even if it’s a second chance as the application seems to be enhanced weekly. If you like it, consider becoming a paid user. Can you can’t say no to Shiloh:

Introducing Flask-Track-Usage

A little while ago one of the guys on a project I work one was asking about how many people were using the projects public web service. My first thought was to go grepping through logs. After all, the requests are right there and pretty consumable with a bit of Unix command line magic. But after a little discussion it became clear that would get old after a while. What about a week from now? How about a month or year? Few people want to go run commands and then manually correlate them. This lead to us looking around for some common solutions. The most obvious one was Google Analytics. To be honest I don’t much care about those systems. While that one may not (or may be) intrusive on users I just don’t feel all that comfortable forcing people to be subjected to a third party of a third party unless there is no other good choice. Luckily, being that the metrics are service related, the javascript/cookie/pixel based transaction wouldn’t have worked very well anyway.

So it was off to look at what others have made with a heavy eye towards Flask based solutions so it matched the same framework we were already using. Flask-Analytics came up in a search. The simple design was something I liked but the extension was more so aimed at using cookies to track users through an application while we want to track overall usage. I figured it was time to roll something ourselves and provide it back out to the community if they could use it as well.

Here it is in all it’s simplistic glory: Flask-Track-Usage. It doesn’t use cookies nor javascript and can store the results into any system which you provide a callable or Storage object. There is also FreeGeoIP integration for those what want to track where users are coming from. The code comes with a MongoDB Storage object for those who want to store the content back into their MongoDB. Want to know a bit more of the technical details? Check out the README or the project page. Patches welcome!

Nexus 4 Mini Review

This Nexus 4 has only been with me a short time but I can already see why the guys and gals who got their hands on the original batch of devices have raved so highly about them. Here’s a short run down of my thoughts so far…

The Look

Nexus 4
Nexus 4 (Photo credit: abuakel)

The device is understated for what one expects from flagship devices. By that I mean the Nexus 4 is not meant to draw eyes to it or make you the talk of the cool guy crowd. It’s meant to look like a lot like every other Android device out there. Not exactly like others but close enough that by glancing it wouldn’t stand out. The main thing that does stand out when focusing on the device is the back due to it’s sparkle/glass look. It actually does make the device look special without forcing it’s ‘coolness factor’.

As a side note it’s nice to have fewer brand names thrown all over the back. I’ve had phones which had multiple brands plastered on it followed by reminding me (and everyone around me) the brands ‘involved’ in the device. The Nexus 4 says Nexus and has a smaller LG logo near the bottom. The front is refreshingly brandless. Bootup also avoids yelling about it’s Google and LG makers. I love it!

The Form

Like the look the form isn’t much different than many other current generation Android devices but does have a slightly larger screen than my previous SGS II. To be honest I really like that as I’ve grown accustomed to the general Android device slate. Where it does part ways with most of it’s siblings is in how well the build feels. It’s light without feeling cheap. It’s thin without feeling frail. I’m not totally sure why the back is glass (other than giving it a slightly different look on focused look) but I have to assume that ends up adding to the positive build feel.

General Usage

Blockbuster
Better than the app. (Photo credit: ario_)

Hopefully every Android device manufacturer is taking notice of this device because this thing is exactly how I want to use a phone. First off I didn’t have to spend time hiding a bunch of ‘value added’ applications that I’ll never use. The amount of telco bought devies I’ve had which forced me to keep NASCAR or Blockbuster installed even though I never used either is a sad number.

Next, the device is fast. Really fast. I’ve been on the Tegra everywhere bandwagon and now I’m thinking Snapdragon really may be where it’s at for phone size devices. Then there’s the fact the device is running stock Jelly Bean. This means no Sense, TouchWiz, etc… Just Android the way it was meant to be. No extra value is added which makes it much more valuable.

Most of the applications the one expects are there so I won’t jump into them but Google Now is something I can see using pretty often. Don’t get me wrong, this is not my first Jelly Bean device. I have a Nexus 7 which I’ve been very happy with, but the Google Now software on a device that only has wifi access does not do Google Now justice.

The camera seems quite good so far. To be fair I have not used it much yet but here is a test photo I took in moderate to low light in a coffee shop. For a more in-depth look at the camera look at TechRadar’s review.

Medium/Lower to low light indoor photo. No flash.

Some Downsides

Nothing is perfect but wow does the Nexus 4 come close! Two of the three downsides are minor and only are noticeable one time only.

SIM Size

The first thing I did after charging the new device was to pull the SIM card from my old device for use in my new one. I should have noticed when reading about the Nexus 4 that it uses a Micro-SIM. Not a big deal but it did require a run to the closest telco store to get one.

English: GSM Micro SIM card vs. GSM Mini SIM card
(Photo credit: Wikipedia)

Initial Usage

There was a decent amount of updates ready to be installed upon first usage. An OS update along with many application updates. It would be nice if Google could use the latest ROM when shipping new batches. Again, not a big deal at all but still would be nice.

Storage

This is what kept me from buying it originally. The storage is capped at 8 or 16g which doesn’t sound like a good deal for those of us who keep our music library with us at all times. There are options that limit this as an issue. Using Google Music, Amazon Cloud Player, Subsonic, Pogoplug, etc.. can keep your music collection within reach as long as you have a data connection but each has it’s own downsides as well. My annoyance is generally with the quality of the music player for the services. It’s not that they are bad players but they are feature poor compared to many of the locally players.

tl;dr

Reign Of The Android
(Photo credit: JD Hancock)

If you are in the market for a new Android phone right now then there is no better option than the Nexus 4. While not perfect it’s downsides are few and are heavily overshadowed by how well the device works both in terms of physical feel and software. A real Jelly Bean experience, great build quality, no telco lock in and really fast. Did I mention you don’t have to put up with apps forced on you by telcos? Assuming that the device is currently available in your region there is not a reason to avoid it. Go get it!

Hello Raspberry Pi

I couldn’t help it. I’ve watched other open source friends rave about playing with the Raspberry Pi but had yet to really jump in on it all. See, I bought a GuruPlug a while back and had kind of a bad experience with it. You know, overheat and shut off. In fairness the manufacturer of the device did provide a hardware fix quite a while later, but I’d already moved on and forgotten why I bought the device in the first place. It took the consistant praise from online friends and one conversation with my friend Andrew to get me to take the plunge.

Yesterday it arrived in a nondescript package. A simple yellow padded envelope. Opening it up I saw two small boxes. Funny thing is the larger of the two boxes is actually the wall plug. But I didn’t have time to do anything other than prepare an SD card with raspbian on it. But today I’ve thrown it on the network (headless) and have an ssh connection in to update the default system.

Now I’m at a bit of a loss or, I should say I’m not sure where to start. I picked up a breadboard, wires and LED’s to do a little playing around. I’m just not sure what I want to do for a longer term project. I’d like to start working with some sensors and pick up more knowledge in that space. I have some more components on the way but it will be a while. Maybe I’ll snag a Arduino while I wait.

What I Want From a Home Theater PC/Digital Media Receiver

A few years ago I sat down to figure out how much I was paying in cable versus the amount of time I was using it. I found that I really only watched a handful of shows and could probably save money by buying the seasons. In other words I was a normal casual TV watcher. The next course of action was easy because for me it was a no brainer. I cut cable. I haven’t wanted to go back.

Today I use a PS3 to watch Netflix and Amazon while relaxing at home. On the go its Android devices to watch Google Play and Netflix. These are great services and, overall, I’m happy with the content they provide (though Netflix seems to go up and down in terms of stability..).

I just read about the newer BoxeeTV after hearing about it in some podcasts. I like it’s idea but, for me, it still isn’t what I really want out of an entertainment device. I like the idea it uses cloud storage because it should make it easier to stream the content to other devices as well (at least in theory). It’s nice on general functionality now, but I can’t see it as a long term solution. I still have two issue with the designs of Boxee and the like that keep me waiting to put down money on a dedicated HTPC/DMR.

When I want to watch something that I will be paying for I want to feel like the customer. I want to feel like I’m getting the best price for the item I’m purchasing. Simple concept. So far I’ve yet to see a device which makes me feel this way. Instead, I feel like I get access to one or more video services where I can pay their price if I choose to buy/rent/subscribe. Most of the time I know what I want to watch and what I really want the device to do is search across all the services I have accounts on for the best price. Am I a Netflix member and it’s there? Great! Take me there! Is it, $0.50 cheaper on Google Play than Amazon VOD? Let’s buy it from Google then. In the end I don’t much care who is providing the content so much that it’s legal, I am getting it at the best price and am able to access it when I want to watch it. As a bonus it would be nice to tell the difference between watching it because it’s in a subscription and owning a watch it forever license.

The other item is not something a HTPC/DMR company can really influence directly in my opnion. I believe that when I purchase a video online I’m actually purchasing a license to stream the content. Not all services are available on all devices (as I eluded to before with Amazon not being on my tablet). Why can’t I import my licenses from provider A to provider B? At the very least why can’t I do it if provider A changes its business to something else (or goes out of business)? The quick argument against license import/export would probably be about how a customer could move away to another service but, honestly, that wouldn’t be a major problem. In fact, it could be a benefit  Someone who moves  is likely moving over to make the other service the sole provider of their content due to price/convenience/access for their specific situation. This would mean future revenue from the person. The original seller wouldn’t lose the money already made by selling the license and would gain back bandwidth by not needing to stream the content to the user. The also consumer wins here as well as they can gain the best access and use the service(s) they wish to use at any time. It’s not remotely like this today and I’ve been burnt in the past by companies deciding to change direction and cut access to purchased content. For this reason I can’t see any of the devices (or services) today as a long term buy nor a replacement for buying a blue ray or dvd.

The closest option seems to be XMBC but it also seems to be more channel focused instead of content focused and the issues around future access still exist from the big players. Things do seem to be moving in the right directions but, for now buying content in a physical media format is the safest bet for watching later.