Skip to content

Instantly share code, notes, and snippets.

View kowalski7cc's full-sized avatar
🐲
Rawr! I'm a dragon!

Kowalski Dragon kowalski7cc

🐲
Rawr! I'm a dragon!
View GitHub Profile
@kowalski7cc
kowalski7cc / index.js
Created March 9, 2024 15:03
Eight queens puzzle
export function checkBoard(board) {
const rowsValidity = board.map((row) =>
checkSingleQueen(row)
)
const firstRow = board[0];
const columns = getColumnsValidity(firstRow, board);
@kowalski7cc
kowalski7cc / gitbackup.py
Last active March 5, 2024 22:04
Gitbackup
#!/bin/env python3
from enum import Enum
import requests
import argparse
import re
from contextlib import closing
import secretstorage
import time
from typing import Any
@kowalski7cc
kowalski7cc / pretix.yaml
Created February 20, 2024 16:53
Pretix K3S deployment
apiVersion: v1
kind: Namespace
metadata:
name: pretix
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: postgresql
namespace: pretix
@kowalski7cc
kowalski7cc / mkcd.fish
Created January 24, 2024 21:43
Make CD
function mkcd -a dirname
if test -z $dirname
echo "Usage: mkcd dirname"
return 1
end
mkdir -p "$dirname"
cd "$dirname"
end
@kowalski7cc
kowalski7cc / python.json
Created January 22, 2024 10:32
Python Snippets
{
"if": {
"prefix": "if",
"body": ["if ${1:expression}:", "\t${0:pass}"],
"description": "Code snippet for an if statement"
},
"if/else": {
"prefix": "if/else",
"body": ["if ${1:condition}:", "\t${2:pass}", "else:", "\t${0:pass}"],
"description": "Code snippet for an if statement with else"
@kowalski7cc
kowalski7cc / demo_chromeos.txt
Last active February 11, 2023 15:23
Bad USB demo for chromeOS
REM This is BadUSB demo script for chromeOS
REM Open windows notepad
DELAY 1000
CTRL t
DELAY 500
STRING data:text/html, <html contenteditable><style>body{font-family:monospace;}
DELAY 500
ENTER
DELAY 750
@kowalski7cc
kowalski7cc / builder-badger2040.Dockerfile
Created January 18, 2023 22:51
Badger2040 build container
FROM ubuntu:20.04 as builder
RUN apt update &&\
DEBIAN_FRONTEND=noninteractive apt install -y ccache gcc-arm-none-eabi git python3 python3-pip build-essential cmake
RUN python3 -m pip install pillow
ENV MICROPYTHON_VERSION=9dfabcd6d3d080aced888e8474e921f11dc979bb
ENV BOARD_TYPE=PIMORONI_BADGER2040
ENV RELEASE_FILE=pimoroni-badger2040-micropython
# Check out MicroPython
RUN git clone https://github.com/micropython/micropython.git /micropython
# Fetch base MicroPython submodules
@kowalski7cc
kowalski7cc / jsonpath.py
Last active February 26, 2024 09:02
Check one or more cluster operator condition status with Python
#!/usr/bin/env python3
import json
import os
from jsonpath_ng import JSONPath
from jsonpath_ng.ext import parse
CO_CMD = "oc get co -o json"
QUERY = "items[?(@.status.conditions[?(@.type=='Degraded' & @.status=='True')])]"
@kowalski7cc
kowalski7cc / README.md
Created February 5, 2019 15:40 — forked from BoGnY/README.md
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@kowalski7cc
kowalski7cc / paste.js
Created February 5, 2019 15:39
Don’t F*ck with Paste
var allowPaste = function(e){
e.stopImmediatePropagation();
return true;
};
document.addEventListener('paste', allowPaste, true);