Skip to content

Instantly share code, notes, and snippets.

@jadell
jadell / socket_file.sh
Created March 15, 2011 21:22
Read and write to a socket using only Bash
#!/bin/bash
#
# Bash must have been compiled with this ability: --enable-net-redirections
# The device files below do not actually exist.
# Use /dev/udp for UDP sockets
exec 3<>/dev/tcp/host/port
# Write to the socket as with any file descriptor
echo "Write this to the socket" >&3
@pmknutsen
pmknutsen / gist:7521a29fe8125c24eb3e
Last active February 24, 2021 01:56
HOWTO Run Sia host on Ubuntu server
#HOWTO Run Sia host on Ubuntu server
#Updated: 13 august, 2016
#Tested with Sia 1.0.2 and Ubuntu 16.04
#Update 13.08.2016: Changed from using supervisor to systemd
# Create user `siad`
adduser siad
su siad
@schwark
schwark / dash-listen-3.py
Last active January 27, 2017 05:33 — forked from ibrahima/dash-listen-3.py
Amazon Dash Button ARP listener script (not written by me)
#!/usr/bin/python
# Adapted from original written by Bob Steinbeiser (https://medium.com/@xtalker)
import socket
import struct
import binascii
def tide_button(arp_detailed):
dest_ip = socket.inet_ntoa(arp_detailed[8])
print 'Tide button pressed, IP = ' + dest_ip
@mr-pj
mr-pj / dashbutton.py
Last active January 3, 2018 12:34
if dhcp request matches a given mac, an action will be taken. Requires pydhcplib
from pydhcplib.dhcp_network import *
def do_something():
print("button has been pressed")
netopt = {'client_listen_port':"68", 'server_listen_port':"67", 'listen_address':"0.0.0.0"}
class Server(DhcpServer):
def __init__(self, options, dashbuttons):
@nickkraakman
nickkraakman / ffmpeg-cheatsheet.md
Last active November 14, 2024 03:32
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@analogrelay
analogrelay / CommandLineException.cs
Last active March 22, 2024 11:50
My Command Line Template
using System;
using System.Runtime.Serialization;
namespace MyTool
{
[Serializable]
internal class CommandLineException : Exception
{
public CommandLineException()
{
@charlesrg
charlesrg / gist:425ec526a05566cceadcebe78860611d
Created July 13, 2021 17:15
ESP32 Touch Capacitive with WIFI OTA and sending readings over UDP
#include <WiFi.h>
#include <ESPmDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
const char* ssid = "WIFI_SSID";
const char* password = "WIFI_PASSWORD";
const char * udpAddress = "192.168.10.6"; //IP TO SEND UDP Packets with Reading. (UDP so there is no need of a connection state)
@tothi
tothi / openssl-legacy-md4.md
Last active September 4, 2023 12:51
/etc/ssl/openssl.cnf supporting legacy digests like MD4 (useful for offensive tools requiring NTLM support)

This is a minimal /etc/ssl/openssl.cnf supporting legacy algorithms on modern openssl installations where it is disabled by default.

The marked (######) lines should be added to your openssl.cnf (other parts may be unchanged).

For checking if legacy providers are enabled successfully:

$ openssl list -providers
Providers: