Skip to content

Instantly share code, notes, and snippets.

View gmag11's full-sized avatar

Germán Martín gmag11

View GitHub Profile
@hardillb
hardillb / show-creds.js
Created February 16, 2021 23:18
Quick script to decrypt Node-RED credentials files
const crypto = require('crypto');
var encryptionAlgorithm = "aes-256-ctr";
function decryptCreds(key, cipher) {
var flows = cipher["$"];
var initVector = Buffer.from(flows.substring(0, 32),'hex');
flows = flows.substring(32);
var decipher = crypto.createDecipheriv(encryptionAlgorithm, key, initVector);
var decrypted = decipher.update(flows, 'base64', 'utf8') + decipher.final('utf8');
@vogler
vogler / Artillery-Genius.md
Last active December 27, 2023 12:48
Artillery Genius Config

image

Software

  • Mainboard firmware: Marlin 2.0.9.2 (fork with config, see Marlin/Configuration{,_adv}.h)
    • diff: nvim -d {Marlin,config/Artillery/Genius}/Configuration.h, same for Configuration_adv.h
      • mostly calibration, new extruder and noise-free PWM for parts fan
      • LIN_ADVANCE instead of S_CURVE_ACCELERATION (don't work together)
    • before 13.11.2020: Marlin 2.0.5.3 (3dprintbeginner) (branch)
  • TFT firmware: artillery_tft_fw_1.27.x_patch_9.2 (digant@thingiverse) (TFT-config.ini)
    • Put in Marlin mode (long press, persists on reboot) when printing with OctoPrint because TFT shares serial connection.
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active April 22, 2024 16:17
Docker Container Logging using Promtail
@zennermac
zennermac / mysql-docker.sh
Created May 24, 2019 16:27 — forked from nshtg/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE > backup.sql
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | gzip > backup.sql.gz
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | bzip2 > backup.sql.bz2
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
gunzip < backup.sql.gz | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
bunzip2 < backup.sql.bz2 | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
@jcarolinares
jcarolinares / useful_commands_to_use_in_shell.md
Last active February 3, 2023 02:23
This is a simple guide for non-pro bash users to do random but annoying tasks in just seconds

Useful commands to use in Shell or others:

This is a simple guide for non-pro bash users to do random but annoying tasks in just seconds

Your boss will be happy and you'll be less stressed ;)

Files

Search a file name using a string:

@sticilface
sticilface / PROGMEM.md
Last active July 23, 2023 11:38
PROGMEM

Guide to PROGMEM on ESP8266 and Arduino IDE

Intro

On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string" and it will use up RAM.

The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply

#define PROGMEM   ICACHE_RODATA_ATTR
@ruario
ruario / intro-latest-widevine.md
Last active January 29, 2024 07:53
Fetches the latest Linux Widevine binary so that it can be used by Vivaldi.

With the release of Vivaldi 2.2, this page is now obsolete and unmaintained. Widevine is fetched automatically on post install of our official packages. The information below and the script are left for historical reasons but will not be updated.

If you are using something newer than Vivaldi 2.2, you should not be using this script as there is simply no need. Any need you think you have for it would be a bug IMHO and thus should be logged in a bug report. Before you do so however, you should also checkout the Vivaldi help page on Widevine, on Linux


Summary

A bunch of people asked how they could use this script with pure Chromium on Ubuntu. The following is a quick guide. Though I still suggest you at least try Vivaldi. Who knows, you might like it. Worried about proprietary componants? Remember that libwidevinecdm.so is a b

@copa2
copa2 / wpstest.ino
Created April 25, 2016 20:23
Example for WPS connection with https://github.com/esp8266/Arduino
#include <ESP8266WiFi.h>
void setup() {
Serial.begin(115200);
delay(1000);
Serial.printf("\nTry connecting to WiFi with SSID '%s'\n", WiFi.SSID().c_str());
WiFi.mode(WIFI_STA);
WiFi.begin(WiFi.SSID().c_str(),WiFi.psk().c_str()); // reading data from EPROM, last saved credentials
while (WiFi.status() == WL_DISCONNECTED) {
@n8henrie
n8henrie / crashplan_setup.sh
Last active March 15, 2024 21:36
Set up CrashPlan on Raspberry Pi (Raspbian Jessie)
#!/bin/bash
#############
# n8henrie's Raspberry Pi CrashPlan installer script
# v0.1.0 :: 20160530
#############
set -e
CP_VERSION="4.8.0"