This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# become root | |
sudo su - | |
# change dir to easy rsa | |
cd /etc/openvpn/easy-rsa | |
# source the environment vars | |
source ./vars | |
# create a new cert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Theme | |
ZSH_THEME="pygmalion" | |
# Uncomment the following line to use case-sensitive completion. | |
CASE_SENSITIVE="true" | |
# Uncomment the following line to use hyphen-insensitive completion. Case |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$uri = 'https://api.netatmo.com/oauth2/token' | |
$body = @{ | |
"client_id" = "ClientID"; | |
"client_secret" = "ClientSecret"; | |
"grant_type" = "password"; | |
"username" = "Mail"; | |
"password" = "Password" | |
} | |
$uri = 'https://api.netatmo.com/oauth2/token' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Netatmo-DoAuth { | |
$postParams = @{ | |
grant_type='password'; | |
client_id=$client_id; | |
client_secret=$client_secret; | |
username=$Netatmo_username; | |
password=$Netatmo_password | |
} | |
$Request = Invoke-WebRequest -Uri https://api.netatmo.com/oauth2/token -Method POST -Body $postParams -UseBasicParsing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------ | |
# THIS CODE AND ANY ASSOCIATED INFORMATION ARE PROVIDED “AS IS” WITHOUT | |
# WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT | |
# LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS | |
# FOR A PARTICULAR PURPOSE. THE ENTIRE RISK OF USE, INABILITY TO USE, OR | |
# RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER. | |
#------------------------------------------------------------------------------ | |
$global:access_token = $null | |
$global:refresh_token = $null | |
#Netatmo Details. Client ID and secret from creating the App, and a username and password that has access to the api. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mklink /d D:\TEMP\Spotify C:\Users\<username>\AppData\Local\Spotify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Mac = "1A:2B:3C:4D:5E:6F" | |
$MacByteArray = $Mac -split "[:-]" | ForEach-Object { [Byte] "0x$_"} | |
[Byte[]] $MagicPacket = (,0xFF * 6) + ($MacByteArray * 16) | |
$UdpClient = New-Object System.Net.Sockets.UdpClient | |
$UdpClient.Connect(([System.Net.IPAddress]::Broadcast),7) | |
$UdpClient.Send($MagicPacket,$MagicPacket.Length) | |
$UdpClient.Close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove duplicate lines | |
^(.*)(\r?\n\1)+$ -> Replace with $1 | |
# Get the third octett of an IP-Adress: | |
\b\d{1,3}\.\d{1,3}\.\K\d{1,3}(?=\.\d{1,3}\b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save Factorio-Mod-Pack and probably upload it to a http server via sftp | |
# Assume "normal" installation | |
$SftpServer = 'server.blah.com' | |
$UserName = 'username' | |
$KeyFile = '$env:userprofile\key.pem' # Make sure the keyfile has no password, because posh-ssh is not ready yet | |
$SftpPath = '/var/www/mods.server.blah.com' | |
$FilePath = "$env:appdata\factorio\_mods.zip" | |
# Create an empty Credential-Object because reasons. (to be honest: posh-ssh is not ready yet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make install of modules a little bit more easier | |
$PSDefaultParameterValues['Install-Module:Scope'] = 'CurrentUser' | |
# For VS:Code | |
$ErrorActionPreference = "Silentlycontinue" | |
# Make the shell nice and h4x0r-style | |
$Shell = $Host.UI.RawUI | |
$Shell.BackgroundColor="Black" |
OlderNewer