Skip to content

Instantly share code, notes, and snippets.

View ultim8k's full-sized avatar
🛠️
Rock & roll!

Kostas Kapenekakis ultim8k

🛠️
Rock & roll!
View GitHub Profile
@jlpouffier
jlpouffier / available_updates.yaml
Created August 18, 2023 07:26
Home Assistant Hot Tip of the Day: Available Updates
template:
- sensor:
- name: pending_updates
unique_id: pending_updates
state: |
{{
expand(states.update)
| selectattr('state', 'eq', 'on')
| list
| count
type: horizontal-stack
cards:
- type: tile
entity: sensor.living_room_temperature
name: Home
vertical: true
color: primary
icon: mdi:home
tap_action:
action: navigate
import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
export const rule = ESLintUtils.RuleCreator.withoutDocs({
meta: {
docs: {
description: 'ban date comparison using ==, ===, !=, !==',
recommended: 'warn',
},
@reanim8ed
reanim8ed / sample.md
Last active March 10, 2026 17:29
[Yubikey setup for SSH] #linux #server #yubikey

Using A Yubikey For SSH Authentication

Intro

Why do we need this?

Answer is simple – Security! Alternatives include storing private keys directly on a workstation – which makes them poorly protected in multitude of attacks. A better option is to use encrypted usb key but leaving inserted and unsealed usb key for a long time is insecure, while inserting it and removing it back and forth all the time is tedious.

YubiKey suits much better for this purpose by making your SSH keys much more secure while maintaining a great user experience.

What is Yubikey

YubiKey is a hardware security key which provides Universal 2nd Factor (U2F) cryptographic tokens through a USB and/or NFC interface. This means you have to explicitly authorize a new SSH session by tapping the YubiKey. The private SSH key should be useless to a malicious user who does not have access to the physical YubiKey on which the second private key is stored.

@ryancharris
ryancharris / Base64.sol
Created January 23, 2022 00:22
Solidity Base64 utilities
pragma solidity >=0.8.0 <0.9.0;
// SPDX-License-Identifier: MIT
/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <brecht@loopring.org>
library Base64 {
bytes internal constant TABLE =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@m-radzikowski
m-radzikowski / script-template.sh
Last active February 27, 2026 03:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
function CopyButton({ value }) {
let [copied, setCopied] = React.useState();
let hydrated = usePageIsHydrated();
React.useEffect(() => {
let id = setTimeout(() => setCopied(false), 2000);
return () => clearTimeout(id);
}, [copied]);
return (
<button
@stubar
stubar / preq.js
Created October 1, 2019 10:50
Pull Request Generator
#! /usr/bin/env node
const execSync = require('child_process').execSync;
const changeCase = require('change-case');
/*
Automates creation of Eurostar PRs.
You need to install https://hub.github.com/ for this to work.
Auto adds jira link if one is found in branch name.
PR name is sourced from branch name.
Opens PR in browser for further editing of title / description

Create a TPM-protected SSH key

Windows

Ensure TPM is available

tpm.msc

Create a private key in the TPM

@rosell-dk
rosell-dk / eu_cookie_banner.js
Last active August 1, 2024 09:41 — forked from bavington/eu_cookie_banner.js
Simple EU Cookie Law Banner JavaScript