Skip to content

Instantly share code, notes, and snippets.

View tosiara's full-sized avatar

tosiara

View GitHub Profile
@tosiara
tosiara / hashtopolis_fix.php
Last active June 15, 2021 15:00
Hashtopolis hack script to workaround DB resource limitation
<?php
/*
This script is a temporary hack to overcome Hashtopolis DB resource limitation.
Original thread: https://github.com/hashtopolis/server/issues/644
Script location: https://gist.github.com/tosiara/a0c4ebfb2e0707fc1920cf204f6cde0f
tl;dr: when a task has too many chunks in the table, apache will fetch them all
and process in a loop in order to calculate task progress - this will cause

On host:

sudo apt-get install libnss3-tools
hg clone https://hg.mozilla.org/mozilla-central
cd mozilla-central
nss-addbuiltin -n "SomeMaliciousCA" -t "CT,C,C" < ~/malicious.der >> security/nss/lib/ckfw/builtins/certdata.txt
sudo docker run -v "/mozilla-central:/mozilla-central" -ti ubuntu:focal /bin/bash

Inside docker:

[1:ml1:MyCam1] [NTC] [ALL] motion_init: Camera 101 started: motion detection Enabled
[1:ml1:MyCam1] [NTC] [VID] vid_start: Opening V4L2 device
[1:ml1:MyCam1] [NTC] [VID] v4l2_device_open: Using videodevice /dev/video0 and input -1
[1:ml1:MyCam1] [ALR] [VID] v4l2_device_open: Failed to open video device /dev/video0: No such file or directory
[1:ml1:MyCam1] [ERR] [VID] vid_start: V4L2 device failed to open
[1:ml1:MyCam1] [WRN] [ALL] motion_init: Could not fetch initial image from camera
[1:ml1:MyCam1] [WRN] [ALL] motion_init: Motion continues using width and height from config file(s)
[1:ml1:MyCam1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1:MyCam1] [NTC] [DBL] dbse_init: Database backend mysql
[1:ml1:MyCam1] [ERR] [DBL] dbse_init_mysql: Cannot connect to MySQL database motion on host localhost with user motion
@tosiara
tosiara / threads.c
Created October 27, 2019 18:17
threads.c
#include <pthread.h>
#include <stdlib.h>
void *payload()
{
while (1);
}
void main(int argc, char **argv)
{
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
[0:motion] [NTC] [STR] webu_start_strm: Starting all camera streams on port 8081
[0:motion] [NTC] [STR] webu_strm_ntc: Started camera 0 stream on port 8081
[0:motion] [NTC] [STR] webu_start_ctrl: Starting webcontrol on port 8080
[0:motion] [NTC] [STR] webu_start_ctrl: Started webcontrol on port 8080
[0:motion] [NTC] [ENC] ffmpeg_global_init: ffmpeg libavcodec version 56.60.100 libavformat version 56.40.101
[0:motion] [NTC] [ALL] translate_locale_chg: No native language support
[0:motion] [NTC] [ALL] motion_start_thread: Camera ID: 0 is from ../motion-rtsp.conf
[0:motion] [NTC] [ALL] motion_start_thread: Camera ID: 0 Camera Name: motion Service: rtsp:
[0:motion] [NTC] [ALL] main: Waiting for threads to finish, pid: 32636
[1:ml1:motion] [NTC] [ALL] motion_init: Camera 0 started: motion detection Enabled
@tosiara
tosiara / nodemcu_ds18b20_client.ino
Last active January 4, 2019 19:38
NodeMCU DS18B20 Client
#include <ESP8266WiFi.h>
#include <DallasTemperature.h>
#include <OneWire.h>
#define ONE_WIRE_BUS 5 // nodemcu D1
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
const char* ssid = "mynetwork";
@tosiara
tosiara / nodemcu_ds18b20_hotspot.ino
Last active January 4, 2019 19:38
NodeMCU DS18B20 Hotspot
#include <ESP8266WiFi.h>
#include <DallasTemperature.h>
#include <OneWire.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#define PIN 5 // nodemcu D1
OneWire oneWire(PIN);
DallasTemperature sensors(&oneWire);
@tosiara
tosiara / motion.log
Created November 24, 2018 10:02
motion.log
$ ./motion -c ../motion-passthrough.conf -d 8 -n
[0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file ../motion-passthrough.conf
[0:motion] [ALR] [ALL] conf_cmdparse: "process_id_file" replaced with "pid_file" after version 4.1.1
[0:motion] [ALR] [ALL] conf_cmdparse: "rtsp_uses_tcp" replaced with "netcam_use_tcp" after version 4.1.1
[0:motion] [ALR] [ALL] conf_cmdparse: "switchfilter" replaced with "roundrobin_switchfilter" after version 4.1.1
[0:motion] [ALR] [ALL] conf_cmdparse: "max_movie_time" replaced with "movie_max_time" after version 4.1.1
[0:motion] [ALR] [ALL] conf_cmdparse: "output_pictures" replaced with "picture_output" after version 4.1.1
[0:motion] [ALR] [ALL] conf_cmdparse: "output_debug_pictures" replaced with "picture_output_motion" after version 4.1.1
[0:motion] [ALR] [ALL] conf_cmdparse: "quality" replaced with "picture_quality" after version 4.1.1
[0:motion] [ALR] [ALL] conf_cmdparse: "ffmpeg_output_movies" replaced with "movie_output" after version 4.1.1
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
jtag_ntrst_assert_width: 200
jtag_ntrst_delay: 1
trst_only separate trst_push_pull
adapter speed: 6000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 6000 kHz
Info : JTAG tap: ath79.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Info : Listening on port 3333 for gdb connections