Skip to content

Instantly share code, notes, and snippets.

View oliverlabs's full-sized avatar
💭
Focus.

Oliver Gulich oliverlabs

💭
Focus.
View GitHub Profile
@oliverlabs
oliverlabs / windows_shortcuts.md
Last active January 18, 2024 14:21
Windows Shortcuts

List of Nifty Windows 11 Shortcuts

Win + Alt + S - Launch Sticky Notes sidebar and start capturing notes.

Win + C - Open Windows Copilot

Win + E - Open Windows Explorer

Win + I - Open Windows System Settings

@oliverlabs
oliverlabs / bluetooth.ahk
Created January 3, 2024 09:55
Open Bluetooth Settings using AutoHotkey
#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%
; Hotkeys
; if a single line, no need for a return at the end
; if multiple lines, use a return at the end of each line
#K::Run, ms-settings:connecteddevices ; Win+K - Open Windows Bluetooth Devices
@oliverlabs
oliverlabs / mcd.ps1
Created September 27, 2023 14:56
This function creates a folder and performs a cd operation into it with one command
# This function creates a folder and cd into it
function mcd {
param (
[Parameter(Mandatory = $true)]
[string]$folderName
)
New-Item -ItemType Directory -Force -Path $folderName
Set-Location -Path $folderName
@oliverlabs
oliverlabs / venv-functions.ps1
Created September 26, 2023 09:09
PowerShell Functions to activate and deactivate a Python virtual environment
## Activate a Python Virtual Environment
Function vea {
Get-ChildItem activate.ps1 -Recurse -Depth 2 | % { $_.FullName } | Invoke-Expression
}
## Deactivate a Python Virtual Environment
Function ved {
Invoke-Expression "deactivate -nondestructive"
}
@oliverlabs
oliverlabs / setx.ps1
Created August 14, 2023 14:19
Set a user environment variable in PowerShell
# Set a user environment variable in PowerShell
setx MACHINE Brand1
# echo $env:MACHINE
@oliverlabs
oliverlabs / gh-repo-rbac.sh
Created August 9, 2023 11:42
Check user permissions for a GitHub repository using GitHub CLI
# This command requires gh cli to be installed
OWNERORG="test"
REPOSITORY="test"
GHUSERNAME="test"
gh api repos/$OWNERORG/$REPOSITORY/collaborators/$USERNAME/permission | jq '.permission' -r
@oliverlabs
oliverlabs / subnet-array.bicep
Created August 8, 2023 15:27
Create new virtual network subnets from an array in Bicep
var addressSpace = [
'10.0.0.0/22'
]
var subnets = [
{
name: 'test1'
subnetPrefix: '10.0.3.0/26'
}
{
@oliverlabs
oliverlabs / ConnectP2S.ps1
Created July 21, 2023 13:13
This script triggers the built-in Windows VPN client and auto-connects
rasphone "<INSERT-YOUR-VPN-CONNECTION-NAME>"
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Network Connections')
Sleep 2
$wshell.SendKeys('~')
Sleep 2
$wshell.SendKeys('~')
@oliverlabs
oliverlabs / apache_install.md
Last active July 20, 2023 08:15
Install Apache on a Lunux VM

Step 1 - Install Apache2

sudo apt install -y apache2

Step 2 - Open an inbound port in an NSG

Open Port 80 or 443

Step 3 - Check Apache2 Server Status