Skip to content

Instantly share code, notes, and snippets.

@jitomesky
jitomesky / app.js
Created August 6, 2014 09:17
BBB_Temperature_sensor_web
// BeagleBone Black + Grove Base Cape + Grove Temperature Sensor
// Base Cape: http://www.seeedstudio.com/wiki/Grove_Cape_for_BeagleBone_Series
// Temperature Sensor: http://www.seeedstudio.com/wiki/Grove_-_Temperature_Sensor
//
// Written by Toshifumi Nishinaga
// this code is public domain
var b = require('bonescript');
var getTemperature = function(){
@jitomesky
jitomesky / gifAnime2binImage.py
Last active September 19, 2017 04:03
GIFアニメ画像を2値化してArduino用のヘッダファイルを出力するプログラム
# -*- coding: utf-8 -*-
import numpy as np
import cv2
from PIL import Image, ImageSequence, ImageDraw
import time
import unittest
import sys
# original code : http://playground.arduino.cc/Code/PCD8544
@jitomesky
jitomesky / rpi2.cfg
Created April 3, 2015 17:24
OpenOCD target config file for Raspberry Pi 2
# ref: http://www.raspberrypi.org/forums/viewtopic.php?f=72&t=100268
# : http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0464f/ch10s06s01.html
adapter_khz 1000
adapter_nsrst_delay 400
reset_config none
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
@jitomesky
jitomesky / dhcp6c_pd_print.py
Created June 6, 2015 05:10
DHCPv6サーバーにIPv6 Prefixくれくれするスクリプト(注: まともなDHCPv6クライアントではないです.隔離環境で実行してください)
import ipaddress
import sys
import socket
import os
# ref
# http://docs.python.jp/3/library/socket.html
def show_identifier(option):
@jitomesky
jitomesky / kadai3-1.py
Last active January 1, 2016 09:29
c29sdmUgcHJvZ3JhbSBmb3IgT1MgS2FkYWkzIFRvaTEtMQ==
import math
X = 0
C = [0, 10, 20, X]
T = [0, 50, 70, 300]
def inputs(t, td, j):
global T
@jitomesky
jitomesky / PIC12F509_LEDonTest.c
Created October 15, 2013 09:27
PIC12F509でGP2につなげたLEDを点灯するだけのサンプルです。 LEDはカソード側がGP2につながっています。 流れは #pragma configで初期設定→OPTIONの設定→TRIS(IOモード)の設定→GP2を0にセット こんなかんじです。 内蔵クロックはOSCCALで変更可能で、初期状態ではmaximumの4MHzとなっています。 コンパイラはXC8コンパイラを利用しました。
#pragma config OSC = IntRC, WDT = OFF, MCLRE = OFF, CP = OFF
#if defined(__XC)
#include <xc.h> /* XC8 General Include File */
#elif defined(HI_TECH_C)
#include <htc.h> /* HiTech General Include File */
#endif
void main(void)
@jitomesky
jitomesky / gentoo_install_battle_x201.md
Last active November 22, 2015 01:47
ThinkPad X201 gentoo setting log
@jitomesky
jitomesky / clanton-standard.scc
Created April 11, 2014 07:15
fetch Intel Galileo kernel source
define KMACHINE clanton
define KTYPE standard
define KARCH i386
kconf hardware clanton.cfg
$ sudo emerge -1 systemd util-linux
WARNING: One or more repositories have missing repo_name entries:
/usr/local/portage/local-overlay/profiles/repo_name
NOTE: Each repo_name entry should be a plain text file containing a
unique name for the repository on the first line.
@jitomesky
jitomesky / dmesg
Last active August 29, 2015 14:24
btrfs_mount_failed
[ 0.000000] Linux version 3.18.12-gentoo (root@nightheron) (gcc version 4.8.4 (Gentoo 4.8.4 p1.6, pie-0.6.1) ) #1 SMP Thu Jun 4 06:18:47 UTC 2015
[ 0.000000] Command line: root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=gentoo.igz vga=791 BOOT_IMAGE=gentoo
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable