techie

    Searching websites from the Edge address bar

    I didn’t know you could set up site searches in Edge. I assume it’s the same in Chrome, Chromium etc.

    You do it as follows.

    • go to Settings

    • in the search do ‘Manage Search Engines’

    • fill in the form as below

    The easy way to get the URL is to go to the site you want to set up a search for and do a search. Copy the URL you end up on, and replace your search term with %s

    I dunno if I’d use this for lots of websites…but it’s particularly handy for work-environment wiki and trouble-ticket systems

    A dialog box labeled Add site search displays fields for entering a search engine name, a shortcut, and a URL template for queries.

    I knew you could install Chrome extensions in Edge...but I didn't know how.

    • click on the extension button…which looks like a piece of a jigsaw puzzle, then
    • Manage Extensions, then
    • switch the switch for ‘Allow extensions from other stores.’, then
    • do a search, then when it can’t find the extension in the Edge store…
    • click on the Chrome Web Store link

    You could just use Chrome instead….but for reasons I can no longer remember, I prefer Edge

    <img src=“https://cdn.uploads.micro.blog/139254/2025/screenshot-2025-04-03-171141.png" width=“600” height=“321” alt=“A browser tab displays the Extensions page of Microsoft Edge with no search results found for “po” and a prompt to get extensions.">

    Using Out-Gridview to interactively select one item from a collection

    I’m not sure I’ve ever had cause to do this before…but it’s quite handy.

    I’m writing an add-on to Spotishell, a powershell module for mucking about with Spotify. I’m searching for a song and then I want to manually select the one that I think is the best version to include on a playlist.

    Out-Gridview turns out to be perfect for this.

    The code is:

    $SelectedTrack = $CollectionOfTracks | 
    select-object track,
            artist,
            album,
            released, 
            trackid | 
    Out-GridView -OutputMode Single
    

    This returns the one track into the $SelectedTrack variable.

    <img src=“https://cdn.uploads.micro.blog/139254/2025/screenshot-2025-03-31-175209.png" width=“600” height=“342” alt=“A computer window displays a list with details about tracks titled “The Sick Bed of Cuchulainn” by The Pogues, including albums, release years, and unique identifiers.">

    #TodayILearned that in VS Code there is a command called “View: Toggle Locked Scrolling Across Editors” which sync’s the scrolling between two windows (or are they called panes). Anyway it’s v handy for comparing two chunks of code #VsCode

    If I had a pound for every time I had to look up how to do Ctrl-Alt-Del on a remote machine I’d be slightly more wealthy

    <img src=“https://cdn.uploads.micro.blog/139254/2025/img-20250211-1140462.jpg" width=“347” height=“600” alt=“The image features the words “Ctrl - Alt - End” written in a stylized, possibly hand-painted font.">

    Proposed new entry for the Meaning of Liff, IT Workers Edition

    Bullock’s Horn - the situation in which you find yourself when someone asks you to help with something, and you go to consult with someone else who you think will know about it, and they direct you back to the person who asked for help in the first place

    Wikipedia - The Meaning of Liff

    map showing Bullocks Horn in north Wiltshire

    How to delete from a tweets micro.blog with powershell

    These were my last three tweets on the blog…and, I think, the last tweets I posted

    invoke-restmethod https://micro.blog/micropub?mp-destination=https://mattypenny-tweets.micro.blog`&q=source`&offset=0`&limit=3 `
      -Method get -Header $RestMethodHeaders | 
      select -expand items | 
      select -expand properties | 
      select url,content          
    
    url                                                                        content
    ---                                                                        -------
    {https://mattypenny-tweets.micro.blog/2022/12/31/1609327355398443008.html} {Happy new year to you and yours!}
    {https://mattypenny-tweets.micro.blog/2022/12/24/1606763511543209984.html} {God bless us, every one}
    {https://mattypenny-tweets.micro.blog/2022/12/23/1606293329544548352.html} {My word of the day today is 'myrrh'.}
    
    
    

    So, to delete a specific tweet from the micro.blog….

    Set up the headers

    $RestMethodHeaders = @{
        "Authorization" = "Bearer $BlogToken"
    }
    
    

    Delete the ‘happy new year’ one

    invoke-restmethod https://micro.blog/micropub?mp-destination=https://mattypenny-tweets.micro.blog`&url=https://mattypenny-tweets.micro.blog/2022/12/31/1609327355398443008.html`&action=delete `
      -Method post `
      -Header $RestMethodHeaders
    

    …and abracadbra

    invoke-restmethod https://micro.blog/micropub?mp-destination=https://mattypenny-tweets.micro.blog`&q=source`&offset=0`&limit=3 -Method get -Header $RestMethodHeaders | select -expand items | select -expand properties | select url,content
    
    
    url                                                                        content
    ---                                                                        -------
    {https://mattypenny-tweets.micro.blog/2022/12/24/1606763511543209984.html} {God bless us, every one}
    {https://mattypenny-tweets.micro.blog/2022/12/23/1606293329544548352.html} {My word of the day today is 'myrrh'.}
    {https://mattypenny-tweets.micro.blog/2022/12/22/1605866305227087873.html} {My word of the day today is 'eggnog'.}
    
    

    Things that annoy me #1035

    When you need a password and MFA to see some IT documentation.

    Especially when it doesn’t work in my default browser

    The job title ‘Platform Engineer’ sounds to me like I’m working on an oil rig

    After years and years of having an Android phone, I’ve only just discovered the usefulness of the Gboard personal dictionary, with the suggestion bar turned on.

    I’ve got ‘xxm’ set up to generate a markdown link

    Gboard settings can be accessed by long pressing the comma

    Smartprix page about Gboard

    Screenshot of micro.blog post screen with xxm generating the suggestion [xxx](yyy)

    That’s kind of irritating….the much-used-by-me ‘Format Document’ command in VS Code has a different keyboard shortcut in Linux

    • Windows is Shift + Alt + F
    • Linux is Ctrl + Shift + i
    screenshot from vs code

    I maybe need to get this tattoo-ed on something prominent

    “The road to programming hell is paved with “best practices” applied too early.”

    Winning is the worst thing that can happen in Vegas – Signal v. Noise

    I linux-ified my aging windows laptop over the weekend

    All good, in general, and I’ll be able to get another couple of years out of it

    I found that:

    • I had to run the installer twice before it worked

    • gpodder picked up all my subscriptions from gpodder.net, which was handy, because I’d forgotten to export the opml

    • I had to log out and back in again to get gpodder to save to the folder I specified

    • Spotify seems identical. I use custom order, which I wasn’t expecting to be there in the Linux version….I’m wondering whether it’s actually the windows version running under wine

    • it’s a shame PSClock won’t run

    • I installed the Mate desktop…I very much prefer that to the default Ubuntu one

    • I haven’t got gvim set up yet

    • or VS Code

    • or any powershell stuff beyond installing it

    ……but it’s all good

    Ubuntu mate wall paper with a new Brighton lighthouse apparently

    Shortcuts to fold and unfold text in VS Code #VsCode

    ctrl+shift+[ to fold and ctrl+shift+] to unfold

    Which absolute idiot wrote this?

     $ThisTimeYesterday = $(Get-Date).AddHours(24)
    

    I think it’s important, on a Monday morning, to set one’s goals for the working week.

    My goal for this week: stop spelling ‘Terraform’ as ‘Terrafrom’

    Today’s newly-acquired superpower is remembering that, in vim, ‘*’ jumps you to the next occurrence of the word the cursor is on. Super useful for jumping between a function and calls to that function.

    superman picking up a car

    This isn’t perfect, in that it doesn’t cope with the ‘nd’ in ‘2nd’, bit it’s good enough

    A vim mapping to insert the day and date as a header for notes, journals etc

    map <Leader>m :put =strftime('%A %dth %B %Y')<cr>:s/ 0/ /<cr>kJi## <Esc>
    

    #TodayILearned that:

    Initialisms are made from the first letter (or letters) of a string of words, but can’t be pronounced as words themselves (e.g. FBI, CIA). Acronyms are made from the first letter (or letters) of a string of words but are pronounced as if they were words themselves (e.g. NASA, hazmat). What I Learned: The Phoenix Project Audiobook - IT Revolution

    Personally, I’m not sure that this is a very useful distinction, but it’s interesting

    I guess ‘SQL’ is an initialism to those who pronounce it ‘S.Q.L’ and and acronym for those who say ‘sequel’.

    How to set default parameters for other people's Powershell cmdlets

    Not exactly #TodayILearned because I vaguely remember learning that you can do this, but had never got around to doing so.

    This is how you can set a default parameter in Powershell. As far as I know, it works with any cmdlet. I’m using it here to set the default for Pester to show me all the results of all the tests….because I love seeing that sea of green :)

    $PSDefaultParameterValues += @{ 'Invoke-Pester:Output' = 'Detailed' }
    

    #Powershell

Older Posts →