Skip to content

Instantly share code, notes, and snippets.

View cameronelliott's full-sized avatar

Cameron Elliott cameronelliott

View GitHub Profile
@helgoboss
helgoboss / backtrace_util.rs
Created June 29, 2020 14:42
Resolve Rust symbols from address-only backtrace
use backtrace::Symbol;
use regex::Regex;
/// A (far from perfect) attempt to resolve symbols for an address-only backtrace (e.g. reported by a user which runs your
/// binary without access to debug info).
///
/// Takes a backtrace produced by backtrace-rs which doesn't contain symbols but addresses in hexadecimal form.
/// Tries to resolve all addresses to symbols and prints the result. This only works if this code runs in exactly the same
/// build like the one which produced the original (symbol-less) backtrace AND the symbols are available.
pub fn resolve_symbols_from_address_only_backtrace(text: &str) -> Result<(), &'static str> {
@leewardbound
leewardbound / README.md
Last active August 31, 2021 18:48
rtmp to ion room

Instructions

go run cmd/signal/allrpc/main.go -jaddr :7000 -gaddr :50051 -- in the ion-sfu project, to start the allrpc interface

go run main.go -- start RTMP server

gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! x264enc speed-preset=ultrafast tune=zerolatency key-int-max=20 ! flvmux name=flvmux ! rtmpsink location=rtmp://localhost:1935/publish/foobar audiotestsrc ! alawenc ! flvmux. -- test RTMP feed

@jarbro
jarbro / symantec-vip-access-totp.md
Last active July 1, 2024 17:02
Generate Symantec VIP Access Token as TOTP

Generate Symantec VIP Access Token as OTP

Recently I came across a web service that required two-factor authentication using the Symantec VIP Access App. I already manage all of my OTP tokens in a different app (If you are on iOS I highly recommend using OTP Auth by Roland Moers.) and did not want to have to use yet another app to generate the TOTP.

There is a way to generate a Symantec VIP Access compatible token very easily if you have access to an environment which can run Python PIP. I happen to have Ubuntu Windows Subsystem Linux running on my machine. (If you are running Windows 10 and don't have this you should really check it out.) Let's get started...

hello

Instructions

Here we install python3-pip and qrencode so we can generate our secret, I

--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.6
-- Dumped by pg_dump version 10.4 (Debian 10.4-2.pgdg90+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
@briandominick
briandominick / doc-ops-consulting-agreement.adoc
Last active July 19, 2022 17:29
Sample DocOps Consulting Agreement (Prime Source)

Documentation Engineering Consulting Agreement

@ef2k
ef2k / chroma_renderer.go
Last active July 10, 2020 00:10
Chroma renderer for Blackfriday
package build
import (
"io"
"github.com/alecthomas/chroma"
"github.com/alecthomas/chroma/formatters/html"
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
"github.com/russross/blackfriday"
@subuk
subuk / tilda_export.go
Created January 17, 2018 13:52
Tilda export
package main
import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@rkuzsma
rkuzsma / get-k8s-node-ip-addresses.sh
Created January 5, 2017 03:33
Get external IP address of Kubernetes nodes
#!/bin/bash
kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[*].status.addresses[?\(@.type==\"ExternalIP\"\)].address}
@tomysmile
tomysmile / mac-setup-redis.md
Last active June 27, 2024 00:23
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@adamhotep
adamhotep / longopts2getopts.sh
Last active November 29, 2023 23:22
POSIX shell: support long options by converting them to short options
# a refinement of https://stackoverflow.com/a/5255468/519360
# see also my non-translating version at https://stackoverflow.com/a/28466267/519360
# translate long options to short
reset=true stopped=""
for opt in "$@"; do
if [ -n "$reset" ]; then
unset reset
set -- # reset the "$@" array so we can rebuild it
fi