Skip to content

Instantly share code, notes, and snippets.

View 4noha's full-sized avatar

Shinonome.Hatsuri 4noha

View GitHub Profile
# ライブラリのインストール
# gem install serialport
require 'io/console'
require 'serialport'
sp = SerialPort.new('/dev/ttyS0', 9600, 8, 1, 0) # device, rate, data, stop, parity
puts "Angle( C-c: exit )\n1. 0°\n2. 90°\n3. 180°"
require 'io/console'
puts "Angle( C-c: exit )\n1. 0°\n2. 90°\n3. 180°"
while c = STDIN.getch
exit if c == ?\C-c
if c == "1" || c == "2" || c == "3"
print c
puts "\nAngle( C-c: exit )\n1. 0°\n2. 90°\n3. 180°"
# ruby input_test.c
require 'io/console'
puts "Angle( C-c: exit )\n1. 0°\n2. 90°\n3. 180°"
while c = STDIN.getch
exit if c == ?\C-c
print c
@4noha
4noha / !3:dim_to_aqm1248a.rb
Last active February 1, 2018 07:10
dim dot graphic data binarization toolkit for AQM1248A
#######################################
## test draw 1dimmantion(6144)
#######################################
def pic_1dimput(pic, width=128, height=48)
for i in 0..height-1 do
rawdim = []
for j in 0..width-1 do
rawdim << ( (pic[ i*128 + j ] != 0) ? "$" : " " )
end
rawdim << "\n"
sudo bluetoothctl
> scan on
> scan off
> exit
sudo apt-get install dbus
wget https://raw.githubusercontent.com/mk-fg/fgtk/master/bt-pan
chmod +x bt-pan
# sudo apt-get install python-pip
#include <WiFi.h>
// Replace with your network credentials
const char* ssid = "your SSID";
const char* password = "your PASS";
WiFiServer server(80);
const int heat = 13;
const int cooldown = 12;
@4noha
4noha / create_ap.sh
Created December 10, 2017 11:47
Create RaspberryPi WiFi AP bridge
ssh [email protected]
> raspberry
sudo apt-get install bridge-utils -y --no-install-recommends
> raspberry
sudo emacs /etc/network/interfaces
"
auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0
"
@4noha
4noha / rename_user.sh
Last active May 1, 2019 20:24
Raspbian rename default user
ssh [email protected]
> raspberry
sudo apt-get update
> raspberry
sudo apt-get upgrade
sudo useradd -M tmp
sudo gpasswd -a tmp sudo
sudo passwd tmp
> a
@4noha
4noha / Confluence Bote System.html
Last active June 30, 2017 09:17
ConfluenceでHTMLコードブロックと変数用の記事を使って投票ページを作るやつ
<table id="vote_system">
<thead>
<tr>
<th>名前</th>
<th>得票数</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody></tbody>
@4noha
4noha / now_playing.wsf
Created June 23, 2017 06:59
[WIP] slackにNow Playingするやつ(Win用)。アクセストークンの差異で発言元をbotと自アカウント(未実装)で選べる。
<?xml version="1.0" encoding="utf-8" ?>
<package>
<job>
<runtime></runtime>
<script language="JScript">
<![CDATA[
/******************************************************************************
**
** now_playing_win.wsf
** Created by Takuya Noaki on 17/06/20.