Skip to content

Instantly share code, notes, and snippets.

@marrobHD
marrobHD / hassosproxmoxinstall.sh
Last active March 13, 2020 11:05
This script will create a new Proxmox VM with the latest version of HassOS. To create a new VM in the local-lvm storage, run the following in a SSH session or the console from Proxmox interface
#!/bin/bash
# wget -qO - https://gist.githubusercontent.com/marrobHD/760704aa7c864a10a7c5c5fa323b0012/raw/043d2f61ad5717228504f476e923eb829b3f9d58/hassosproxmoxinstall.sh | bash -s local-lvm
set -o pipefail
shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR
function error_exit() {
REASON=$1
MSG="\e[91mERROR: \e[93m$EXIT@"
@marrobHD
marrobHD / add_domains.bat
Created February 16, 2020 15:44
Windows 10: Add trusted domains to all users using batch
@ECHO OFF
SETLOCAL
SET REG="%WINDIR%\system32\reg.exe"
SET INTRANET_DOMAINS=contoso.local example.local
SET TRUSTED_DOMAINS=microsoft.com example.com
IF EXIST "%USERPROFILE%\..\Default User\NTUSER.DAT" SET NTUSER="%USERPROFILE%\..\Default User\NTUSER.DAT"
IF EXIST "%USERPROFILE%\..\Default\NTUSER.DAT" SET NTUSER="%USERPROFILE%\..\Default\NTUSER.DAT"
IF DEFINED PROGRAMFILES(x86) SET X64=TRUE
@marrobHD
marrobHD / resize.sh
Last active January 18, 2020 12:39
Resize partition
#!/bin/bash
set -e
if [[ $# -eq 0 ]] ; then
echo 'please tell me the device to resize as the first parameter, like /dev/sda'
exit 1
fi
if [[ $# -eq 1 ]] ; then