Skip to main content

10 posts tagged with "Windows"

View All Tags

Running Python With Graphics Support in Windows Subsystem for Linux (WSL)

· 6 min read

Prompted by a class I'm taking, I decided to try running Python from Windows Subsystem for Linux (WSL; actually, WSL2 to be specific). Installing Python in Ubuntu on Windows was relatively easy, though I did run into a couple of little problems with running poetry. Bigger challenge: running graphical user interfaces (GUIs) from WSL. Here are some quick notes from my experience.

Screenshot showing a small program displaying the operating system name

Screenshot shows that I'm running Windows 10, and shows a small GUI window opened from both Powershell and from Bash using the same Python script.

Packer Tips and Lessons Learned

· 4 min read

Packer is a cross-platform tool for scripting out virtual machine images. Put another way: use it to create new virtual machines with fully automated and repeatable installations. No clicking around. Some of the benefits:

  1. Startup fresh virtual machines from a pre-created, Packer-based image in seconds instead of hours.
  2. Use the same scripts to create a local VM, a VWMARE instance, or a cloud-based virtual machine.
    • in other words, you can test your virtual machine creation process locally
  3. Helps you maintain a strategy of infrastructure-as-code, which can be version-conrolled.

Manually Shimming An Application Into the Chocolatey Path

· One min read

Recently I installed MongoDb using Chocolatey, and was surprised to notice that the executables weren't placed into the Chocolately path. Chocolatey uses a shimming process to automatically add executes to PATH. This is really quite nice.

I can imagine scenarios where I have command line executables that weren't installed by Chocotely that I would like to add to my path easily. Or a scenario like this where I want to address something that someone forgot to build into the choco package. Thankfully manually calling the shimgen executable to create a new shim is quite trivial:

c:\ProgramData\chocolatey\tools\shimgen.exe `
--output=c:\ProgramData\Chocolatey\bin\mongodump.exe `
--path="..\..\..\Program Files\MongoDb\Server\3.6\bin\mongodump.exe"

The only key thing to notice is the relative path constraint.

Installing OpenSSH in Windows

· 2 min read

One of my very first technical blog posts was about running OpenSSH on Windows - written over 14 years ago. Recently I was playing around with Microsoft's port of OpenSSH, which has officially achieved version v1.0.0.0 beta status. Installation was pretty easy, but I ran into a little problem: needing to set "user" group permissions. This little gist has my final script. For reasons of my own I didn't feel like running the chocolatey install, so I don't know if it has this permission problem.

Using Windows CNAMEs to Reduce Server Confusion

· 2 min read

A common challenge for development teams is remembering the names for all of the different servers in an enterprise environment when the server naming convention is either not descriptive ("Deathstar", "Falcon", "XWing") or obscure ("abcDBS001", "abcDBS002", "abcWEB01"). The Star Wars names suffer from an obvious problem of mapping description to purpose. Those obscure names are commonly used to help distinguish between dozens to hundreds of different servers in an enterprise. Arguably they are helpful to the infrastructure team as they manage this motley collection. But for a developer, remembering if "abcWEB01" is the test web server or prod can be challenging; even when remembered, it would be simple enough to overlook or accidentally type "abcWEB04".

Windows Keyboard Shortcuts

· One min read

I've always been a fan of keyboard shortcuts, using them whenever possible. Today I accidentally pressed the Windows key and D at the same time — and suddenly found that my whole desktop was revealed. How did I not know about this? A quick search led me to a great page with another 8-10 shortcuts I didn't previously know. Now you too can be enlightened about the many uses of the Windows key.

2^14

· One min read

214— that's the maximum number of files in a folder on the Windows operating system. If you fill this up, you don't get any more (unless you move a few files to another directory). In layman's terms, that 16,384 files. Just thought you should know.

WindowsXP Service Pack 2 Warning

· 5 min read

In the next day or two Microsoft will come out with its long-heralded, major updates to WindowsXP, known as Security Pack 2. The updates for SP2 take care of usability, default settings, and security bugs/holes. A new security pack from Microsoft is always a major step forward… but in my experience always comes with a few bugs itself.

safnet logo