Skip to content

Instantly share code, notes, and snippets.

View dazeb's full-sized avatar
🎯
Focusing

Darren Bennett dazeb

🎯
Focusing
View GitHub Profile
docker container run -it -p 80:80 nginx

Create and run a container in background

docker container run -d -p 80:80 nginx
@dazeb
dazeb / Docker-Commands.md
Last active April 20, 2024 21:50
Docker Commands

Docker Base-Commands

docker ps  # current containers  
docker run  # create and start the container  
docker create  # create container  
docker exec  # to run commands in container for once  
docker volume  # create a docker volume  
docker network  # create a docker network  
docker rm # remove container 
@dazeb
dazeb / WSL2-Error-0x8007019e.md
Last active January 24, 2024 08:07
WslRegisterDistribution failed with error: 0x8007019e Error: 0x8007019e The Windows Subsystem for Linux has not been enabled.

WslRegisterDistribution failed with error: 0x8007019e Error: 0x8007019e The Windows Subsystem for Linux has not been enabled.

The error WslRegisterDistribution failed with error: 0x8007019e indicates that the Windows Subsystem for Linux (WSL) feature is not enabled on your Windows machine. To resolve this issue, you will need to enable WSL through the Windows features settings or by using PowerShell commands.

Here are the steps to enable WSL:

  1. Enable WSL via Windows Features:
    • Open the "Turn Windows features on or off" dialog by searching for it in the Windows search box.
    • Scroll through the list and find the "Windows Subsystem for Linux" option.
  • Check the box next to "Windows Subsystem for Linux" and click "OK."
@dazeb
dazeb / telegram-retrieve-chat-group-group-topic-ids.md
Last active May 3, 2025 02:58
How to retrieve Telegram Chat ID's, Group ID's and Group Topic ID's.

How to Retrieve Your Telegram Bot's Chat ID

Setting Up Your Telegram Bot and Acquiring the Bot Token

  1. Launch the Telegram app and use the search function to locate @BotFather.
  2. Initiate interaction by selecting Start.
  3. Access the Menu and choose /newbot or simply type /newbot into the chat and press Send.
  4. Proceed with the provided instructions until you receive a message similar to the following:
@dazeb
dazeb / create-cloud-template.sh
Created January 21, 2024 08:59 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@dazeb
dazeb / Portainer_on_Alpine.md
Last active January 20, 2024 18:32
Portainer WebUI for Docker under Alpine Linux

Intro

Run Portainer WebUI for Docker on a docker host built using Alpine (3.8) Linux

Clarifications

About documentation

Despite documentation publicly available on Internet, Portainer is not specially well documented in regard to docker volumes and other similar stuff. Best approach is to handle ourselves the volumes mounted per container.

About (self-signed) certificates

You need to have certificates already created to pass to the docker command line / docker composer. Easier way to have that certificates is to use selfsigned certificates. Following line creates a 10-year valid self-signed certificates:

@dazeb
dazeb / freshtomato-themes.md
Created January 20, 2024 01:04
Add themes to FreshTomato using CIFS

Manual (no TTB) This method is the traditional one and assumes you have access to some sort of external storage e.g., CIFS or USB. In this example, we'll use CIFS and mytheme.zip:

  1. Download mytheme.zip into cifs1. To do so, refer to the standard URL https://freshtomato.org/tomatothemebase/wp-content/uploads/ + theme name + .zip

    cd /cifs1
    wget -O theme.zip https://freshtomato.org/tomatothemebase/wp-content/uploads/mytheme.zip

Yes, you can upload and test the script from VS Code on your Proxmox server using a few different methods. Here's a step-by-step guide on how to do it:

Method 1: Using SCP (Secure Copy Protocol)

  1. Open a terminal in VS Code: You can open an integrated terminal in VS Code by pressing Ctrl+` (backtick) or by selecting "Terminal" > "New Terminal" from the top menu.

  2. Use SCP to upload the script: In the terminal, use the scp command to securely copy the script to your Proxmox server. Replace <script-name>.sh with the name of your script file.

    scp <script-name>.sh root@192.168.0.10:/path/to/destination
@dazeb
dazeb / howto-tomato-install-entware.markdown
Created January 19, 2024 20:10 — forked from dferg/howto-tomato-install-entware.markdown
HOWTO: Install entware on Shibby TomatoUSB

Introduction

This howto describes installing entware for the Tomato open-source router firmware.

Requirements

  • USB stick - 1G or more in size
  • USB-capable router running TomatoUSB.

This Howto Was Tested With

@dazeb
dazeb / Convert_z7_cue_to_CHD.ps1
Created August 28, 2023 09:32 — forked from revoice1/Convert_7z_bin_cue_to_CHD.ps1
Convert_z7_cue_to_CHD.ps1
#Requires -Version 5.1
[cmdletbinding()]
param(
[string]$SourcePath = "", # Path to 7z zipped disc images to be converted
[string]$DestinationPath = "", # Path where you would like the CHD's to go. One folder per game.
[string]$WorkingPath = "", # Path where files will be extracting temporarily for CHD creation, use fast disk if possible. Will be created in the running path if undefined
[string]$CHDMANPath = "", # Path to the CHDMAN executable, will be downloaded if this isn't defined or isn't correct
[switch]$CleanWorkingPath = $false, # Switch to automatically clean (delete contents) the working path dir if it is non-empty
[switch]$DisableMultithreading = $false, # Option to disable multithreading logic, for low thread systems or if you don't want CHD conversion to take most of your CPU %
[switch]$WritePlaylistFiles = $false # Write m3u files in the destination dir, for all CHDs present (not just new ones)