Skip to content

Instantly share code, notes, and snippets.

@Nalorokk
Nalorokk / printer.cfg
Created January 16, 2021 03:18
Tronxy X5SA
# This is a Klipper configuration for TronXY X5SA, with
# CXY-V6 motherboard.
# === FLASHING WITH STOCK BOOTLOADER ===
# You should make firmware for STM32F103 with bootloader offset
# at 0x8008800 (Chitu v6 Bootloader). Uncheck USB, and leave default
# serial settings.
#
# Use "./scripts/update_chitu.py ./out/klipper.bin ./out/update.cbd" after make to generate update.cbd.
@Nalorokk
Nalorokk / printer.cfg
Created January 6, 2021 11:12
Tronxy X5SA V6 config
# This is a Klipper configuration for TronXY X5SA, with
# CXY-V6 motherboard.
# === FLASHING WITH STOCK BOOTLOADER ===
# You should make firmware for STM32F103 with bootloader offset
# at 0x8008800 (Chitu v6 Bootloader). Uncheck USB, and leave default
# serial settings.
#
# Use "./scripts/update_chitu.py ./out/klipper.bin ./out/update.cbd" after make to generate update.cbd.
+ verbose=on
+ shift
+ [[ -n '' ]]
+ [[ on != on ]]
+ get_simple -vv
+ [[ -n -vv ]]
++ type -t get_-vv
+ [[ '' == \f\u\n\c\t\i\o\n ]]
+ shift
+ [[ -n '' ]]
@Nalorokk
Nalorokk / keenetic.php
Created April 19, 2020 12:24
Keenetic metrics to InfluxDB
#!/bin/php
<?php
ini_set('default_socket_timeout', 15);
ini_set('display_errors', 1);
error_reporting(E_ALL);
define('LOGIN', 'admin');
define('PASSWORD', 'password');
define('INFLUXDB', 'homedb');
@Nalorokk
Nalorokk / keenetic.php
Created April 18, 2020 06:35
Keenetic RCI API PHP
#!/bin/php
<?php
ini_set('default_socket_timeout', 15);
ini_set('display_errors', 1);
error_reporting(E_ALL);
if(keen_auth('admin', 'password')) {
$metrics = keen_request('rci/', '{"show":{"interface":{"stat":[{"name":"GigabitEthernet1"},{"name":"Wireguard0"}]}}}');
$data = $metrics[2];
@Nalorokk
Nalorokk / config.js
Last active April 1, 2021 16:27
Homebridge config for Gyver Lamp firmware by gunner47
{
"accessories": [
{
"accessory": "mqttthing",
"type": "lightbulb",
"name": "Led Lamp",
"url": "mqtt://127.0.0.1",
"topics":
@Nalorokk
Nalorokk / bitbucket
Created November 13, 2018 15:04
Unlock bitbucket
#!/usr/bin/php
<?php
$list = json_decode(file_get_contents('https://ip-ranges.atlassian.com/'), true);
foreach ($list['items'] as $item) {
$cidr = $item['cidr'];
if (strpos($cidr, ':') === false) {
echo "Adding $cidr\n";