Skip to content

Instantly share code, notes, and snippets.

@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@vo
vo / override_rc.py
Created March 5, 2014 07:03
Quick hack to override RC over MAVLink with arrow keys
#!/usr/bin/env python
import sys, os
from optparse import OptionParser
import Tkinter as tk
# tell python where to find mavlink so we can import it
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../mavlink'))
from pymavlink import mavutil
(define root 52)
(define scale (pc:scale 4 'aeolian))
(define right-hand
(lambda (beat dur)
(play sampler
(pc:quantize (cosr (+ root 24) (cosr 5 3 1/2) 7/3) scale)
(cosr 80 20 7/3)
(* 2.0 dur))
(if (> (random) .6)
@myjr52
myjr52 / ode_test.py
Last active October 19, 2018 05:58
integrate ode in python
# import functions
from numpy import linspace
from scipy.integrate import odeint
#import pylab as pyl
import matplotlib.pyplot as plt
# define constants
init_cond = [0.3, -0.1]
t_init = 0.0
@exupero
exupero / README.md
Last active February 29, 2016 12:57
instruct

instruct

A shell script to give step-by-step instructions. Pipe text into it. It'll be processed as follows:

  • Each line is echoed back to you one at a time.
  • Hit the Enter key to see the next instruction.
  • Lines surrounded by triple backticks are copied to the system clipboard, and the next line of text has the icon next to it.
  • Blank lines are ignored.
  • To insert a blank line, use a triple dash (---).
import os
import re
import shutil
import glob
## List of the STM32 chips supported by OpenCM3
chips = ["f0", "f1", "f3", "f4", "f2", "l0", "l1"]
## Representative projects for each chip
## These really only vary in their linker files and peripherals
## Look at the examples (below) for specifics
@TomWhitwell
TomWhitwell / clouds.cc
Created May 30, 2016 16:57
Clouds firmware - simple 1 second audio delay
// Copyright 2014 Olivier Gillet.
//
// Author: Olivier Gillet ([email protected])
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@fitz123
fitz123 / job_gen.sh
Last active May 24, 2019 19:27
Supervisor ffmpeg transcoding job and HLS playlist generator
#!/bin/bash
###############################################################################
#
# Description:
# Script generates Nimble session-friendly playlists
# (parent playlist with sub-playlists inside) and supervisor program/job
# of ffmpeg process which pulls from provided source address $ch_source and
# pushes to localhost nibmle-origin server as a name $ch_res for later HLS transmuxing
#
@vo
vo / quad_video_wall.sh
Last active July 5, 2020 09:37
basic gstreamer quad video wall.
#!/bin/bash
# Basic gstreamer quad video wall application.
# Displays 4 videos.
# They have to be synced to eachother and playing for this to work.
PARAMS_NEEDED=4
if [ $# -ne $PARAMS_NEEDED ]
then
@JamesHagerman
JamesHagerman / DisassembleARMBinaryInR2.md
Last active March 30, 2023 06:43
Some quick notes on disassembling 16bit ARM (STM32F4) code using radare2

Disassembling 1bitsy examples using radare2

Note that because radare2 uses Capstone to disassemble ARM code, there are issues with the disassembly. arm-none-eabi-objdump -d compiledbinary.elf actually does a better job in some cases. For example, msr isn't decompiled correctly...

First, you have to either strip the default ELF binaries the default Makefiles build when you run make OR you need to just compile .bin files using something like:

make binaryname.bin