Skip to content

Instantly share code, notes, and snippets.

View Utopiah's full-sized avatar

Fabien Benetou Utopiah

View GitHub Profile
#cloud-config
package_update: true
package_upgrade: true
ssh_keys:
rsa_private: |
-----BEGIN OPENSSH PRIVATE KEY-----
ABCD
-----END OPENSSH PRIVATE KEY-----
rsa_public: ssh-rsa ABCD fabien@cloud-init-hetzner-test
@Utopiah
Utopiah / syncNC.sh
Last active February 4, 2022 14:23
# script to (one-way) synchronize a NextCloud directory to a reMarkable device
# use it manually as ssh remarkable /home/root/bin/syncNC or via Cron or systemd
#
# configure https://nextcloud.domain.tld/remote.php/dav/files/username/ with your own NextCloud Dav URL
# add your username, password and path to /opt/etc/davfs2/secrets
# install mount.davfs via opkg install davfs2
# make the required directories e.g ~/nextcloudSync2 /media/nextcloudselfhosted/ on the reMarkable
# user reMarkable2_sync/ on your NextCould or change its location here
# do a symlink between ~/xochitl-data/ and ~/.local/share/remarkable/xochitl/
#pragma once
#undef RGBLIGHT_ANIMATIONS
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_CHRISTMAS
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_SNAKE
#!/usr/bin/env python3
# for https://twitter.com/utopiah/status/1449023602079240194
import http.server
import socketserver
import subprocess
PORT = 80
Handler = http.server.SimpleHTTPRequestHandler
/**
* Mostly from Human demo for NodeJS https://github.com/vladmandic/human/blob/main/demo/nodejs/node-webcam.js
package.json :
{
"dependencies": {
"@tensorflow/tfjs-node": "^3.8.0",
"@vladmandic/human": "^2.1.4",
"@vladmandic/pilogger": "^0.2.18",
"kodi-controller": "^1.2.0",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>$WikiTitle | {$Group} / {$Title} $ActionTitle</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<meta name="monetization" content="$ilp.gatehub.net/360717042">
const fs = require('fs');
const http = require('http');
const https = require('https');
const express = require('express');
const { ExpressPeerServer } = require('peer')
const app = express()
const domain = 'hack-webar.net' // replace here with your own domain
const privateKey = fs.readFileSync(`/etc/letsencrypt/live/${domain}/privkey.pem`, 'utf8')
# video https://video.benetou.fr/videos/watch/ae732458-dfab-40f0-abe5-930f9c06411c
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo postgres
/usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l logfile start
createuser hubs -s
psql -c "ALTER USER hubs WITH PASSWORD 'hubs';"
@Utopiah
Utopiah / background.js
Created March 13, 2021 20:20
WebExtension main JS to add current URL to PIM (PmWiki POST API)
// Based on https://github.com/mdn/webextensions-examples/tree/master/bookmark-it
/*
* Add the bookmark on the current page.
*/
function addToBucket() {
fetch('https://fabien.benetou.fr/PIMVRdata/URLBucketTest?action=source')
.then( response => { return response.text() } )
.then( data => {
var writeURL = 'https://fabien.benetou.fr/PIMVRdata/URLBucketTest?action=edit';
@Utopiah
Utopiah / whiteboard.html
Last active January 14, 2022 04:12
code for Whiteboard
<!DOCTYPE html>
<html lang="en"><!-- as PmWiki tmpl file -->
<head>
<meta charset="utf-8">
<title>$WikiTitle | {$Group} / {$Title} $ActionTitle</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<meta name="monetization" content="$ilp.gatehub.net/360717042">