#linux

WSL 2 or How I Brought my Linux and Windows Installs Together

A while back I bought a mini PC to replace my old, tired and non-functional Linux box. 16G RAM, 512GB SSD, 11th Gen Intel Celeron and it included a license for Windows 11 Pro. Now I haven’t been happy with Windows since Windows 10 would drain my laptop’s battery by deciding it needed to install updates in the middle of the night. I’d pick up my laptop after a few days and the battery would be exhausted! So, I swore off Windows, opting instead for Linux (usually Ubuntu) and Chromebooks. But I got a Windows 11 Pro sitting in front of me on my new PC. Being the packrat that I am, I didn’t wipe the Windows partition but split the SSD into another partition and installed Ubuntu (which happily recognized the bootable Windows partition and set things up so I could boot to either Windows or Linux.

Curiosity eventually got the better of me and I started fooling around with Windows. I recalled messing with Window Subsystem for Linux (WSL) on my Windows 10 machines so I did some searches and found that Microsoft had come up with WSL 2. Futher, there were many distros available from the Windows Store. So I fired up WSL2 and loaded Ubuntu 22.04. Yup, looks pretty nice! Hmmm…I’ve got this external drive that’s formatted at ext4 and holds a bunch of the stuff I was using on my Linux box (media library, precious files and photos, backups, etc). Can I use that on Windows? Well, not without adding some “stuff” to Windows but I CAN attach the drive to my running WSL2 Ubuntu! So I did.

Now I can run some Windows-only services that I’ve been wanting to try out (Channels DVR server, for one) alongside my Linux services (JR Media Center for one, not to mention the Samba server which makes my backups, files and pictures available to my other machines.

The only thing that’s missing is an automated way of attaching that disk to my Linux WSL2 instance and redirecting the appropriate ports to the Linux instance. I managed to get that done with a PowerShell script that I had ChatGPT write for me. That’s right, ChatGPT wrote a PowerShell script for me! For a couple of weeks I had been trying to figure out what I could use ChatGPT for when it occurred to me to give it this task. I don’t know PowerShell. Sure I’m familiar with the basic concepts but the object model and the commands themselves are largely unknown to me. ChatGPT spit out the script in about 10 seconds and, while it wasn’t 100% right, it only took a hour or so of fiddling to get it to work just perfectly! ChatGPT to the rescue! But its not a panacea – I’ll do another blog post about that later.

WSL 2 or How I Brought my Linux and Windows Installs Together Read More »

Buh-bye Google Keep, OneNote, Evernote!

Open source Notesnook (https://github.com/streetwriters/notesnook) aims to be THE replacement for all your note taking needs. Fully encrypted on your device before storing on their cloud service (self-hosted option coming), it’s a zero knowledge service meaning they can’t decrypt your notes. With a web app (https://app.notesnook.com) and apps for iOS, Android, MacOS, Windows, and Linux you’re pretty much guaranteed to be able to use it wherever you need or want with full synchronization across all platforms. It’s still in its relative infancy and updates generally make it to the web app before other platforms. Roadmap at https://notesnook.com/roadmap/

Buh-bye Google Keep, OneNote, Evernote! Read More »

An SSH tunnel as a system service?

I came across this today and it’s an interesting idea! While I’m not sure I endorse creating and maintaining a tunnel, especially as root, I’m sure there are use cases where it makes sense. If nothing else, defining the config files and their contents to create a service is worth seeing. All the details, including how to make it run after reboot are at https://medium.com/linuxstories/linux-how-to-create-an-ssh-tunnel-as-a-systemd-service-73e6e0fff19b

An SSH tunnel as a system service? Read More »

More SSH? Yes, please!

My local server died a little over a week ago (more about that in a future post) so I bought a new mini PC (love those little things – got one with an 11th gen Intel Celeron, 16GB RAM and 512GB SSD for $280). In setting it up I opted to keep my VNC sessions local to the new machine accessing them via SSH tunnels. In researching various ways to establish and maintain the tunnel I came across https://gist.github.com/scy/6781836 and (re)learned quite a few things but the really interesting bits are in the comments! From the use of -M to establish a “master” mode for connection sharing and how to use it, to some basic scripts to make it easier to use, to autossh (https://www.harding.motd.ca/autossh/), to a nice little script called (in the comments) ssh-fp.sh. I’ve adapted and adopted several for my own use and I recommend the article!

More SSH? Yes, please! Read More »

Tailscale for your Docker containers!

At DockerCon, Tailscale announced and launched their Docker extension. What does this mean? You can put your containers on your Tailscale VPN! Yeah, that’s a BIG deal! The announcement is at https://tailscale.com/blog/docker/ and the instructions to install and use it are at https://tailscale.com/kb/1184/docker-desktop/. While the documentation only addresses Docker Desktop, https://docs.docker.com/desktop/extensions-sdk/dev/cli/build-test-install-extension/ gives instructions for installing extensions through the CLI, and downloads are at https://github.com/docker/extensions-sdk/releases/tag/v0.2.4, which is currently in beta.

Tailscale for your Docker containers! Read More »

Those Linux apps on your Chromebook …

I mean the ones that appear in the launcher. There are files in your Linux container that specify the icon, the program to launch and a number of other things. Where are they located? Launch your terminal (or your favorite Linux file browser) and navigate to ~/.local/share/applications/ and/or /usr/share/applications/ and there you should find a number of files ending in .desktop. These are text files that contain the specifications for the applications that will be shown in the launcher (it is, in fact, a standard across Linux that is defined in https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). You can modify them, add, or delete them but I find it useful just to look through the files to see what’s executed and the other various parameters associated with launching an program by way of its icon.

Those Linux apps on your Chromebook … Read More »

Finally, a point-to-point VPN!

I’ve set up a VPN at home and, honestly, in my config, it’s a PAIN! I have 3 routers that need to have ports opened and then I need to make sure that certificates and passwords are all secure.

Then I found Tailscale.com! What a breath of fresh air. Why didn’t anyone think of this before? Create an account on tailscale.com then install the tailscale service on the machine you want to be a part of the VPN and run it. The service connects to the tailscale server and it becomes an immediately available VPN target, complete with its own hostname (which you can change) and its VPN IP address. If you enable their “MagicDNS” in your settings then the hostnames all resolve to their VPN IP addresses (i.e. the hostname is first checked against the hostnames on the VPN before being checked against other DNS resolvers). Voila! No config, no ports to open, no firewall rules to manage! Now, when you’re away from home, you can get to your home server with confidence.

It’s free for a single hobby/personal user. There are a few restrictions as to how many subnets you have available but, honestly, if you’re a home user, the restrictions probably won’t bother you. It’s multi-platform with binaries for Android, MacOS, iOS, Windows, and Linux so you can connect just about anything you want. They’re on github at https://github.com/tailscale and a place to discuss it at https://forum.tailscale.com/. And, yes, you can use tailscale to act as a subnet router – https://tailscale.com/kb/1019/subnets/ – to get to those devices (e.g. printers) on which you can’t install tailscale.

Apologies for the delay between postings but I prefer to try the things before I post about them and tailscale took a while.

Finally, a point-to-point VPN! Read More »

3 new (to me) linux (mac, android,windows) tools

I’ll cut right to the chase, Copyq, syncthing, and tldr.

Copyq, at https://hluk.github.io/CopyQ/, is a clipboard manager for Linux, Windows, MacOS, AND ChromeOS in the Linux environment! It has a GUI as well as a command-line interface and in the ChromeOS environment, captures clips from BOTH Linux and ChomeOS! CHeck out the docs.

Tldr, at https://github.com/tldr-pages/tldr, provides a cheat-sheet-like summary of command options. It’s not as full function as a man page but can often provide just that one bit of info you need. It provides info on Android, Linux, MacOS, Windows, Sun OS(!), and a set of common commands like 2to3 (convert python 2 code to python 3), adb (Android Debug Bridge which can be installed on many different platforms), and atom (a cross-platform editor).

Syncthing, at https://syncthing.net/, is an open source, multi-platform, authenticated, continuous file synchronization program with communications secured by TLS. It works on MacOS, Windows, Linux, Android among many others.

3 new (to me) linux (mac, android,windows) tools Read More »

Linux in a browser

Now that you’ve got docker set up on your Mac or Windows box or even on your Linux machine or NAS or chromebook (see https://tonystakeontech.com/2022/02/08/a-cookbook-to-run-docker-on-your-chromebook/), what can you do with it? Well, I could send you over to https://hub.docker.com/search?type=image but that just shows you some of what’s available in the world of docker containers. Instead, how about running Linux in a docker container that you can access locally in your browser? Yeah, I know, it’s a bit funky in that you may already be running Linux, with or without a GUI, but it’s an easy project and even kinda fun.

Head on over to https://tech.davidfield.co.uk/webtops-linux-desktop-in-a-web-browser/ for the cookbook to bring up Webtop (more info at https://docs.linuxserver.io/images/docker-webtop including different base images like XFCE Ubuntu, KDE Alpine, etc). And, BTW, there are quite a few more images available over at linuxserver.io so check them out, too. That link to docs.linuxserver.io lists other images.

Linux in a browser Read More »

A cookbook to run docker on your chromebook

I know, if you’re running Linux on your chromebook then you’re already running a virtual image but until Google releases the code that makes it easier to add images alongside Linux, this is probably the easiest way to run them, albeit in your existing Linux container. https://dvillalobos.github.io/2020/How-to-install-and-run-Docker-on-a-Chromebook/ is a cookbook approach which makes setting it up even easier and you can be up and running docker images in…well, it took me less than 10 minutes (I already had my Linux environment set up on my 11th gen Acer Spin 713)

A cookbook to run docker on your chromebook Read More »