Tim D'Annecy


tdannecy@gmail.com

#Windows #AutoHotkey

This AutoHotkey script improves the way Windows inserts accents to be more MacOS-like. I don't like the way the International keyboard handles, so I wrote this script.

Press the right Shift key with one of the letters a,c,e,i,n,o,u to get those characters with commonly used accent or alternative characters. The left Shift key will capitalize as normal. The Control key can also be used for other characters.

  • o + right Shift = ó
  • o + right Shift + left Shift = Ó
  • o + right Shift + Control = ö
  • o + right Shift + left Shift + Control = Ö
  • ? + right Shift = ¿

And so on.

; Accent keys, used with Right Shift key
RShift & 4::Send {€}
return

RShift & A::
    If GetKeyState("LShift", "P")
        Send {Á}
	Else Send {á}
return

RShift & C::
	If GetKeyState("LShift", "P")
		Send {Ç}
	Else Send {ç}
return

RShift & E::
	If GetKeyState("LShift", "P")
		Send {É}
	Else Send {é}
return

RShift & I::
	If GetKeyState("LShift", "P")
		Send {Í}
	Else Send {í}
return

RShift & N::
	If GetKeyState("LShift", "P")
		Send {Ñ}
	Else Send {ñ}
return

RShift & O::
	If GetKeyState("LShift", "P")
		If GetKeyState("Control", "P")
			Send {Ö}
		Else Send {Ó}

	Else If GetKeyState("Control", "P")
			Send {ö}
		Else Send {ó}
return

RShift & U::
	If GetKeyState("LShift", "P")
		If GetKeyState("Control", "P")
			Send {Ü}
		Else Send {Ú}
	Else If GetKeyState("Control", "P")
			Send {ü}
		Else Send {ú}
return

RShift & ?::Send {¿}
return

#Windows #AutoHotkey

This script inserts the date into the current cursor position after a hotkey is pressed.

  • ddd inserts the date like 2021-01-09

  • DDD inserts the date like 2021-Jan-09

  • fff inserts the date like 20210109T084323-0400

  • FFF inserts the date like 20210109 @ 084344-0400

#SingleInstance force

:R*?:DDD::
    if GetKeyState("LShift", "P") {
        FormatTime, CurrentDateTime, , yyy-MMM-dd
        SendInput %CurrentDateTime%
    }
     else {
        FormatTime, CurrentDateTime, , yyy-MM-dd
        SendInput %CurrentDateTime%
    }
return

:R*?:FFF::
    if GetKeyState("LShift", "P") {
        FormatTime, CurrentDate, , yyyyMMdd
        FormatTime, CurrentTime, , HHmmss-0400
        SendInput %CurrentDate% @ %CurrentTime%
    }
     else {
        FormatTime, CurrentDateTime, , yyyyMMddTHHmmss-0400
        SendInput %CurrentDateTime%
    }
return

#Windows #Azure #EndpointIntune

The Freshservice Discovery Agent helps you keep track of your assets by sending details (and updates) about the machine it is installed on. You can use Microsoft Endpoint/Intune to deploy the Discovery Agent in all the computers in your tenant.

Download Discovery Agent

  1. In Freshservice, go to Admin –> Discovery Admin -> Discovery

  2. In the Download Agent section, choose Windows. Click the Download Agent button. Download Agent > Windows

Download Microsoft Win32 Content Prep Tool

  1. Go to the Microsoft Win32 Content Prep Tool Github page. Click on IntuneWinAppUtil.exe. Microsoft Win32 Content Prep Tool Github page

  2. Click the Download button. IntuneWinAppUtil.exe Download button

Creating the IntuneApp

  1. Open Windows Terminal or PowerShell as an Admin. Navigate to the downloaded exe file using cd Windows Terminal as Admin

  2. Type the command .\IntuneWinAppUtil.exe and press Enter.

  3. Fill in the information requested by the packager:

    • Please specify the source folder: Type . to use the current directory. I downloaded my Freshservice msi in a folder on the same level, so my entry would be ../FS

    • Please specify the setup file: Enter the location of the Freshservice Discovery Agent msi file. Mine is ../FS/fs-windows-agent-2.7.0.msi

    • Please specify the output folder: Type . to use the current directory. I put mine back in ../FS

    • Do you want to specify catalog folder (Y/N)? Just type n to continue.

  4. After entering that information, the package will be built in the location you specified. Microsoft Terminal INFO Done!!!

Create deployment package in Microsoft Endpoint/Intune

  1. Navigate to the Microsoft Endpoint main page.

  2. Click on the Apps blade on the right-side menu. Endpoint Apps

  3. Click All apps in the menu and then click on the Add button. Endpoint > All apps

  4. Choose Windows app (Win32) in the dropdown menu for App type and then click the Select button to continue. Select app type

  5. In the first page of the wizard, click the link Select app package file. Find the .intunewin package and click the OK button to begin uploading. Choose App package file

  6. Back on the “Add information” tab, put in the required information and click the Next button to continue. App information

  7. On the “Program” tab, don't change any of the default options. Click the Next button. Program

  8. On the “Requirements” tab, change the two required options. Click the Next button.

    • For “Operating system architecture”, select both 32 bit and 64 bit.

    • For “Minimum operating system”, select the lowest value. In this case, it's Windows 10 1607.

Requirements

  1. On the “Detection rule” tab, change the “Rules format” dropdown to “Manually configure detection rules.” Click the link to Add a new rule. In the popup pane, change the “Rule type” to “MSI” and the MSI product code should automatically generate the correct number. Click the OK button to continue and then Next. Detection rule

  2. On the “Dependencies” tab, just leave default and click the Next button. Dependencies

  3. On the “Assignments” tab, select the groups in the Required category on which you want the Freshservice Discovery tool to be installed. Click the Next button. Assignments

  4. On the “Review + create” tab, make sure the options look correct and then click the Create button. Review + create

  5. Remain on the page for a few minutes while the package uploads. When it's finished uploading and processing, the assignments will be populated and computers in the group will begin to receive the deployment. Uploading app

More information here:

#Powershell

I read through quite a bit of troubleshooting information trying to get Powershell to fully expand the output of commands from a MS Online Service Module—in this case, Exchange Online.

I kept getting outputs with ellipses:

Get-DistributionGroup -Identity examplegroup@example.com | Format-table -Wrap -Autosize -Property Name,Acceptmessagesonlyfrom

AcceptMessagesOnlyFrom
----------------------
{Office of the President, Bob Smith, Bob Jones, Bob Doe...}

The way Powershell is handling this output is frustrating to me. I am not used to a scripting language cleaning up its output to look pretty, unless I specify some filtering options.

I played around with multiple versions of -wrap or -autosize and a ton of other arguments thinking it was an issue with format-table. The problem in this case is actually a quirk in the MS module, not the Powershell format-table or format-list command.

Luckily, this Stack Overflow post[A] has the solution to set the following:

$FormatEnumerationLimit=-1

... and then run your commands.

I was trying to run the following command to see which users had permissions to email a distribution group with a send-from restriction:

Connect-ExchangeOnline
$FormatEnumerationLimit=-1
Get-DistributionGroup -Identity XXX | Format-table -Wrap -AutoSize -property acceptmessagesonlyfrom

#Windows #Powershell

I have had to run this script to re-enable the meetings plugin for Outlook countless times. We’re running Office 365 and I have an E5 license and it seems like Outlook just likes to turn off this plugin. Here’s how you can use Powershell to turn it back on.

$AddinName = 'UCAddin.dll'
$ErrorActionPreference = 'SilentlyContinue'
$OutlookVersion = (Get-Item HKLM:\SOFTWARE\Classes\Outlook.Application\CurVer)."(default)".Replace("Outlook.Application.", "")
$wshell = New-Object -ComObject Wscript.Shell

$wshell.Popup("Click 'OK' to close Outlook. [Haga clic en 'Aceptar' para cerrar Outlook.]",0,"Done",0x0) > $null
Get-Process 'OUTLOOK' | Foreach-Object { $_.CloseMainWindow() | Out-Null } | stop-process –force

Get-Item -Path "HKCU:\Software\Policies\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\AddinList" | Set-ItemProperty -Name $AddinName -Value 1
Get-Item -Path "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\DoNotDisableAddinList" | Set-ItemProperty -Name $AddinName -Value 1
Get-Item -Path "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\DisabledItems" | Remove-Item
Get-Item -Path "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\DisabledItems" | Out-Null
Get-Item -Path "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\CrashingAddinList" | Remove-Item
Get-Item -Path "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\CrashingAddinList" | Out-Null
Get-Item -Path "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\NotificationReminderAddinData" | Set-ItemProperty -Name ([string]::Format("{0}\dtype",$AddinName)) -Value 2
Get-Item -Path "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\NotificationReminderAddinData" | Set-ItemProperty -Name $AddinName -Value 2524611661
Get-Item -Path "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency" | Set-ItemProperty -Name "CheckPoint" -Value 1
Get-Item -Path "HKCU:\Software\Microsoft\Office\Outlook\Addins\UCAddin.LyncAddin.1" | Set-ItemProperty -Name '(Default)' -Value 0
Get-Item -Path "HKCU:\Software\Microsoft\Office\Outlook\Addins\UCAddin.LyncAddin.1" | Set-ItemProperty -Name 'LoadBehavior' -Value 3

$wshell.Popup("Outlook plugin for Skype for Business meetings re-enabled. [Complemento de Outlook para reuniones de Skype Empresarial re-habilitado.]",0,"Done",0x0) > $null

#Windows #iCloud

I had this come up at work and it’s a bigger pain than I realized.

Open Outlook and switch to the Contacts view. Find the contacts you want to move over and select them with Shift+click. It might be easier to put them in a folder to keep everything organized.

Once they’re selected, navigate to the Home tab in the Ribbon and select Forward Contact –> As a Business Card. This will create a new email message with the selected contacts formatted as .vcf files, the format that iCloud accepts. Send the message to your Outlook email address.

Outlook freaks out and crashes if you select too many contacts. I haven’t found a sweet spot, but it seems to be around 30 contacts at a time.

When the message arrives with your contacts, open it in Outlook and select one of the attachments. Click on the arrow to the right of the attachment and select Save All Attachments. Put them in a new folder somewhere on your computer.

Now, we get into the weeds. Outlook exports vcf contacts with the version set to 2.1. For some reason, iCloud doesn’t like the version and will refuse to import your contacts. I’m running Office Version 1906 (Build 11727.20244 Click-to-Run) and I’m on an Office 365 E5 license, so things may have changed since I wrote this guide. In any case, we need to change the version number in each file from 2.1 to 3.0.

You can do this using several different tools. I’m sure Regex will get you there, but figuring out the right syntax might be too much trouble. You could edit them one by one if you don’t have too many. I opened one of the .vcf files in Notepad++ and used the Find & Replace tool on my exported folder.

Once you’ve changed the version, log in to iCloud, open the Contacts page and click and drag the .vcf files over into the Contacts column. It should upload and import them to iCloud and you’ll be able to access them on your iPhone or other devices that use iCloud’s contact sync.

Let me know if this worked for you. I couldn’t find anything online, so it may be helpful to some people.

I ran into some issues installing emacs in a FreeBSD jail on my FreeNAS server and wanted to share how I got it working.

Before you start, install freshports for FreeBSD and load the packages. This can be done by running the following command:

portsnap fetch extract && portsnap fetch update

I should note that as of writing this post, I'm running FreeBSD Plex 11.1-STABLE in a Jail on a FreeNAS box running the same version of FreeBSD.

cd /usr/ports/editors/emacs && make FLAVOR=nox install clean ALLOW_UNSUPPORTED_SYSTEM=true

This should take a few minutes to compile the program, but after that, you can run emacs by just typing in emacs from the shell. Hope this helps!

#Windows

I ran into an issue trying to upgrade a Windows 7 machine to Windows 10. I kept getting an error that said...

Windows10UpgraderApp.exe – System Error

The program can't start because api-ms-win-core-libraryloader-l1-1-1.dll is missing from your computer. Try reinstalling the program to fix this problem.

I read through this [A] article and found the solution and I wanted to re-post it for my future use.

  1. Close the Windows 10 updater app, if open.

  2. Copy the file at C:\Windows\System32\wimgapi.dll

  3. Replace the file at C:\Windows10Upgrade\wimgapi.dll

That's it! You should be able to upgrade to Windows 10 without any other DLL issues.

#FreeBSD #Linux

I was trying to protect a file in a jail on my FreeNAS server but the chmod +t tag wasn't cutting it for me. I wanted to use flags to protect the file, a common practice in FreeBSD and other POSIX systems.

I tried running chflags schg foo.bar, but the terminal spat out “Operation not permitted.” I was puzzled. There are multiple instances where chflags support was added to ZFS many versions ago so I didn't understand why I couldn't use the feature.

I found out that the default FreeNAS jails template creates jails without support for changing flags. I had to go into the web interface and open up my jail instance, open the Advanced Settings, and add allow.chflags=1 to the Sysctls field.

Make sure you have a comma separating any other existing configuration and that you restart the jail for the changes to take effect.

Here's my current Sysctls field:

allow.raw_sockets=true,allow.chflags=1

I'm running a jail version FreeBSD 10.3-STABLE #0 r295946+21897e6695f(HEAD) on FreeNAS-9.10.2-U6 (561f0d7a1).

#Windows #AutoHotkey

Just press the Control + Space keys and it will toggle the current window to lock on top of the others. This can get a bit wonky with multiple windows on top, but most of the time it works great.

^SPACE::  Winset, Alwaysontop, , A

Enter your email to subscribe to updates.