Skip to content

Instantly share code, notes, and snippets.

View kylemanna's full-sized avatar

Kyle Manna kylemanna

View GitHub Profile
@gljeremy
gljeremy / disconnect.rb
Created September 21, 2011 14:03 — forked from tmcw/disconnect.rb
bulk-export run data from Garmin Connect
#!/usr/bin/env ruby
## disconnect
# ./disconnect.rb -u yourusername [-o /your/path] [-p yourhttpproxyserver]
#
# This is a command-line utility for the bulk-downloading of run data from
# the connect.garmin.com web application, which has lackluster export
# capabilities.
#
@alexzhan
alexzhan / pdfcrop.py
Created October 7, 2011 12:53 — forked from laogao/pdfcrop.py
Use pyPdf to crop a pdf file according to user inputs
#!/usr/bin/env python
import sys
if __name__ == '__main__' and len(sys.argv) > 5 and sys.argv[1][-3:].upper() == 'PDF':
original = sys.argv[1]
target = original[:-4] + '.cropped.pdf'
left = int(sys.argv[2])
top = int(sys.argv[3])
right = int(sys.argv[4])
@nmandery
nmandery / statemachine.c
Created February 1, 2012 14:55
State machines are very simple in C if you use function pointers.
/*
http://stackoverflow.com/questions/1371460/state-machines-tutorials/1371654#1371654
State machines are very simple in C if you use function pointers.
Basically you need 2 arrays - one for state function pointers and one for state
transition rules. Every state function returns the code, you lookup state
transition table by state and return code to find the next state and then
just execute it.
*/
@17twenty
17twenty / gist:2712354
Last active December 9, 2021 09:34
Getting Yocto working on the Beaglebone
# Setup for Fedora 17
sudo yum install python m4 make wget curl ftp hg tar bzip2 gzip unzip python-psyco perl texinfo texi2html diffstat openjade docbook-style-dsssl sed docbook-style-xsl docbook-dtds docbook-utils sed bc glibc-devel ccache pcre pcre-devel quilt groff linuxdoc-tools patch linuxdoc-tools cmake help2man perl-ExtUtils-MakeMaker tcl-devel gettext chrpath ncurses apr SDL-devel mesa-libGL-devel mesa-libGLU-devel gnome-doc-utils autoconf automake
sudo yum install tftp-server
sudo yum install nfs-utils
sudo yum install minicom
sudo systemctl enable nfs-server.service
sudo systemctl disable firewalld.service # This may/maynot be on your system but causes grief if it is!
# -------------------------------------------------------------------------------
@tranthamp
tranthamp / gist:2721326
Created May 17, 2012 20:15
D-Bus and Connman notes
# Connman Technology API examples: (Object Path: /net/connman/technology/<wifi/ethernet>, Interface: net.connman.Technology)
# GetProperties
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.GetProperties
# Scan
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.Scan
# Disable/Enable wifi
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:true
var src = [
{"created_at":"Sun Jun 10 05:56:54 +0000 2012","id":211698435269722112,"id_str":"211698435269722112","text":"Timothy Bradley wins by split decision to claim Manny Pacquiao\u2019s WBO welterweight title http:\/\/t.co\/4SvRaLmb","source":"web","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":759251,"id_str":"759251","name":"CNN","screen_name":"CNN","location":"","description":"Connecting you to breaking news, the biggest moments and interviews from CNN TV, and the stories and videos garnering attention on CNN.com and social media.","url":"http:\/\/www.cnn.com","protected":false,"followers_count":4797672,"friends_count":649,"listed_count":68036,"created_at":"Fri Feb 09 00:35:02 +0000 2007","favourites_count":2,"utc_offset":-18000,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":true,"statuses_count":25664,"lang":"en","contributors_enabled":true,
@kylemanna
kylemanna / 7z+tar.md
Last active February 18, 2023 19:18
Archive with tar + 7z + max compression

Overview

7-zip doesn't preserve the Linux/Unix owner/group of files and possibly other details. Use tar instead because it's designed to preserve these things, then just 7zip the tar archive.

Create the archive

tar cf - --exclude=\*.o -v directory | 7z a -si -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on directory.tar.7z
@simonjbeaumont
simonjbeaumont / tmup
Last active October 13, 2021 11:03
Update bash to latest tmux environment on reattaching.
#!/bin/bash
tmup ()
{
echo -n "Updating to latest tmux environment...";
export IFS=",";
for line in $(tmux showenv -t $(tmux display -p "#S") | tr "\n" ",");
do
if [[ $line == -* ]]; then
unset $(echo $line | cut -c2-);
@prof7bit
prof7bit / .gitignore
Last active March 17, 2022 09:13
The portfolio rebalancing bot will buy and sell to maintain a constant asset allocation ratio of exactly 50/50 = fiat/BTC
/.project
@yanofsky
yanofsky / LICENSE
Last active February 25, 2024 12:21
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit