Skip to content

Instantly share code, notes, and snippets.

View 4noha's full-sized avatar

Shinonome.Hatsuri 4noha

View GitHub Profile
@4noha
4noha / HatsuriBadge.ino
Last active November 4, 2023 04:06
Hatsuri Badge for ESP32-2424S012 Round Display DEV MODULE(ESP32-C3-MINI-1U, GC9A01)
/*******************************************************************************
* PROGMEM Image Viewer
* This is a simple PROGMEM bitmap image viewer example
* Image Source: https://support.arduino.cc/hc/en-us/articles/360020652100
*
* How to create custom image:
* 1. Open image ith GIMP
* 2. Export Image as C-Source
* 3. Uncheck all option and check "Save as RGB565 (16-bit)"
* 4. Revise exported file just like "Arduino_UNO_Rev3_Ok.c"
@4noha
4noha / hoge.sh
Last active February 21, 2023 15:53
transpalented gifs to greenbacked mp4s .sh
for FILE in *.gif
do
FILENAME=`echo ${FILE} | sed 's/\.[^\.]*$//'`
ffmpeg -i ${FILENAME}.gif -movflags faststart -pix_fmt yuv420p -vf "color=00ff00,format=rgb24[c];[c][0]scale2ref[c][i];[c][i]overlay=format=auto:shortest=1,setsar=1,scale=trunc(iw/2)*2:trunc(ih/2)*2" ${FILENAME}.mp4
done
# -*- coding: utf-8 -*-
import sys
import signal
import socket as skt
import math
from naoqi import ALProxy
class UDPServer():
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
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
>
# 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
>
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
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]
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.
@4noha
4noha / homehub.service
Created April 8, 2018 06:07
for systemd
[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