Category: Simple Stuff I Forget

OpenVPN reconnect

My OpenVPN likes to have difficulty and go yellow from time to time.  The problem with this is twofold – I have any and all downloads stop at the absence of VPN, and when I’m not home connecting to my server is more difficult when VPN has hundged up.  The simplest fix for now is just to restart/reconnect VPN on the daily.

I use OpenVPN with PIA.

First thing to do is create a autologin VPN profile.  See how to do that here.  Yes yes, there are inherent security issues with this.  Obviously if you’re worried about that you’re not in the market for this solution in the first place.

After creating and testing your autologin, create a daily task (preferably at a time when you know your host box will be idle).  Add the following Actions:

Setting –connect in the third program start to point to the .ovpn file you created for autologin.  Make sure to set this task to Run with highest privileges to avoid UAC prompts interrupting the process.

Windows 10 – Can’t enable System Restore

System Restore.JPG

For some reason on my most recent build of Win 10 (don’t get me started) the option to enable System Restore was grayed out.  I fixed it by running the following in a admin level CMD prompt:

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore" /v "DisableSR" /f
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore" /v "DisableConfig" /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SPP\Clients" /v " {09F7EDC5-294E-4180-AF6A-FB0E6A0E9513}" /t REG_MULTI_SZ /d "1" /f

The first two lines didn’t find those keys, FYI.  Still, the third enabled my ability to set up System Restore.

Windows 10 Hyper V Woes

I recently needed to set up a Win10 Hyper V, and then join it to a domain over a VPN connection.  The first issue that I faced was that Cisco Anyconnect VPN client detected the virtual machine as a Remote Desktop Connection and refused to allow it to connect.  I solved this by switching from Enhanced Session to Basic Session by clicking this on the toolbar of the virtual machine:

My second issue was that, even after successfully joining the machine to the domain, there was no Switch User option (I needed to switch to a domain user while on the VPN in order for it to authenticate to the domain server and build the local profile for the domain user).  No matter where I looked there was no option.  Not in the power options, not via Alt+F4, nowhere.

I solved this by invoking tsdiscon.exe directly via a run line.  Bear in mind that it’s my understanding tsdiscon.exe is not available in Win 10 Home edition, though I don’t know why anyone would build a virt of Home edition.

ZyXEL C1000Z Scheduled Reboot – Windows

So there’s nowhere in its OS to schedule a reboot of ZyXEL’s C1000Z router.  Thankfully you can use Telnet to do it.

First, enable Telnet.  Log into the router, then choose Advanced Setup > Remote Console.  Under Console State choose LAN Telnet Enabled.  Set your Telnet username and password and click Apply.

Now you’re ready to go.  Create a .vbs file and populate it with the below, changing the IP address, username and password to be applicable to your router.

Option explicit
Dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "telnet"
WScript.Sleep 3000
oShell.Sendkeys "open 192.168.1.1~"
WScript.Sleep 3000
oShell.Sendkeys "admin~"
WScript.Sleep 3000
oShell.Sendkeys "password~"
WScript.Sleep 3000
oShell.Sendkeys "reboot~"
WScript.Sleep 3000
oShell.Sendkeys "~"
WScript.Sleep 3000
oShell.Sendkeys "quit~"
Wscript.Quit

Save this file.  You can double click it to test it.  After having confirmed it works, create a task pointed to it in Windows Task Scheduler.  Modern Windows OSes should natively run a vb script in scheduler.  If not, use CScript to launch the script:

C:\Windows\System32\CScript.exe //Nologo //B X:\PathToYourScript\YourScript.vbs

Switching DNS – Windows

I use the mighty Pi-Hole to streamline my browsing experience.  Sometimes, though, the ole Hole can get in my way, blocking something I need to see.  If it’s a one time deal, and not something I want to whitelist (which Pi-Hole has thankfully made easy to do via the web interface as of the latest edition), I wanted an easy way to temporarily switch DNS servers.

Enter QuickSetDNS, a groovy little exe that can do just that. Download QuickSetDNS and unpack it into the destination of your choosing.  There’s no installer – it’s a simple standalone exe.  Fire it up, right click in the whitespace and create a new DNS server entry. I’ve got one for my Hole, and one that points to Google’s public DNS servers.

After creating your entries, right click on one and choose Copy SetDNS Command Line. Then right click on your desktop and create a new shortcut.  Paste the SetDNS command line in for the location of the shortcut and click Next.  Name it something informative, and save it.  Do the same with your other DNS entries in QuickSetDNS.

There.  Now you have shortcuts you can double click to change your local DNS settings.

Windows – Migrating Printers

At my POE we use virtual printers for all manner of file production.  It’s annoying.  What’s more annoying is when it’s time to upgrade a server using virtual printers.  Thankfully there’s a way to sorta kinda help the process, by sorta kinda easing the migration process.  The following screenshots are from Windows 2012 R2.  If you’re using a different Windows OS level your mileage may vary.  It’s my understanding that the titles of some of this differs by OS.

Continue reading

Windows Sticky Notes

I admit it – I use Windows Sticky Notes.  I hate how unconfigurable it feels though.  The font is terrible, for instance.  Lucky you can change it with a reghack.


REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Segoe Print (TrueType)"="consola.ttf"
"Segoe Print Bold (TrueType)"="consolab.ttf"

What’s happening here is, because the notes demand to use Segoe Print as the font, you’re changing what font Segoe Print actually is.  Replace the .ttfs with fonts of your choice.

There are also a myriad of shortcuts for modifying existing note text:

Ctrl+B – Bold text
Ctrl+I – Italic text
Ctrl+T – Strikethrough
Ctrl+U – Underlined text
Ctrl+Shift+L – Bulleted (press once) or Numbered (press twice) list
Ctrl+Shift+> – Increased text size
Ctrl+Shift+< – Decreased text size
Ctrl+A – Select all
Ctrl+Shift+A – Toggles all caps
Ctrl+L – Left aligns text
Ctrl+R – Right aligns text
Ctrl+E – Centers text
Ctrl+Shift+L – Small Alpha list (3rd), Capital Alpha list (4th), small roman (5th), Capital roman (6th)
Ctrl+1 – Single-space lines
Ctrl+2 – Double-space lines
Ctrl+5 – Set 1.5-line spacing
Ctrl+= – Subscript
Ctrl+Shift++ – Superscript