RT73 wifi driver on Debian 8 completely filled my hard disk with syslog messages

Just installed Debian Hamradio Pure Blend, and I thought a 20GB partition for / would be plenty, but after a day I was getting disk full errors. So I shrunk my /home partition and extended my / partition up to 50GB. A day later it was at 100% again (I had just deleted some log file files to free up some space):

kev@kh-debian:/var/log$ df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda9        58G   53G  2.5G  96% /
/dev/sda10       20G  279M   19G   2% /home

Guessing something was up, I cd’d into /var/log to see what was showing up in my log files and was surprised to see this:

kev@kh-debian:/var/log$ ls -lS

total 49743852

-rw-r----- 1 root              adm  15123453253 Dec 24 18:37 syslog
-rw-r----- 1 root              adm  13204397200 Dec 24 18:37 kern.log
-rw-r----- 1 root              adm  12416440518 Dec 24 18:37 daemon.log
-rw-r----- 1 root              adm  10053382069 Dec 24 18:37 messages
-rw-r----- 1 root              adm    139506083 Dec 23 07:04 syslog.2.gz
-rw-rw-r-- 1 root              utmp      292292 Dec 24 18:33 lastlog

Ok, ok. That’s where my disk space has gone.

Looking in syslog, I’ve got these messages repeating about 100 times a second:

Dec 24 18:55:01 kh-debian wpa_supplicant[862]: wlan0: Failed to initialize driver interface
Dec 24 18:55:01 kh-debian NetworkManager[696]: <error> [1482634501.576472] [supplicant-manager/nm-supplicant-interface.c:856] interface_add_cb(): (wlan0): error adding interface: wpa_supplicant couldn't grab this interface.
Dec 24 18:55:01 kh-debian NetworkManager[696]: <info> (wlan0): supplicant interface state: starting -> down
Dec 24 18:55:01 kh-debian kernel: [ 2026.757616] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt73.bin'
Dec 24 18:55:01 kh-debian kernel: [ 2026.757646] rt73usb 1-7:1.0: firmware: failed to load rt73.bin (-2)
Dec 24 18:55:01 kh-debian kernel: [ 2026.757652] rt73usb 1-7:1.0: Direct firmware load failed with error -2
Dec 24 18:55:01 kh-debian kernel: [ 2026.757656] rt73usb 1-7:1.0: Falling back to user helper
Dec 24 18:55:01 kh-debian wpa_supplicant[862]: Could not set interface wlan0 flags (UP): Cannot allocate memory
Dec 24 18:55:01 kh-debian wpa_supplicant[862]: nl80211: Could not set interface 'wlan0' UP

 Following the install instructions here: https://wiki.debian.org/WiFi/rt73 – and then rebooted, problem solved. Log messages gone.

Getting USB thumb drives to work with PS4’s Media Player

Quick answer: make sure the thumb drive is formatted using a Master Boot Record (MBR) partition in either FAT32 or ExFAT format. The MBR partition format is key.

If formatting a device on a Mac, the default partitioning uses a GUID Partition Map. Make sure you change this to Master Boot Record and you’ll be all set.

More discussion in these posts:

http://community.us.playstation.com/t5/Games-Services/PS4-Media-Player-Not-Reading-any-files-on-USB/td-p/45224287

Why Can’t PS4 Media Player Read My Drive? (Yes I’ve tried the Obvious Stuff) from PS4

Making the most from your time (or, working smarter, not harder)

‘Work smarter, not harder’ as the saying goes. For most people this is common sense. There’s many ways you can interpret this advice, from finding tools and techniques to help you automate repetitive tasks, to prioritizing tasks that have the highest contribution towards achieving a goal and depriortizing or even ignoring other less important tasks – why spend time on a task if it doesn’t help you get to your goal?

After spending a while writing this article I very nearly decided not post it, because don’t most people get this already, it’s kind of obvious, right? Well, it’s only obvious if you already get it, and maybe not so obvious if you don’t. The reason why I felt there’s value to share this is I’ve come across enough people during my years of working in Software Development who just don’t get it. If these people can gain even a smallest something from this post, then hopefully they’ll be saved from their misguided attempts to ‘do all the things’.

Deciding where to spend your time is like choosing where to invest your money. We each have a finite (and limited) amount of time to invest in working on tasks, as there’s only 24 hours in a day and at least some of those hours need to be spent sleeping. More often than not the amount of time you have available is less than the time to complete all your tasks (either at work or in our personal lives).

Who needs to sleep?

First, let’s get rid of the idea that spending more time working and less time sleeping is the answer to all problems. This is not going to help you in the long term. Reducing your hours of sleep so you can do more during the day is usually not a sensible approach, as in the long run you’ll just end up more tired, and working while tired means you’re less alert, less effective, and more likely to make mistakes. Obvious points to make, but some people just don’t get this. Spending more time working rarely means you complete more work. If anything, it may mean you get more done but at a lower quality and with more errors and mistakes. If that’s acceptable for you and/or your employer then great, but for most of us that’s not a sensible or effective option.

Automating Repetitive Tasks

As software developers, we’re in a much better position to be able to automate tasks than non-software developers. Have a manual task that is time consuming and you find yourself repeating it again and again? Write a utility to help you automate the task! Ok, so it’s not always as easy as that, and you might not have the free time to spend developing the automation. But if the amount of time invested up front to build the automation is going to free up time to work on other tasks in the future, then it might be worth the initial investment. Discuss with your supervisor if you’re unsure if you should be spending time on building automation rather than working on completing the task itself.

Developing a script or a standalone app to help automate tasks doesn’t have to be a major development effort either. Sometimes learning shortcuts with your exiting tools can be a major time saver. Here’s some quick ideas:

  • Learn some simple regular expressions for matching patterns, and how your text editor of choice uses them to do search and replace tasks. Manual and repetitive tasks like replacing some pattern of text in a file can be done in seconds if you can use some regex.
  • Moving or deleting a column of data in a tabular text file: most text editors have the ability to select a column of text with the mouse, rather than text spanning horizontal lines. This makes it easy to delete or move a column.
  • Learn a couple of approaches for how to work with multiple files in multiple subdirectories. This can often be combined with other approaches, like using a regex for a pattern matching and replacing text. If you have to apply an update across multiple files, knowing how to write a quick script to find all matching files in all subdirectories can be a massive timesaver.
  • Keep a directory of common scripts you’ve developed in the past so you can reuse them in the future. It’s often quicker and easier to reuse a previous script as a starting point and modify it, rather than start from scratch every time
  • If your scripts are generic and can be shared (and do not contain company proprietary information, and/or your company allows you to share source code publicly – always check if you’re unsure), share reusable snippets either as Github Gists, or share as a public GitHub project, or similar code sharing sites like Pastebin. This allows you to build up a library of useful scripts, and also allows others to benefit from your work too.
  • Use the opportunity to write a script to automate a task as an opportunity to learn a new language. Learn some JavaScript and node.js, Groovy, or [insert language you’ve been meaning to learn here]
  • Never underestimate the tools you have right at your fingertips. If you’re lucky enough to be developing on a *nix platform, your shell has a myriad of tools that you can pipe together to complete a more complex task, e.g. find -exec, sort, grep, awk, sed, wc -l, and bash scripting in general to build something more complex than a single one liner

Prioritizing your tasks

In general, most of us in our jobs have some tasks or responsibilities that are core to our role, things that we have to or are expected to do, and there’s most likely an assortment of other tasks that are not essential or time critical, and maybe don’t even contribute towards achieving whatever your core responsibility is. These other non-essential tasks may come up from time to time, they might be ‘nice to haves’, they may come up in conversations as improvement type side projects. These additional tasks may also be longer term skills development type activities like mentoring or knowledge transfer type tasks. In the long run these add value to your organization as a whole, but they might not contribute to getting a product built and shipped out the door today.

If we had to categorize each task in terms of importance, we could think of a number of varying scales along where we could put each task:

  • essential to achieving core role responsibilities, verses non-essential
  • short term tasks verses longer term tasks
  • tasks that result in short term/immediate gains (quick wins), verses longer term gains (strategic investments), for either you or your company
  • high effort, verses low effort

Think about the tasks you have, and try to prioritize them in a way that you can (if possible) spend time on tasks that have either higher short or long term gains, and de-prioritize other non-essential tasks.

If you really can’t get away from doing ‘all the things’ yourself, at least try and automate as much as you can so you can free up time to work on tasks that have greater rewards or impact.

‘Automate all the things’, not ‘do all the things’!