Skip to content

Instantly share code, notes, and snippets.

Ato Araki atotto

Block or report user

Report or block atotto

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 esc.py
import time
import pigpio
motor_pin = 18 # GPIO18 (pin12)
pi = pigpio.pi()
pi.set_mode(motor_pin, pigpio.OUTPUT)
pi.set_servo_pulsewidth(motor_pin, 1300)
print("please power on ESC")
@atotto
atotto / ssh.go
Last active Jun 4, 2019
golang ssh terminal client
View ssh.go
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
View firebase_sign_in_with_custom_token.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
View pomodoro-timer.ino
#include <avr/sleep.h>
const int timerOutPin = 11;
#define analogOutMax 235
void timer() {
unsigned long startTime = millis();
long elapsedTime = 0;
int outputValue = 0;
@atotto
atotto / firebase_idtoken_test.go
Created Nov 27, 2018
Firebase generate user id token
View firebase_idtoken_test.go
package hoge
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
@atotto
atotto / influxdb-gce.cloud.cfg
Created May 12, 2018
influxdb gce deploy with cloud-init
View influxdb-gce.cloud.cfg
#cloud-config
#see: https://cloud.google.com/container-optimized-os/docs/how-to/create-configure-instance
write_files:
- path: /etc/systemd/system/influxdb.service
permissions: 0644
owner: root
content: |
[Unit]
Description=Start influxdb docker container
@atotto
atotto / setup-jx.sh
Created Mar 28, 2018
setup jenkins-x
View setup-jx.sh
#!/bin/sh
set -e
VERSION=$(curl -s https://api.github.com/repos/jenkins-x/jx/releases/latest | jq '.tag_name' -r)
curl -sL https://github.com/jenkins-x/jx/releases/download/$VERSION/jx-linux-amd64.tar.gz | tar xzv
sudo mv jx /usr/local/bin
@atotto
atotto / lsusb.go
Created Dec 20, 2017
lsusb (golang)
View lsusb.go
package main
import (
"fmt"
"log"
"github.com/google/gousb"
"github.com/google/gousb/usbid"
)
@atotto
atotto / compute.go
Last active Jul 11, 2019
golang testing pattern
View compute.go
package calc
import (
"go/token"
"go/types"
)
func Compute(expr string) (string, error) {
tv, err := types.Eval(token.NewFileSet(), types.NewPackage("main", "main"), token.NoPos, expr)
if err != nil {
@atotto
atotto / dash_button_server.go
Created Jul 17, 2017
Amazon Dash Button Server
View dash_button_server.go
package main
import (
"log"
"net"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
)
You can’t perform that action at this time.