Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Tasssadar
Tasssadar / Arduino-like.cpp
Last active May 16, 2020 10:54
Jak programovat roboty?
#include <Arduino.h>
#include "roboruka.h"
void setup()
{
Robot.begin();
printf("Robot nastartovan!\n");
}
#include <Arduino.h>
#include <FreeRTOS.h>
#include <sstream>
#include <mutex>
//static std::mutex m;
template <typename T>
void testPrintf(void *fmt)
{
#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 March 20, 2020 21:45
Generate OTP QR codes from Google Authenticator SQLite database
#!/usr/bin/env python3
# pip3 install --user qrcode[pil]
import qrcode
import argparse
import sqlite3
import os
from urllib.parse import quote
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 February 26, 2020 15:59
AMD64 linux only
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
"unsafe"
)
@Tasssadar
Tasssadar / gen_uri_linux.patch
Last active December 18, 2020 15:31
Patch JEB 3.8+ GenRegisterJebUriScheme.py to generate registrator also on Linux
--- 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:
[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
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;
+
  • &subset=latin-ext - fonty
  • link na "další" v krocích, jak postupovat
  • smoothscroll pryc