Skip to content

Instantly share code, notes, and snippets.

View abstrask's full-sized avatar

Rasmus Rask abstrask

  • Veo Technologies
  • Copenhagen
  • 18:51 (UTC +01:00)
View GitHub Profile
# https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate
<#
In order to configure Git to use the "Windows" OpenSSH (found at %SystemRoot%\System32\OpenSSH),
rather than the one packaged with Git for Windows (at %ProgramFiles%\Git\usr\bin) and enable agent forwarding,
set Git's core.sshCommand configuration property "C:\Windows\System32\OpenSSH\ssh.exe" -T (with double-quotes).
#>
# Using environmental variable GIT_SSH_COMMAND:
[Environment]::SetEnvironmentVariable("GIT_SSH_COMMAND", """$((Get-Command ssh).Source)"" -T", [System.EnvironmentVariableTarget]::User)
# https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration
# Install OpenSSH client and server
Get-WindowsCapability -Online -Name OpenSSH* | Add-WindowsCapability -Online
# Set default SHH shell to PowerShell Core
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "${env:ProgramFiles}\PowerShell\7\pwsh.exe" -PropertyType String -Force
# Set the ssh-agent service to be started automatically
Get-Service -Name ssh-agent | Set-Service -StartupType Automatic
@abstrask
abstrask / ReclaimWin10.ps1
Last active March 4, 2022 12:30 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
<#
To do - from OneNote: Win10 hardening (on public connections)
§ Disable IE auto configuration
§ Disable SMB1
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
§ Enable firewall, disable network sharing and discovery (public network profile)
Set-NetFirewallProfile -Name Public -Enabled True
Get-NetFirewallRule -DisplayGroup "File and Printer Sharing" | ? {$_.Profile -eq 'Public'} | Set-NetFirewallRule -Enabled false
@abstrask
abstrask / Get-SharedMailboxItems.ps1
Last active January 15, 2019 12:18
Get email items from shared Exchange mailbox through Outlook. Can be modified to also output body (and other properties) of messages.
<#
https://msdn.microsoft.com/en-us/magazine/dn189202.aspx
https://blogs.technet.microsoft.com/heyscriptingguy/2011/05/26/use-powershell-to-data-mine-your-outlook-inbox/
#>
Param (
[Parameter(Mandatory=$true)]
[string]$SharedMailboxEmailAddress,
[Parameter(Mandatory=$false)]
$RemoteNetwork = "192.168.1.0/24", "10.0.0.0/24"
# Enable connection when both VPN server and client is behind NAT-T
# http://support.microsoft.com/kb/926179
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\PolicyAgent -Name AssumeUDPEncapsulationContextOnSendRule -Type DWord -Value 2 -Force
# Add route(s) to remote networks
$RemoteNetwork | % {Add-VpnConnectionRoute -ConnectionName $VPNConnectionName -DestinationPrefix $_}
@abstrask
abstrask / 00-button
Last active November 13, 2023 06:32 — forked from jefferyto/00-button
Scripts for OpenWrt on TP-Link TL-MR3020 to change network configs using 3-position sliding switch. Configuration changes by UCI/LuCI overwrites the symbolic links used by original scripts. This version copies the scripts instead of using symbolic links. Added script attached to WPS button, to commit the updated config to the current config (3g,…
# based on
# https://dev.openwrt.org/browser/trunk/target/linux/atheros/base-files/etc/hotplug.d/button/00-button
# https://forum.openwrt.org/viewtopic.php?pid=172110#p172110
. /lib/functions.sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
do_button () {
local button