Skip to content

Instantly share code, notes, and snippets.

# Edit /etc/systemd/journal.conf and set the following options to prevent the creation of .journal files and to forward messages to syslog:
Storage=none
ForwardToSyslog=yes
# Check if syslog.service is a sym-link to /dev/null and remove it if so
$ ls -l /lib/systemd/system/syslog.service
$ rm /lib/systemd/system/syslog.service
# Unmask the syslog service so that it can be started
$ systemctl unmask syslog.service
# Select the i2c bus
i2c dev <bus>
i2c dev 0
# Probe the device
i2c probe <chip>
i2c probe 0x60
# Read from the device
i2c read <chip> <chip address> <length> <memory address>
# U-boot mtest usage
mtest <start> <end> <pattern> <iterations>
Ex:
mtest 0x82000000 0x83000000 0xaa55aa55 1
@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"'
@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: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: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: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: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: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>