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
#!/usr/bin/env sh | |
set -u | |
# https://stackoverflow.com/questions/2683279/how-to-detect-if-a-script-is-being-sourced#28776166 | |
sourced=0 | |
if [ -n "${ZSH_EVAL_CONTEXT-}" ]; then | |
case $ZSH_EVAL_CONTEXT in *:file) sourced=1;; esac; | |
elif [ -n "${KSH_VERSION-}" ]; then | |
if [ "$(cd "$(dirname -- "$0")" && pwd -P)/$(basename -- "$0")" != "$(cd "$(dirname -- "${.sh.file}")" && pwd -P)/$(basename -- "${.sh.file}")" ]; then | |
sourced=1 |
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
#!/usr/bin/env bash | |
#################################################################################################### | |
# | |
# FIX GRUB FOR ENCRYPTED INSTALLATION | |
# | |
# This script is based on the Troubleshooting part of the Manual Full System Encryption for Ubuntu. | |
# See https://help.ubuntu.com/community/ManualFullSystemEncryption/Troubleshooting | |
# | |
# This is NOT AN OFFICIAL Ubuntu script, it can and will break your system. Use at own risk. |
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
<# | |
.SYNOPSIS | |
Removes null property values from objects. | |
.DESCRIPTION | |
Removes property values that are null (or empty, unless -LeaveEmptyStrings parameter is use) from an object or array of objects. Additional items may be removed if they are passed as input to the -AlsoRemove parameter. | |
.EXAMPLE | |
[pscustomobject]@{Number=1;String="Test";Empty="";Null=$null} | Remove-Null | |
Number String | |
------ ------ |
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
<# | |
.SYNOPSIS | |
Add a Wi-Fi network profile to the wlan table | |
#> | |
Function Add-WifiNetwork { | |
[CmdletBinding(DefaultParameterSetName='PassPhrase')] | |
Param( | |
## The name of a wireless LAN profile, as well as the SSID of the wireless LAN. | |
[Parameter(Position=0,Mandatory=$true)] | |
[String]$SSIDName, |
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 Format-NewBootableUSB() { | |
[CmdletBinding(DefaultParameterSetName='Default')] | |
Param( | |
[Parameter(Position=0,Mandatory=$True,ParameterSetName='Default')] | |
[Parameter(Position=0,Mandatory=$True,ParameterSetName='CopyOnly')] | |
[String]$FirstPartitionSourceFolder, | |
[Parameter(Position=1,ParameterSetName='Default')] | |
[Parameter(Position=1,ParameterSetName='CopyOnly')] | |
[String]$SecondPartitionSourceFolder, |
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
#!/usr/bin/env sh | |
say() { if ! ${quiet:-false}; then printf '%s\n' "$@"; fi; } | |
err() { echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2; } | |
# File name of the Windows xserver program | |
win_xserver='vcxsrv.exe' | |
# Full path to the Windows xauth program for the running xserver | |
# PROGRA~1 is the short name for "Program Files", which solves spaces issues |