Skip to content

Instantly share code, notes, and snippets.

View kylemanna's full-sized avatar

Kyle Manna kylemanna

View GitHub Profile
@kylemanna
kylemanna / gist:3132380
Created July 17, 2012 21:52
EMMC errors on TI8148
root@ti814x-evm:~# dd if=/dev/zero of=/dev/mmcblk1
mmcblk1 mmcblk1p1 mmcblk1p2 mmcblk1p3
root@ti814x-evm:~# dd if=/dev/zero of=/dev/mmcblk1
[ 143.740000] mmcblk1: error -110 sending status comand
[ 143.740000] mmcblk1: error -110 transferring data, sector 0, nr 128, card status 0x0
[ 143.750000] mmcblk1: error -110 sending stop command, response 0x0, card status 0x0
[ 143.760000] mmcblk1: error -110 requesting status
[ 143.760000] end_request: I/O error, dev mmcblk1, sector 0
[ 143.760000] Buffer I/O error on device mmcblk1, logical block 0
[ 143.760000] lost page write due to I/O error on mmcblk1
@kylemanna
kylemanna / gist:3137339
Created July 18, 2012 16:36
U-Boot: set SW_RES_PROG value on TPS659113:
TI8148 EVM# i2c md 2d 15 1
0015: 27 '
TI8148 EVM# i2c mw 2d 15 0
TI8148 EVM# i2c md 2d 15
0015: 00 .
TI8148 EVM# i2c mw 2d 15 ff
TI8148 EVM# i2c md 2d 15
0015: 3f ?
@kylemanna
kylemanna / 7z+tar.md
Last active September 5, 2024 10:15
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
@kylemanna
kylemanna / deploy.sh
Created August 16, 2012 20:04
Embedded Target Deployment Script
#!/bin/sh
#
# Goal of this script is to deploy a root filesystem to a target. It can be
# used for factory deployment or to reflash the system with the latest image
# and pull everything out of the tarball.
#
# A use case for factory deployment might include putting this script in a
# initramfs image that then auto invokes this script. Arguments are passed
# via the kernel command line. Example:
#
@kylemanna
kylemanna / tmux.conf
Created September 10, 2012 16:50
My tmux config
#
# References
#
# [1] https://mutelight.org/practical-tmux
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# Start numbering at 1
@kylemanna
kylemanna / extract.sh
Created November 9, 2012 19:26
Extract a tarball with parallel decompression and progress indicator
#!/bin/sh
#
# You'll need lbzip2 (for parallel bzip [de]compression) and bar
# sudo apt-get install lbzip2 bar
#
bar $1 | lbzip2 -ds | sudo tar xf - -C $2
@kylemanna
kylemanna / flash.c
Created November 9, 2012 19:48
Cypress PSoC USBFS flash utility
/**
* Loader for the Cypress USBFS boot loader that takes .dld files from the
* Cypress designer.
*
* Ben Goska - TekBots
* Oregon State University - 2008
*
* Kyle Manna - Fuel7, Inc. - 2012
*
* Heavily modified to work with a CY8C24894 using the "Bootloader_Host_PSoC1"
@kylemanna
kylemanna / serial-proxy.py
Created November 30, 2012 00:03
Serial Proxy Server
#!/usr/bin/env python
"""
This python script opens two serial ports, specified with arguments 1 and 2
on the command line. It forwards data between the two serial ports as if it's
just a wire.
Usage: ./serial-loopback.py /dev/ttyUSB0 /dev/ttyUSB1
"""
import sys
@kylemanna
kylemanna / lua-lpc-spam-test.lua
Created May 12, 2013 05:28
Test using LUA + LUA Process Call (lua-lpc) + spamassassin
#!/usr/bin/env lua
require("lpc")
--[[
local f = io.open("spam1.txt", "rb")
local content = f:read("*all")
f:close()
]]--
local content = io.stdin:read("*all")
@kylemanna
kylemanna / popen3-test.lua
Last active December 17, 2015 06:19
LUA popen3() implementation
#!/usr/bin/env lua
--
-- Name: Lua 5.2 + popen3() implementation
-- Author: Kyle Manna <kyle [at] kylemanna.com>
-- License: MIT License <http://opensource.org/licenses/MIT>
-- Copyright (c) 2013 Kyle Manna
--
-- Description:
-- Open pipes for stdin, stdout, and stderr to a forked process
-- to allow for IPC with the process. When the process terminates