Skip to content

Instantly share code, notes, and snippets.

@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
#!/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 / 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 / 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 / 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 / ProxmoxNag.sh
Last active June 29, 2020 14:10
Removes the nag from Proxmox | Tested 5.1-3 - 6.2-4
# 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 / 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 / compile.sh
Last active March 14, 2020 23:00
Installs Hyperion.ng on Raspberry Pi 3B+ on debian
# How to use: wget -qO- https://gist.github.com/marrobHD/176dbcade1927db26121d65a66fa0aef/raw>install.sh && chmod +x install.sh && ./install.sh (var1: -i/-b) (var2: target) (var3: cfg)
# Example:
# with installation: wget -qO- https://gist.github.com/marrobHD/176dbcade1927db26121d65a66fa0aef/raw>install.sh && chmod +x install.sh && ./install.sh -i
# only build: wget -qO- https://gist.github.com/marrobHD/176dbcade1927db26121d65a66fa0aef/raw>install.sh && chmod +x install.sh && ./install.sh -b
# depraced way; WONT WORK only build: wget -qO- https://gist.github.com/marrobHD/176dbcade1927db26121d65a66fa0aef/raw | bash -s -- -b
#!/bin/sh