Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
exec "$@"
@marrobHD
marrobHD / New-ISOFile.ps1
Created April 28, 2021 18:41
Create an ISOFile with PowerShell from a folder
function New-IsoFile
{
<# .Synopsis Creates a new .iso file .Description The New-IsoFile cmdlet creates a new .iso file containing content from chosen folders .Example New-IsoFile "c:\tools","c:Downloads\utils" This command creates a .iso file in $env:temp folder (default location) that contains c:\tools and c:\downloads\utils folders. The folders themselves are included at the root of the .iso image. .Example New-IsoFile -FromClipboard -Verbose Before running this command, select and copy (Ctrl-C) files/folders in Explorer first. .Example dir c:\WinPE | New-IsoFile -Path c:\temp\WinPE.iso -BootFile "${env:ProgramFiles(x86)}\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\efisys.bin" -Media DVDPLUSR -Title "WinPE" This command creates a bootable .iso file containing the content from c:\WinPE folder, but the folder itself isn't included. Boot file etfsboot.com can be found in Windows ADK. Refer to IMAPI_MEDIA_PHYSICAL_TYPE enumeration for possible media types: http://msdn.micr
@marrobHD
marrobHD / install-storjio.sh
Last active February 15, 2022 16:58
Installs a Storj.io storagenode on Ubuntu Server/Debian(install or remove sudo from script) moved to https://blob.CLITools.tk/install-storjio
# !WARNING!
# Script moved to https://blob.CLITools.tk/install-storjio(https://github.com/marrobHD/clitools/blob/master/install-storjio)
# This script is no longer updated on GitHub Gist.
# !WARNING!
#!/bin/bash
@marrobHD
marrobHD / uninstall-docker.sh
Last active June 29, 2020 14:11
Fully removes docker and docker-compose
# !WARNING!
# Script moved to https://blob.CLITools.tk/uninstall-docker(https://github.com/marrobHD/clitools/blob/master/uninstall-docker)
# This script is no longer updated on GitHub Gist.
# !WARNING!
# Remove docker compose
sudo rm $(which docker-compose)
sudo pip uninstall docker-compose
@marrobHD
marrobHD / install-docker.sh
Last active June 29, 2020 14:12
Install Latest Docker and Docker-compose on Ubuntu
# !WARNING!
# Script moved to https://blob.CLITools.tk/install-docker(https://github.com/marrobHD/clitools/blob/master/install-docker)
# This script is no longer updated on GitHub Gist.
# !WARNING!
# wget -qO- https://gist.github.com/marrobHD/42f1ab222d4f83e811b15bae72a346ea/raw | bash
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
@marrobHD
marrobHD / docker-cleanup
Created June 5, 2020 20:21
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
@marrobHD
marrobHD / proxmoxve_community.sh
Last active May 18, 2020 18:55
How to setup a community version of Proxmox VE 5.x-6.x
# Disable Commercial Repo
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list && apt-get update
# Add PVE Community Repo
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list && apt-get update
# Remove nag
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script && apt --reinstall install proxmox-widget-toolkit
@marrobHD
marrobHD / remove-cluster.sh
Last active July 1, 2020 12:13
Removing/Deleting a created cluster in Proxmox 6.1-8
Moved to https://github.com/marrobHD/proxmox-tools/blob/master/leave-cluster.sh
and https://raw.githubusercontent.com/marrobHD/proxmox-tools/master/leave-cluster.sh
@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