Skip to content

Instantly share code, notes, and snippets.

@XAKEPEHOK
XAKEPEHOK / clone.sh
Created February 6, 2024 22:00
Managing multiple GitHub Deploy Keys on a single server
#!/bin/bash
#SEE https://medium.com/@dustinfarris/managing-multiple-github-deploy-keys-on-a-single-server-f81f8f23e473
read -p 'Please input github repo (e.g. https://github.com/XAKEPEHOK/expression-executor): ' GITHUB_REPO
GITHUB_PATH=$(echo $GITHUB_REPO | awk -F'/' '{print $4"/"$5}')
PUBKEY=$(echo $GITHUB_PATH | sed 's/[^a-zA-Z0-9]/_/g')
HOST=$(hostname -f)
HOME=$(eval echo ~$USER)
@XAKEPEHOK
XAKEPEHOK / BedScale.ino
Created November 21, 2020 21:01
BedScale
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <HX711.h>
#include <EEPROM.h>
// Network SSID
const char* ssid = "";
const char* password = "";
//https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
@XAKEPEHOK
XAKEPEHOK / retract.php
Last active May 15, 2020 18:37
Gcode retract calibration
<?php
$file = fopen("file.gcode", "r");
$retracts = 0;
$lastExtrude = null;
$min = 4;
$max = 16;
@XAKEPEHOK
XAKEPEHOK / processor.php
Created October 9, 2017 00:40
Set password to private key in OpenVPN config
<?php
$files = scandir(__DIR__);
$files = array_filter($files, function($name) {
return substr($name, -5) == '.ovpn';
});
foreach ($files as $filename) {
$file = file(__DIR__ . '/' . $filename);
$before = '';
$privateKey = '';
$after = '';