Skip to content

Instantly share code, notes, and snippets.

View klevcsoo's full-sized avatar
♥️

Keve Lajsz klevcsoo

♥️
View GitHub Profile
@klevcsoo
klevcsoo / pi_secure_setup.md
Last active July 3, 2024 11:41
Raspberry PI Secure SSH Setup with ZSH

Raspberry PI Secure SSH Setup with ZSH

In this guide, I'll walk you through setting up a secure SSH environment on a Raspberry Pi using ZSH. The goal is to enhance the security of your Raspberry Pi by configuring SSH, implementing two-factor authentication with Google Authenticator, changing the default SSH port, and setting up a firewall with UFW and Fail2Ban for added protection against brute-force attacks. Additionally, we'll customize your shell experience by installing and configuring ZSH along with Oh-My-ZSH.

Prerequisites

Raspberry PI Configuration Tool

sudo raspi-config
@klevcsoo
klevcsoo / sorting-algorithms.cpp
Last active June 23, 2022 14:28
A simple C++ sorting algorithm visualizer using SFML.
#include <iostream>
#include <list>
#include <utility>
#include <random>
#include <algorithm>
#include <iterator>
#include <vector>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
@klevcsoo
klevcsoo / pwsh-regedit-search-replace.ps1
Last active April 29, 2023 12:52
PowerShell registry search-replace script
Param(
[Parameter(Mandatory = $true, Position = 0)]
[string] $RegistryPath,
[Parameter(Mandatory = $true, Position = 1)]
[string] $SearchQuery,
[Parameter(Mandatory = $true, Position = 2)]
[string] $NewValue
)
$Registry = Get-ChildItem $RegistryPath -Recurse
@klevcsoo
klevcsoo / canvas-map.ts
Last active March 21, 2024 10:06
A simple map renderer in Typescript using the Canvas API. I found it in an old project of mine.
function attachMapRenderer(canvas: HTMLCanvasElement, mapUrl: string) {
const img = new Image(); img.src = mapUrl;
img.onload = () => {
const wCanvas = canvas.width, hCanvas = canvas.height;
const wImg = img.width, hImg = img.height;
const dragMarginX = wImg - wCanvas, dragMarginY = hImg - hCanvas;
const ctx = canvas.getContext('2d');
if (!ctx) throw new Error('Canvas API error');