Skip to content

Instantly share code, notes, and snippets.

View c2h2's full-sized avatar

Yiling Cao c2h2

View GitHub Profile
@c2h2
c2h2 / am335x_gpio.sh
Last active August 29, 2015 13:57
am335x gpio3_21 test
#!/bin/bash
STIME=100000
ONVAL=0
OFFVAL=1
PINMUX_STATE=7
function set_gpio(){
echo $PINMUX_STATE > /sys/kernel/debug/omap_mux/${1}
echo ${1} > /sys/class/gpio/export
@c2h2
c2h2 / build_imx6_ubuntu.sh
Last active August 29, 2015 13:57
custom script to build uboot, kernel and dl fs for imx6q sabresd
WORKDIR=imx6work
export CROSS_COMPILE=arm-linux-gnueabihf-
rm -rf $WORKDIR
mkdir -p $WORKDIR
cd $WORKDIR
DIR=`pwd`
#pre-install
#sudo apt-get update
@c2h2
c2h2 / imx6qdl-sabresd.dtsi
Last active August 29, 2015 14:01
dtsi for aria
/*
* Copyright 2012 Freescale Semiconductor, Inc.
* Copyright 2011 Linaro Ltd.
*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
@c2h2
c2h2 / band_stress.rb
Created June 5, 2014 18:13
bandwidth stress
$SITE="http://www.test.com/"
$THREAD=100
def dl
`wget -U 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64)' -qO /dev/null #{$SITE}`
end
def loop_dl id="0"
i = 0
loop do
@c2h2
c2h2 / bgcolor.html
Created June 16, 2014 15:30
changing color bg
<!-- This Script is from www.htmlfreecodes.com, Provided by: Mahmood Bina -->
<script>
// Select fade-effect below:
// Set 1 if the background may fade from dark to medium
// Set 2 if the background may fade from light to medium
// Set 3 if the background may fade from very dark to very light light
// Set 4 if the background may fade from light to very light
// Set 5 if the background may fade from dark to very dark
Can't find user c2h2
root@ntdeck400:~# bonnie++ -d /mnt/ -u ntdeck
Using uid:1000, gid:1000.
Can't open file ./Bonnie.15856
root@ntdeck400:~# chown ntdeck /mnt
root@ntdeck400:~# bonnie++ -d /mnt/ -u ntdeck
Using uid:1000, gid:1000.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
@c2h2
c2h2 / gist:f57888b6fee2d5a2a638
Last active August 29, 2015 14:04
am335x input gpio
mount -t debugfs none /sys/kernel/debug
echo 7 > /sys/kernel/debug/omap_mux/gpmc_csn3
echo 64 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio64/direction
echo 0 > /sys/class/gpio/gpio64/value
amixer set PCM 105
amixer set 'Right Line Mixer DACL1' 128
@c2h2
c2h2 / montecarlo.rb
Created August 1, 2014 08:29
monte carlo simulation for a gambler's betting outcome with BIG/SMALL betting strategy.
#run with ruby.
RUN_TIMES=10000
START_MONEY=500000
SMALL_BET=10000
BIG_BET=30000
BET_TIMES=500
DOUBLED_RATIO=1.5
CHANCE=0.993
@c2h2
c2h2 / config
Last active August 29, 2015 14:10
asdf asdf
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2014.11 Configuration
#
BR2_HAVE_DOT_CONFIG=y
#
# Target options
#
# BR2_arcle is not set
@c2h2
c2h2 / j1900_bench.txt
Created January 22, 2015 11:11
j1900_bench.txt
# # # # # # # ##### ###### # # #### # #
# # ## # # # # # # # ## # # # # #
# # # # # # ## ##### ##### # # # # ######
# # # # # # ## # # # # # # # # #
# # # ## # # # # # # # ## # # # #
#### # # # # # ##### ###### # # #### # #
Version 5.1.3 Based on the Byte Magazine Unix Benchmark