Skip to content

Instantly share code, notes, and snippets.

@trdenton
trdenton / truncate_vcd.sh
Last active November 1, 2022 17:19
truncate a vcd to a percentage of its size
#!/usr/bin/env bash
# Troy Denton 2022
# arg 1 is VCD file
# arg 2 is output vcd file
# arg 3 is percent of file you wish to keep
# Usage: ./truncate_vcd.sh lab2.vcd /tmp/lab2_out.vcd 5
# this will write 5% of the vcd to /tmp/lab2_out.vcd
@trdenton
trdenton / rangetest.pl
Created April 15, 2020 15:38
test a range of numbers via local freeswitch install, for number porting confirmation
#!/usr/bin/perl
use strict;
use warnings;
use ESL::Dispatch;
# take in number range as individual args
# e.g.
# perl test_range.pl 2042223000-3999 will test a range of 1000 numbers
#
#!/bin/bash
# helper script that i use to peruse git changes from upstream
# note - git diff pager should always page even if its less than a screenful
# e.g. git config --global core.pager 'less c-+F'
GIT_OUTPUT=$(git pull)
COMMITRANGE=$(sed -ne 's/^Updating //p' <<<$GIT_OUTPUT)
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
#!/usr/bin/python
import time
import subprocess
import signal
import logging
from range_sensor import RangeSensor
from graceful_kill import GracefulKiller
@trdenton
trdenton / write_name.ino
Created September 12, 2016 05:31
re-writing an EEPROM to control the bluetooth name
#include <Wire.h>
#define disk1 0x50 //Address of 24LC256 eeprom chip
void setup(void)
{
Serial.begin(9600);
Wire.begin();
unsigned int address = 0x3571;
@trdenton
trdenton / find_keys.ino
Created September 12, 2016 05:30
looking through an eeprom for a known sequence, "AB"
#include <Wire.h>
#define disk1 0x50 //Address of 24LC256 eeprom chip
void setup(void)
{
Serial.begin(9600);
Wire.begin();
unsigned int address = 0x3571;
@trdenton
trdenton / memread.py
Created September 12, 2016 03:12
read a saleae file, analyze its memory activity, reconstruct a binary image
#!/usr/bin/python
import sys
from enum import Enum
f = open(sys.argv[1])
lines = f.readlines()
@trdenton
trdenton / gist:d60e27cd24c762acce53bec120386248
Created September 10, 2016 07:01
convert a list of decimal numbers into a binary file
#!/usr/bin/python
import sys
f = open(sys.argv[1])
lines = f.readlines()
@trdenton
trdenton / bluetooth.sh
Created January 18, 2016 17:34
script to stop bluetooth
#!/bin/bash
sudo /usr/sbin/service bluetooth stop