Skip to content

Instantly share code, notes, and snippets.

@kharloss
kharloss / cloudflare-delete-all-records.sh
Created February 13, 2023 18:43 — forked from slayer/cloudflare-delete-all-records.sh
Delete all DNS records for specified zone
#!/bin/bash
TOKEN="xxxxxxxxxxxxxxxxxxx"
ZONE_ID=2222222222222222222222222
# EMAIL=me@gmail.com
# KEY=11111111111111111111111111
# Replace with
# -H "X-Auth-Email: ${EMAIL}" \
# -H "X-Auth-Key: ${KEY}" \
@kharloss
kharloss / boxstarter-bare.ps1
Created September 9, 2021 17:40 — forked from flcdrg/boxstarter-bare-v3.ps1
My BoxStarter Scripts
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
@kharloss
kharloss / docker-compose-backup.sh
Created July 6, 2021 18:26 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@kharloss
kharloss / Deploy-VM.ps1
Created April 20, 2021 18:36 — forked from ronaldvanvugt/Deploy-VM.ps1
Deploy and customize a VM in vCenter with PowerCLI
# Deploy Windows Server 2008 or higher in vCenter
#### USER DEFINED VARIABLES ############################################################################################
$Domain = "" #AD Domain to join
$vCenterInstance = "" #vCenter to deploy VM
$Cluster = "" #vCenter cluster to deploy VM
$VMTemplate = "" #vCenter template to deploy VM
$CustomSpec = "" #vCenter customization to use for VM
$Location = "" #Folderlocation in vCenter for VM
$DataStore = "" #Datastore in vCenter to use for VM
@kharloss
kharloss / README.md
Created October 21, 2019 19:44 — forked from joffilyfe/README.md
GITEA + Drone (0.7|0.8)

Compose file to setup and host a Gitea and Drone environment

This environment is dependent off a common network for docker/git plugin and gitea-server, so for this work fine in closed networks we have to create a custom network before run this composefile.

First create your network:

docker network create gitea-network
@kharloss
kharloss / gist:b18d9f9cd7a328749b3036110fded451
Last active October 17, 2019 11:33 — forked from kaihendry/gist:cb0aa9ac431e1f8f0bab51b3ce757793
Mikrotik Hairpin suggestion from drmessano
add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=192.168.11.0/24 src-address=192.168.11.0/24
add action=dst-nat chain=dstnat comment="produse.trady.ro" dst-address=!192.168.11.1 \
dst-address-type=local dst-port=14680 protocol=tcp to-addresses=192.168.11.41 \
to-ports=80
@kharloss
kharloss / mpv_install.sh
Created February 15, 2019 10:30
install mpv player with video acceleration
#!/bin/bash
#### All credits goes to RPi_Mike via https://www.raspberrypi.org/forums/viewtopic.php?t=199775
##### Vidware_Downloads: My script philosophy is to keep things clean and simple. That's why my first step is to create 3 different folders to keep the main elements of my script completely separate from each other. Before anything can be built, we first have to download 6 files in the form of "stable release tarballs". This is the raw source code my script will use to build the 6 programs. We also need 4 GPU-related files from the Raspberry Pi Foundation's official GitHub site that provide OpenGL ES and EGL support (they allow mpv to "talk" to the Raspberry's VideoCore GPU and thus facilitate hardware acceleration). Finally, we need a "waf" file that will allow us to build mpv. All of this will go inside the "Vidware_Downloads" folder – which we're creating with the mkdir command:
mkdir Vidware_Downloads
@kharloss
kharloss / install_duplicati.sh
Created January 27, 2019 20:45
Install duplicati Linux / Ubuntu
#!/bin/bash
####################################
#
# Install Duplicati on Ubuntu/Debian
#
####################################
# check if latest version download latest Duplicati version
cd /tmp && wget https://updates.duplicati.com/beta/duplicati_2.0.4.5-1_all.deb
# Install package
@kharloss
kharloss / disable-out-of-stock.sql
Created January 22, 2018 23:31 — forked from carlessanagustin/disable-out-of-stock.sql
How to automatically disable out of stock products in PrestaShop
# from http://mypresta.eu/en/art/tips-and-tricks/how-to-disable-out-of-stock-product.html
# trigger name: active2disable_out-of-stock
# table: ps_stock_available
# time: AFTER
# event: UPDATE
@kharloss
kharloss / rename.py
Created January 22, 2018 19:53 — forked from igniteflow/rename.py
Python script to rename files in directory, transforming spaces to hyphens and the chars to lowercase
import os
"""
Renames the filenames within the same directory to be Unix friendly
(1) Changes spaces to hyphens
(2) Makes lowercase (not a Unix requirement, just looks better ;)
Usage:
python rename.py
"""