Editing Linux Grub Boot Loader

This is for my reference I recently needed to revert the Kernel on my iMac/Linux machine. I had updated to the latest version, which caused a problem with the Brightness not working anymore. On an iMac that meant I had no way to adjust the screen, as it doesn’t have any physical buttons. I attempted to edit the grub file from the boot loader, but that didn’t work as there doesn’t seem to be an editor in the boot shell. So after booting up a very bright UI I edited from the main UI. ...

21 July 2024 · Mark

Open - command Mac terminal

Open, command Mac terminal: Most Mac users will know that the open command in the Terminal will open files in the GUI or open a directory in Finder for example open . will open Finder in the current directory, this is useful, but there are a few more things it can do including opening in a specified application. Here is the usage dump from the tool: Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-s <partial SDK name>][-b <bundle identifier>] [-a <application>] [-u URL] [filenames] [--args arguments] Help: Open opens files from a shell. By default, opens each file using the default application for that file. If the file is in the form of a URL, the file will be opened as a URL. Options: -a Opens with the specified application. -b Opens with the specified application bundle identifier. -e Opens with TextEdit. -t Opens with default text editor. -f Reads input from standard input and opens with TextEdit. -F --fresh Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents. -R, --reveal Selects in the Finder instead of opening. -W, --wait-apps Blocks until the used applications are closed (even if they were already running). --args All remaining arguments are passed in argv to the application's main() function instead of opened. -n, --new Open a new instance of the application even if one is already running. -j, --hide Launches the app hidden. -g, --background Does not bring the application to the foreground. -h, --header Searches header file locations for headers matching the given filenames, and opens them. -s For -h, the SDK to use; if supplied, only SDKs whose names contain the argument value are searched. Otherwise the highest versioned SDK in each platform is used. -u, --url URL Open this URL, even if it matches exactly a filepath -i, --stdin PATH Launches the application with stdin connected to PATH; defaults to /dev/null -o, --stdout PATH Launches the application with /dev/stdout connected to PATH; --stderr PATH Launches the application with /dev/stderr connected to PATH to Examples: View a MD file in Marked 2.app: open -a Marked\ 2 markdown.md ...

2 February 2023 · Mark

Linux Mint Login Loop

The default installation of Linux Mint on my iMac went very well right up until the moment it didn’t. I don’t know the cause, but I did find a few posts online about the problem I had, namely a login loop: whereby the login screen appeared to accept the login details only to show a blank screen momentarily, and then return to the login prompt. There were comments online proffering a solution in the form of ALT-CTRL-F1 etc. Which is supposed to open a terminal window to allow fixes to be applied. The problem for me was that none of the function keys worked F1, F2 etc. ...

15 January 2023 · Mark

Multiple Symbolic Links Windows

Create a batch file, for example: symlink.bat with the following content and edit the source and target locations to suit. @echo off set "source=c:\source\directory" set "target=c:\target\directory" set "exclude=%temp%\exclude.txt" ( rem exclude files/dires with these strings into full path echo .txt echo pipe.cmd rem escaped backslash and initial and final quotes to avoid partial matches echo "c:\\source\\directory\\something.txt" rem exclude thisNot file/directory from source directory echo "%source:\=\\%\\thisNot" )> "%exclude%" forfiles /P "%source%" /C "cmd /c (echo @path|findstr /i /v /g:"%exclude%" >nul) && if @isdir==TRUE (mklink /d \"%target%\\\"@file @path) else (mklink \"%target%\\\"@file @path)" del "%exclude%" > nul Original answer posted on: stackoverflow

2 November 2021 · Mark

Git Version Control Setup

After a few false starts I have finally got my Hugo site setup to use git submodule to push the HTML output to the remote webserver. It was a little involved at first, but once I got my head around the idea of a git repo within a git repo, not being a git repo but rather just a folder marked as a submodule of some parent module… you get the idea. A confusing concept that is simple and sounds simple, but isn’t explained particularly well in any article I found. ...

25 October 2021 · Mark

Change Mac Machine Name via Terminal

I needed to change the name of one of my Macs remotely and this is the command to do it: sudo scutil --set HostName [NewHostNameHere]

22 October 2021 · Mark

SSH copy keys from Windows

I have recently been setting up an old Mac Mini as Webserver and NAS server. One of the things I wanted to do was enable ssh key pair login and wondered how one used ssh-copy-id on a Windows machine to get the public key from a local machine to the server. It turns out you can’t but the cat command can do it just fine. Here is the template: type C:\Users\<user>\.ssh\id_rsa.pub | ssh <user>@<remoteserver> 'cat >> .ssh/authorized_keys' This assumes your public key is in the default location, your home directory under the .ssh directory, if not modify the first part of the command to reflect its location ...

22 October 2021 · Mark