Skip to content

Instantly share code, notes, and snippets.

@Scot-Bernard
Scot-Bernard / ssh-pm-win.ps1
Last active April 29, 2025 16:20
Set ssh private key permissions on Windows
# To avoid permissions problems, run this on Windows PowerShell, Core edition doesn't have SetAccessControl implemented at base level.
# A variant for it is welcome.
# Allow the powershell session to run this script with:
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
function Set-SshPermissions {
param (
$pkFile
)
@ConnerWill
ConnerWill / Convert-ImageToAsciiArt.ps1
Last active November 30, 2024 01:53
Convert-ImageToAsciiArt - PowerShell function to convert an image to ascii art
# NOTICE: This project has been moved to its own repository https://github.com/ConnerWill/Convert-ImageToASCIIArt
function Convert-ImageToAsciiArt {
<#
.SYNOPSIS
Function to convert an image to ascii art.
.DESCRIPTION
The function Convert-ImageToAsciiArt takes an image file path and converts the image to ASCII art.
The ASCII art is created by replacing each pixel in the image with an ASCII character based on the brightness of the pixel.
@ConnerWill
ConnerWill / bash_progress_bar.sh
Created September 3, 2022 02:29
Bash Progress Bar
#!/bin/env bash
### FUNCTION ###{{{
function bash_progress_bar(){
## Localize Variables ##{{{
local \
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active April 14, 2026 16:38
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@ConnerWill
ConnerWill / hardened-sshd_config
Last active January 3, 2026 13:33
hardened-sshd_config
##: ==============================================
##: [ SSHD_CONFIG ]
##: ==============================================
##: Title: hardened-sshd_config
##: Path: /etc/ssh/sshd_config
##: Author: github.com/ConnerWill
##: Date: 2022-07-16
##:
##: https://man.openbsd.org/sshd_config.5
##: https://linux.die.net/man/5/sshd_config
@dergeberl
dergeberl / README.md
Created September 8, 2021 19:46
Raspberry Pi cm4 dfrobot router board - openwrt 21.02 installation
@gbroques
gbroques / rgb.bash
Last active November 28, 2022 20:19
RGB Colors in Bash
#!/bin/bash
# https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
# Control Sequence Introducer
# https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_(Control_Sequence_Introducer)_sequences
function csi() {
ESC="\033"
parameters=$(echo $@ | sed -e 's/ /;/g')
echo "$ESC[${parameters}m"
}
@cstroe
cstroe / linux-mint-mate-20.2-install-docker.md
Last active March 8, 2026 23:51
Install Docker on Linux Mint 20.2 Mate Edition

Install Docker on Linux Mint 20.2 Mate Edition

Using the Graphical User Interface (GUI)

  1. Click the Linux Mint Menu Button at the bottom left of the screen to open the Linux Mint Menu.
  2. Under the "System" section, click "Software Manager".
  3. In the Software Manager window, use the search box at the top right and search for "docker".
  4. Click on "Docker.io - Linux Container Runtime".
  5. Click the green "Install" button at the top right. Enter your administrator password when prompted.
  6. Open the Linux Mint Menu again (see step 1), search for "Users and Groups", and click it to open the "User Settings".
@martin-niklasson
martin-niklasson / How-To.md
Last active April 3, 2026 19:25
How to make an up-to-date OpenWRT image for loading onto a Raspberry Pi Compute Module 4 with a DFRobot Router Carrier Board.

The background is that the default OpenWRT image for Raspberry Pi lacks drivers for the LAN port (RTL8111) on the DFRobot board. DFRobot provide an image, but that one is made from a quite old daily snapshot of OpenWRT which is not entirely stable. Also, it is better to know how to fish than be given a fish.

DFRobot's page about the router board:
https://wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR0767

OpenWRT main page:
https://openwrt.org/

You are expected to have some general knowledge on Linux and OpenWRT. The instructions for flashing the resulting firmware image are presented on DFRobot's page.

using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons