This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####################################### | |
| ## 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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°" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ライブラリのインストール | |
| # 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°" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=homehub | |
| [Service] | |
| Type=simple | |
| WorkingDirectory=/home/nokkii/works/homehub | |
| ExecStart=/usr/local/opt/rbenv/shims/ruby /home/nokkii/works/homehub/app.rb | |
| ExecStop=pkill -KILL -f "ruby app.rb" | |
| ExecReload=pkill -KILL -f "ruby app.rb" && /usr/local/opt/rbenv/shims/ruby /home/nokkii/works/homehub/app.rb | |
| TimeoutStopSec=5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'ftdi' | |
| @ctx = Ftdi::Context.new | |
| @ctx.usb_open_desc(0x0403, 0x6001,nil,"00000000") | |
| @ctx.set_bitmode(0x3f, :bitbang) | |
| @ctx.read_pins | |
| @ctx.write_data [0x03] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo emacs /etc/network/interfaces | |
| > | |
| auto eth0 | |
| iface eth0 inet dhcp | |
| allow-hotplug wlan0 | |
| auto wlan0 | |
| iface wlan0 inet static | |
| address 192.168.1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install nvm for system-wide | |
| sudo apt install git | |
| cd /usr/local | |
| git clone git://github.com/creationix/nvm.git nvm | |
| . /usr/local/nvm/nvm.sh | |
| sudo emacs /etc/profile.d/nvm.sh | |
| > | |
| source /usr/local/nvm/nvm.sh | |
| > |