Skip to content

Instantly share code, notes, and snippets.

@Tasssadar
Tasssadar / Arduino-like.cpp
Last active May 16, 2020
Jak programovat roboty?
View Arduino-like.cpp
#include <Arduino.h>
#include "roboruka.h"
void setup()
{
Robot.begin();
printf("Robot nastartovan!\n");
}
View printf.cpp
#include <Arduino.h>
#include <FreeRTOS.h>
#include <sstream>
#include <mutex>
//static std::mutex m;
template <typename T>
void testPrintf(void *fmt)
{
View stringstream_crash.cpp
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <sstream>
static void task(void *)
{
std::stringstream ss;
while (1)
sleep(1);
@Tasssadar
Tasssadar / authenticator_gen_qr.py
Created Mar 20, 2020
Generate OTP QR codes from Google Authenticator SQLite database
View authenticator_gen_qr.py
#!/usr/bin/env python3
# pip3 install --user qrcode[pil]
import qrcode
import argparse
import sqlite3
import os
from urllib.parse import quote
View ui.cpp
void setup() {
// Na začátku je UI v "builder" módu
UI.button(0, 0, 4, 1, "test")
.color("red")
.background("blue")
.onPress([]() {
printf("pressed!\n");
})
.onRelease([]() {
printf("released!\n");
@Tasssadar
Tasssadar / gouname.go
Created Feb 26, 2020
AMD64 linux only
View gouname.go
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
"unsafe"
)
@Tasssadar
Tasssadar / gen_uri_linux.patch
Last active Dec 18, 2020
Patch JEB 3.8+ GenRegisterJebUriScheme.py to generate registrator also on Linux
View gen_uri_linux.patch
--- GenRegisterJebUriScheme.py.orig 2020-01-08 09:41:43.260903761 +0100
+++ GenRegisterJebUriScheme.py 2020-01-08 14:15:01.278159846 +0100
@@ -1,7 +1,7 @@
'''
Generate a platform-dependant script used to register the custom URI handler 'jeb:',
which can be used to execute JEB from other applications.
-TODO: only Windows is implemented; add Linux and macOS
+TODO: only Windows and Linux is implemented; add macOS
How to use:
View autossh.service
[Unit]
Description=Octoprint tunel to tasemnice
After=network.target
[Service]
User=autossh
Type=forking
Environment=AUTOSSH_LOGFILE=/home/autossh/autossh.log AUTOSSH_PIDFILE=/home/autossh/autossh.pid
PIDFile=/home/autossh/autossh.pid
ExecStart=/usr/bin/autossh -f -M 10984 -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -R 6661:localhost:80 -N printers@tasemnice.eu
View btrfs-delete-missing-workaround-4.7.4.diff
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 864cf3b..bd10a1d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3588,6 +3588,8 @@ int btrfs_calc_num_tolerated_disk_barrier_failures(
int num_tolerated_disk_barrier_failures =
(int)fs_info->fs_devices->num_devices;
+ return num_tolerated_disk_barrier_failures;
+
View gist:5a880428189e4aa8f9cf
  • &subset=latin-ext - fonty
  • link na "další" v krocích, jak postupovat
  • smoothscroll pryc