Skip to content

Instantly share code, notes, and snippets.

View lhns's full-sized avatar

Pierre Kisters lhns

View GitHub Profile
@lhns
lhns / Tls.scala
Last active January 17, 2019 13:45
import java.net.InetSocketAddress
import java.nio.channels.AsynchronousChannelGroup
import AkkaStreamsCompat._
import akka.NotUsed
import akka.stream.TLSProtocol.{NegotiateNewSession, SslTlsInbound, SslTlsOutbound}
import akka.stream._
import akka.stream.scaladsl.{Flow, Keep, Source, TLS, Sink => AkkaSink}
import akka.util.ByteString
import cats.effect.{ConcurrentEffect, ContextShift, IO, Resource}
https://1drv.ms/f/s!AiH8wRq30VBFuS_IU0thSVtLpUci
JAVA_OPTS
-Dhttps.proxyHost=10.55.55.201 -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts="localhost^|127.0.0.1" -Dhttp.proxyHost=10.55.55.201 -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts="localhost^|127.0.0.1"
JAVA_HOME
Documents\jdk1.8.0_152
PATH
Documents\jdk1.8.0_152\bin
Downloads\PortableGit-2.21.0-64-bit\cmd
Downloads\sbt-1.1.6\sbt\bin
@lhns
lhns / gmailProtocolHandler.js
Last active May 29, 2019 08:23
Register Gmail as a protocol handler
navigator.registerProtocolHandler("mailto","https://mail.google.com/mail/u/1/?extsrc=mailto&url=%s","Gmail")
@lhns
lhns / ignoreRemoteKeyboardLayout.ps1
Last active June 14, 2019 15:17
Keep keyboard layout when connecting via RDP
#Requires -RunAsAdministrator
param ([bool]$value = $true)
New-ItemProperty -Force -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -Name "IgnoreRemoteKeyboardLayout" -PropertyType DWord -Value (&{If ($value) {1} Else {0}})
@lhns
lhns / windowsUpdatePowerManagement.ps1
Last active June 14, 2019 15:16
Prevent PC from waking up because of Windows updates
#Requires -RunAsAdministrator
# https://superuser.com/a/1414945/663027
param ([bool]$value = $false)
New-Item -Force -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows" -Name "WindowsUpdate"
New-ItemProperty -Force -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate" -Name "AUPowerManagement" -PropertyType DWord -Value (&{If ($value) {1} Else {0}})
@lhns
lhns / noLockScreen.ps1
Last active June 14, 2019 15:16
Disable Windows 10 lock screen
#Requires -RunAsAdministrator
param ([bool]$value = $true)
New-Item -Force -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows" -Name "Personalization"
New-ItemProperty -Force -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -PropertyType DWord -Value (&{If ($value) {1} Else {0}})
@lhns
lhns / git-change-author.sh
Last active May 29, 2019 19:38
Change author and committer of git commits
#!/bin/sh
# https://help.github.com/en/articles/changing-author-info
# https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi
git clone --bare https://github.com/user/repo.git
cd repo.git
git filter-branch --env-filter '
@lhns
lhns / nonadmin.bat
Created May 29, 2019 08:20
Force program to run without administrator privileges
:: https://superuser.com/a/981202/663027
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"
@lhns
lhns / firefox-esxi-console-fix
Created June 5, 2019 07:51
Fix firefox registering keypresses multiple times in the ESXi Webconsole
# https://communities.vmware.com/thread/580583
about:config
input_event_queue.supported=false
defrag C: /X /U /V