This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var tunnel = null; | |
var target = null; | |
// tunnel server | |
var serverInfo = {port:8811, host:"public.server.com"}; | |
// target device we want to access on network where this script is running | |
var targetInfo = {port:1001, host:"ip.local.network"}; | |
function listen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cc1101.h" | |
class C1101Receiver : public CC1101 | |
{ | |
enum | |
{ | |
SS = 10, | |
MOSI = 11, | |
MISO = 12, | |
SCK = 13, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cool led flexible led panel | |
Product: 16x64 16x96 LED Matrix Panel Car Sign Scrolling Display BLE APP Control 5V 2A | |
Main MCU: artery at32f421 | |
1x mw245b - https://cdn.datasheetspdf.com/pdf-down/M/W/2/MW245-Sunmoon.pdf - octal buffer (74HCT245D) | |
9x sm16206s - https://datasheet.lcsc.com/lcsc/2003131816_Shenzhen-Sunmoon-Micro-SM16206S_C121618.pdf - column controller 3x3x16 | |
2x sm5166pf - https://www.waveshare.com/w/upload/8/8b/Sm5166p.pdf - row controller 2x8 | |
Reverse powering: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ -z "${DOCKER}" ]]; then | |
cat > Dockerfile <<- EOM | |
FROM debian:trixie | |
WORKDIR /app | |
RUN apt update -y --fix-missing && apt upgrade -y | |
RUN apt install -y rsyslog build-essential libsystemd-dev systemd | |
COPY test.sh . | |
ENV DOCKER 1 | |
ENTRYPOINT ["bash", "test.sh"] | |
EOM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@5.3.0/css/xterm.css"/> | |
<script src="https://cdn.jsdelivr.net/npm/xterm@5.3.0/lib/xterm.js"></script> | |
<div id="terminal"> | |
<script> | |
var terminal = new window.Terminal({cursorBlink: true}); | |
terminal.open(document.querySelector('#terminal')); | |
terminal.onData(e => socket.send(e)); | |
var socket = new WebSocket(document.location.href.split("http").join("ws") + "terminal"); | |
socket.onmessage = msg => terminal.write(msg.data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# During data processing you will face a situation when you will | |
# need to filter out some data based on string comparison (e.g. process | |
# only file names which pass some condition). Things get more complicated | |
# if the condition is meant to be provided by user or as a CLI argument. | |
# | |
# Some of the popular methods are following: | |
# - wildcard matching (e.g. "*.jpg" which will return only jpeg files) | |
# - regex (e.g. ".*\.jpg") | |
# - code (e.g. filename.substr(-4) == ".jpg") | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#define DEBUGGING | |
#include "WebSocketServer.h" | |
#include "crypto.h" | |
bool WebSocketServer::handshake(Client &client) { | |
socket_client = &client; | |
// If there is a connected client-> | |
if (socket_client->connected()) { | |
// Check request and look for websocket handshake | |
#ifdef DEBUGGING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
reverse engineering of ABcom Cryptobox 600HD mini dvbs box protocol | |
Firstly I examined android package (since it was easier to get it) "g-mscreen-2-3-11.apk". It | |
uses C++ library for implementing control protocol. Then I was trying to capture UPnP communication | |
from iphone connected to OSX running wireshark. But without luck. GMScreen allowed to connection | |
to box using ip address and port. This traffic was easier to caputre and analyse. Requests by | |
client application are human readable json/xml code. Some response packets are compressed using | |
zlib. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// nodejs script for downloading still images from hikvision nvr | |
// uses request-digest for basic http authenticatication | |
// | |
// Still images are available at this url: | |
// http://192.168.1.130/ISAPI/Streaming/channels/200/picture?videoResolutionWidth=1920&videoResolutionHeight=1080 | |
var digestRequest = require('request-digest')('user', 'password'); | |
var fs = require('fs'); | |
var cam = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ | |
"use strict"; | |
process.title = 'node-serial-ws'; | |
// Websocket | |
var webSocketsServerPort = 1337; | |
var webSocketServer = require('websocket').server; | |
var http = require('http'); | |
var server = http.createServer(function(request, response) { | |
// Not important for us. We're writing WebSocket server, not HTTP server |