Skip to content

Instantly share code, notes, and snippets.

View bkrepo's full-sized avatar

Brian Kim bkrepo

View GitHub Profile
@bkrepo
bkrepo / cpu_monitor.bash
Created August 9, 2017 07:35
CPU Frequency and Temperature monitor script
#!/bin/bash
while [ 1 ]
do
clear
for cpu in {0..7}
do
echo "CPU $cpu Freq: `cat /sys/devices/system/cpu/cpu$cpu/cpufreq/cpuinfo_cur_freq`"
done
echo "Temperature: `cat /sys/class/thermal/thermal_zone0/temp`"
sleep 1
@bkrepo
bkrepo / cpuburn_test.sh
Created July 31, 2017 08:21
ODROID-XU4 CPU Burning Test Script
#!/bin/bash
for i in {0..10}
do
burnCortexA9&
done
clear
for i in {1..60}
do
sleep 1
@bkrepo
bkrepo / usb3_reg_dump.c
Last active June 30, 2017 01:21
Exynos5422 USB 3.0 DRD Controller Register Dump
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#define USB3DRD_3_0_GLOBAL_BASE 0x1200C000
#define USB3DRD_3_1_GLOBAL_BASE 0x1240C000
#define USB3DRD_3_0_HOST_BASE 0x12000000
@bkrepo
bkrepo / fstab
Created March 16, 2017 02:00
/etc/fstab for ODROID-XU4 samba server
UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1
/dev/sda /media/hdd ext4 defaults,noatime 1 1
LABEL=boot /media/boot vfat defaults 0 1
@bkrepo
bkrepo / rc.local
Last active March 16, 2017 05:05
rc.local file for samba server testing
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
@bkrepo
bkrepo / smb.conf
Last active September 21, 2019 16:23
Samba server configuration for ODROID-XU4
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
@bkrepo
bkrepo / cyclictest
Created February 28, 2017 06:20
cyclictest Usage
$ ./cyclictest --help
cyclictest V 1.00
Usage:
cyclictest <options>
-a [CPUSET] --affinity Run thread #N on processor #N, if possible, or if CPUSET
given, pin threads to that set of processors in round-
robin order. E.g. -a 2 pins all threads to CPU 2,
but -a 3-5,0 -t 5 will run the first and fifth
threads on CPU (0),thread #2 on CPU 3, thread #3
@bkrepo
bkrepo / gpio_keyd
Created February 20, 2017 02:38
/etc/init.d/gpio_keyd
#! /bin/sh
### BEGIN INIT INFO
# Provides: gpio_keyd
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Run /usr/bin/gpio_keyd if it exist
### END INIT INFO
@bkrepo
bkrepo / xu4_gpio.txt
Created February 20, 2017 02:00
ODROID-XU3/4 GPIO and wiringPi numbers
$ gpio readall
+------+-----+----------+------ Model ODROID-XU3/4 ------+----------+-----+------+
| GPIO | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | GPIO |
+------+-----+----------+------+---+----++----+---+------+----------+-----+------+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 209 | 8 | I2C1.SDA | ALT5 | 1 | 3 || 4 | | | 5V | | |
| 210 | 9 | I2C1.SCL | ALT5 | 1 | 5 || 6 | | | 0v | | |
| 18 | 7 | GPIO. 18 | IN | 0 | 7 || 8 | 0 | ALT5 | UART0.TX | 15 | 172 |
| | | 0v | | | 9 || 10 | 0 | ALT5 | UART0.RX | 16 | 171 |
| 174 | 0 | GPIO.174 | ALT5 | 1 | 11 || 12 | 0 | ALT5 | GPIO.173 | 1 | 173 |
@bkrepo
bkrepo / gpio_keyd.conf
Created February 20, 2017 01:30
gpio_keyd configuration for arcade game box
# Digital input
# <Key code> <GPIO type> <GPIO pin> <Active value>
# User 1
KEY_LEFT digital 15 0
KEY_RIGHT digital 1 0
KEY_UP digital 4 0
KEY_DOWN digital 16 0
KEY_A digital 2 0
KEY_S digital 3 0
KEY_D digital 30 0