Skip to content

Instantly share code, notes, and snippets.

@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
@tranthamp
tranthamp / gist:2727884
Created May 18, 2012 22:23
Set time with rdate
rdate -s time.nist.gov
@tranthamp
tranthamp / video conversion
Created June 29, 2012 20:49
Some video / image conversion commands
// List available formats for ffmpeg
ffmpeg -pix_fmts
// Convert a 720x480 nv12 (yuv 420 semi-planar) image to png
ffmpeg -s 720x480 -pix_fmt nv12 -i captdump-nv12.yuv -f image2 -pix_fmt rgb24 captdump.png
// Convert a 640x480 uyvy422 image to png
ffmpeg -s 640x480 -pix_fmt uyvy422 -i frame-000003.yuv -f image2 -pix_fmt rgb24 captdump.png
// Display a 640x480 grayscale raw rgb file
@tranthamp
tranthamp / gist:3034670
Created July 2, 2012 18:13
ssh-agent notes
// Kill the current ssh-agent
ssh-agent -k
kill <pid>
// Remove identities
ssh-add -D
// Add new id
ssh-add
<enter password>
@tranthamp
tranthamp / gist:3750462
Created September 19, 2012 15:57
Beaglebone 200KHz on timer 4 (u-boot)
// Timer 4, 200KHz from the 24MHz clock
// Setup Pin mux
mw.l 0x44e10890 0x2
// Enable functional clock
mw.l 0x44E00088 0x2
// Write TCRR
mw.l 0x4804403C 0xFFFFFF88
@tranthamp
tranthamp / gist:3953665
Created October 25, 2012 16:02
yavta notes
// I'm using a virtual video capture device via the vivi kernel module
# modprobe vivi
// This creates /dev/video0 if no other devices have yet been enumerated.
// Display available formats for the video device
# yavta --enum-formats /dev/video0
Device /dev/video0 opened.
Device `vivi' on `vivi-000' is a video capture device.
- Available formats:
@tranthamp
tranthamp / gist:4127722
Last active October 13, 2015 02:48
screen notes
# Start a new named session
screen -S <name>
# Attach to a running named session
screen -x <name>
# Create a new window
ctrl-a c
# Name a window
@tranthamp
tranthamp / gist:5052573
Last active December 14, 2015 07:39
Create SD card image
// Create image from first 1.0 GB of data on the sd card
sudo dd if=/dev/sdd of=./my.img bs=1024 count=1048576
// Compress the image
zip my-image.zip my.img
// Use win32diskimager from this location to write to a new sd card under windows
http://sourceforge.net/projects/win32diskimager/files/latest/download?source=navbar
@tranthamp
tranthamp / gist:5444378
Created April 23, 2013 15:09
Handy git-fu
# Create a patchset for a specific file or files, assuming the file doesn't exist in your local repo
git format-patch --output-directory myPatch commit-id-begin..commit-id-end -- file1 file2 file3
@tranthamp
tranthamp / gist:5705850
Created June 4, 2013 13:20
some of my bash aliases
alias mkconfig='/usr/bin/make menuconfig'
alias vk='vim -c "set ts=8 sw=8 tw=80 noet"'