Skip to content

Instantly share code, notes, and snippets.

View ghostzero's full-sized avatar
🚀
Ship It!

René Preuß ghostzero

🚀
Ship It!
View GitHub Profile
<template>
<div id="app">
<h1>MD5 File Hash Calculator</h1>
<input type="file" @change="handleFileChange" />
<p v-if="finalHash">MD5 Hash: {{ finalHash }}</p>
</div>
</template>
<script setup lang="ts">
import { createMD5 } from 'hash-wasm'
import crypto from 'crypto'
import fs from 'fs'
const chunkSize = 16777216;
console.log(await calculateForFile('video.mp4', chunkSize));
function calculateForFile(filename, chunkSize) {
return new Promise((resolve, reject) => {
const stream = fs.createReadStream(filename, { highWaterMark: chunkSize });
calculate(stream, chunkSize)
@ghostzero
ghostzero / api.md
Created July 24, 2024 14:42
Wave Link API

Elgato Wave Link API

The Wave Link API is based on JSON-RPC 2.0 using WebSocket (ws://127.0.0.1:1824) as transport.

Requests

getAllChannelInfo

getApplicationInfo

getMicrophoneSettings

getMicrophoneState

kubernetes nodes automatically perform image garbage collection. You can find documentation on the default thresholds here:
https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbage-collection/#user-configuration
If for some reason you want to muck about with this manually, you can try:
sudo k3s crictl images to see what images have been pulled locally
sudo k3s crictl rmi --prune to delete any images no currently used by a running container
// Enables staying on fullscreen apps for macos https://github.com/electron/electron/pull/11599
win.setFullScreenable( false )
// VisibleOnFullscreen removed in https://github.com/electron/electron/pull/21706
win.setVisibleOnAllWorkspaces( true, { visibleOnFullScreen: true } )
// Values include normal, floating, torn-off-menu, modal-panel, main-menu, status, pop-up-menu, screen-saver
win.setAlwaysOnTop( true, 'screen-saver' )
@ghostzero
ghostzero / make-executable.md
Created June 25, 2022 21:44
Make File Executable on Windows

The following command adds user execute permission to an arbitrary file:

git update-index --chmod=+x <file>
@ghostzero
ghostzero / google-meet-user-switch.user.js
Created May 3, 2022 07:29
This makes sure that the gmail meet is always with a specific user.
// ==UserScript==
// @name Google Meet User Switch
// @namespace https://ghostzero.dev
// @version 0.1
// @description This makes sure that the gmail meet is always with a specific user.
// @match https://meet.google.com/*
// @match https://meet.google.com/*
// @copyright René Preuß <[email protected]>
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
@ghostzero
ghostzero / bpi_led.md
Created December 7, 2021 23:05
Disable Banana Pi M5 LED

This will disable the party 🥳🎉 when you will try to sleep 😴💤:

echo none > /sys/class/leds/blue/trigger

Tested on the Banana Pi M5 with Debian.

You're welcome!

@ghostzero
ghostzero / 10message_db.conf
Last active October 15, 2021 08:11
Postgress Configuration
message_store.sql_condition = true
cat <<EOF > /lib/systemd/system/[email protected]
[Unit]
Description=Fast and Secure Tunnelling Daemon (connection %I)
After=network.target
[Service]
Type=notify
ExecStart=/usr/local/bin/fastd --syslog-level info --syslog-ident fastd@%I -c /etc/fastd/%I/fastd.conf
ExecReload=/bin/kill -HUP $MAINPID