Skip to content

Instantly share code, notes, and snippets.

@kadamski
kadamski / opc_boot.sh
Created February 26, 2016 13:06
Script for booting OrangePI PC in FEL mode
g#!/bin/bash
UBOOTDIR=./u-boot/
KERNELDIR=./linux-sunxi/
INITRAMFS=~/Downloads/buildroot-2015.11.1/output/images/rootfs.cpio.uboot
KERNEL_ADDR=0x42000000
RAMDISK_ADDR=0x43300000
FDT_ADDR=0x43000000
SCRIPT_ADDR=0x43100000
@kadamski
kadamski / sds011
Last active March 31, 2024 02:03
SDS011 dust sensor reading
#!/usr/bin/python
# coding=utf-8
# "DATASHEET": http://cl.ly/ekot
from __future__ import print_function
import serial, struct, sys, time
DEBUG = 1
CMD_MODE = 2
CMD_QUERY_DATA = 4
CMD_DEVICE_ID = 5
@kadamski
kadamski / gist:69ea849f9564d0b9a8c1
Created May 2, 2015 18:14
Those kthread_stop will oops
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/kthread.h>
#include <linux/ratelimit.h>