Author: Dougie Richardson
-
No Internet access in WSL
Windows might generate a /etc/resolv.conf with an incorrect nameserver while installing Windows Subsystem for Linux (WSL). It’s a quick fix – edit /etc/resolv.conf and change the nameserver (Google’s is 8.8.8.8). To prevent it being overwritten, create or edit /etc/wsl.conf adding the option generateResolvConf = false.
-
Windows Store missing
Windows Store is never installed when I do a clean install of Windows 11. No idea why. The easiest solution is to run Xbox, and you’ll see: Click “Fix them in settings”: Install Microsoft Store.
-
Linux on Acer V3-112p
It’s an old Windows 8 laptop I’ve had years with a modest 2.16 GHz N2840 processor and the maximum 8 Gb RAM. It’s like Ship of Theseus, having had memory, battery, screen, and hard drive replaced. It is however ridiculously small and light.
-
Tech for Good – Volunteers Assemble
The message at this year’s Tech for Good Summit was that as a society we face significant challenges, only by working together can we have an impact on those challenges. One of the day’s events, Volunteers Assemble, saw three big challenges identified by the Scottish Tech Army presented to small groups of volunteers. We had…
-
Rainbows, decorators arguments & threads
Playing with Rainbow Hat I learned a few things about Python as a result I found out what a decorator is, the difference between args and kwargs and threads. I also learned that a lot of guides don’t understand either. If you can’t explain it simply, you don’t understand it well enough1. Decorators Rainbow Hat…
-
Python List Comprehension
I’ve been spending time with Python recently and am beginning to really like some of the language’s features. List comprehension creates a list by evaluating an expression on each item in each list, from left to right. It combines an expression and a loop: Apply a condition : It’s useful for combining lists: Pimoroni’s Rainbow Hat…
-
Using Threading rather than Thread
In an earlier post, I used Threads but the thread module in Python when I should be using threading. The documentation for threading says it builds upon the thread module (renamed _thread): This module provides low-level primitives for working with multiple threads (also called light-weight processes or tasks) — multiple threads of control sharing their global data…
-
Triangular numbers (Euler 11)
What’s a triangular number? It is the sequence found by summing all the natural numbers, for example the third number is $1+2+3=6$. Interestingly, it counts objects arranged as a triangle. This also has closed form $T_n=\sum_{i=1}^{n}i=\frac{n(n+1)}{2}$. I started with a brute force approach – iterate through the triangular numbers and test if the number of divisors…
-
Python’s with statement
Managing resources usually involves three steps – allocating, using, and releasing. You’re familiar with the try… finally pattern but Python also provides context managers.
-
Disable all WordPress Plugins
Check error logs to find which plugin is crashing the site, then check the site’s wp-config.php file to identify the database name and prefix. Using phpMyAdmin or similar, assuming “wp” is the prefix, locate wp_options table and edit the active_plugins row. The data starts a:X where X is the number of active plugins. Change the…