Skip to content

Instantly share code, notes, and snippets.

nokkii

Block or report user

Report or block nokkii

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View udp_pepper_controller.py
# -*- coding: utf-8 -*-
import sys
import signal
import socket as skt
import math
from naoqi import ALProxy
class UDPServer():
View output_miniplug.sh
sudo nano /boot/config.txt
>
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2
>
amixer cset numid=3 1
View gpio.sh
echo 2 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio2/direction
sudo emacs /usr/bin/on
>
#!/bin/sh
echo 1 > /sys/class/gpio/gpio2/value
>
View install_dashfunction.sh
# 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
>
View create_wifi_napt_router.sh
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
View coffee-test
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]
View dashbutton-poizoning.sh
sudo apt install nginx
sudo apt-get -y install dnsmasq
sudo emacs /etc/dnsmasq.conf
# # Disables /etc/resolv.conf
# no-resolv
# no-poll
# # Never forward plain names (without a dot or domain part)
# domain-needed
# # Never forward addresses in the non-routed address spaces.
View homehub.service
[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
View interact_arduino.rb
# ライブラリのインストール
# 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°"
View input_test2.rb
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°"
You can’t perform that action at this time.