Skip to content

Instantly share code, notes, and snippets.

View kapolos's full-sized avatar

John Kapolos kapolos

View GitHub Profile
@jaytaylor
jaytaylor / delete-from-v2-docker-registry.md
Last active May 22, 2024 03:13
One liner for deleting images from a v2 docker registry

One liner for deleting images from a v2 docker registry

Just plug in your own values for registry and repo/image name.

registry='localhost:5000'
name='my-image'
curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
    curl -sSL -I \
        -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
@krisnod
krisnod / gist:56ff894f400cce7c742fb11fb2fde9cf
Last active April 6, 2022 18:46
RancherOS on Hetzner using software RAID (RAID 1)
Install:
----------
* Activate Hetzner Rescue System (Debian)
* Connect to Hetzner Rescue System using SSH and live boot RancherOS
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/)
* apt-get update
* apt-get install kexec-tools aria2
@daliborgogic
daliborgogic / delay.js
Created December 16, 2016 15:26
Node.js Async/Await delay
'use strict'
const timeout = ms => new Promise(res => setTimeout(res, ms))
function convinceMe (convince) {
let unixTime = Math.round(+new Date() / 1000)
console.log(`Delay ${convince} at ${unixTime}`)
}
async function delay () {
[alias]
#? = diff
a = help
ai = init
aixas = revert
alaks = mv
apan = rebase
diks = show
fer = clone
graps = commit
@ryanmcgrath
ryanmcgrath / example.js
Last active January 23, 2021 09:42
A basic React Video tag. I wanted to use video.js inside something I was building, so this is more or less a 5-minute tag for handling it. ES6 syntax but you can extrapolate what you need. Handles dynamically loading video.js/css as necessary since I really loathe serving any swf/etc myself. Could be easily extended or made better, works for me …
import React from 'react';
import Video from './Video';
class MyGenericApp extends React.Component {
render() {
return <div>
<Video src="my_video_url" poster="my_poster_url" />
</div>;
}
}
@thwarted
thwarted / resize-java-iKVM-viewer
Last active September 15, 2022 08:59
resize-java-iKVM-viewer: find all supermicro Java iKVM Viewer windows and resize them to display all the content
#!/bin/bash
# find all supermicro Java iKVM Viewer windows and resize
# them to display all the content
#
# for reasons that are beyond sanity, this shitty closed source program
# sets the min and max window sizes to the same values, making it unresizable
# through dragging.
# this wouldn't be so bad if it actually resized the window to display all
# the content. it constantly resizes based on the resolution of the
# -*- coding: utf-8 -*-
import socket
import os
print("Connecting...")
if os.path.exists("/tmp/python_unix_sockets_example"):
client = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
client.connect("/tmp/python_unix_sockets_example")
print("Ready.")
print("Ctrl-C to quit.")
@esamson33
esamson33 / crypt.js
Created November 20, 2012 09:37
Node.js script to encrypt and decrypt an arbitrary string using 128-bit AES method in CFB mode
/*!
* Node.js script to encrypt and decrypt an arbitrary string using
* 128-bit AES method in CFB mode.
*
*/
// A 16-byte key is required for a 128-bit encryption
var crypto = require('crypto'),
key = new Buffer('sixteen byte key'),
iv = crypto.randomBytes(16),