Skip to content

Instantly share code, notes, and snippets.

View kanokkorn's full-sized avatar
💤
Sleeping

kanokkorn kanokkorn

💤
Sleeping
View GitHub Profile
@kanokkorn
kanokkorn / collective.md
Created September 17, 2023 09:48
commands that i should have known better when using linux and windows

Setting the default editor for Git

git config --global core.editor "vim"

Add drive to flatpak steam

flatpak override --user --filesystem=/path/to/mountpoint com.valvesoftware.Steam
@kanokkorn
kanokkorn / jim_devices.c
Created February 17, 2022 13:51
Jimmy devices scanner
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <dirent.h>
int count_usb(char**);
char* arr[50] = {};
char **ptr = arr;
GOLD STARS (rewatch-ready)
Spring 2020 (tentative, ongoing):
- Honzuki no Gekokujou: Shisho ni Naru Tame ni wa Shudan o Erande Iraremasen (2020)
- Otome Game no Hametsu Flag shika Nai Akuyaku Reijou ni Tensei Shiteshimatta
Winter 2020:
(none)
Fall 2019:
- Honzuki no Gekokujou: Shisho ni Naru Tame ni wa Shudan o Erande Iraremasen
@kanokkorn
kanokkorn / opencv-install.sh
Last active February 29, 2020 11:59
script for build opencv for raspberry pi 3
apt install -y git \
python3-pip \
build-essential \
cmake \
unzip \
pkg-config \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libavcodec-dev \
@kanokkorn
kanokkorn / install.sh
Last active December 1, 2021 20:52
Raspberry pi 3 Steam link
sudo apt install -y steamlink
# From clouma (https://github.com/cluoma/steamlink.service)
cd /etc/systemd/system/ && wget https://raw.githubusercontent.com/cluoma/steamlink.service/master/steamlink.service
cd ~
sudo systemctl daemon-reload
sudo systemctl enable steamlink.service
sudo reboot now
#include "Magellan.h"
#include "TinyGPS++.h"
#include "SoftwareSerial.h"
#include <Wire.h>
Magellan magel;
char auth[]="dd13f7a0-df93-11e8-8443-17f06f0c0a93"; //Token Key you can get from magellan platform
String payload;
SoftwareSerial serial_connection(10, 11); //RX=pin 10, TX=pin 11
TinyGPSPlus gps;
@kanokkorn
kanokkorn / tmux-cheatsheet.markdown
Created November 30, 2018 07:49 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@kanokkorn
kanokkorn / nanpy_sample.py
Last active July 12, 2017 07:07
nanpy sample code for windows
from nanpy import *
from colorama import Fore, init, AnsiToWin32
import time, sys
connection = SerialManager(device='COM5:')
a = ArduinoApi(connection=connection)
a.pinMode(13, a.OUTPUT)
print("Type ON, OFF, BLINK to open LED or EXIT to exit the program")
init(autoreset=True)
stream = AnsiToWin32(sys.stderr).stream
while 1:
@kanokkorn
kanokkorn / color_ping.py
Created January 10, 2017 19:38
basic RPi ping /w color
import time, os, colorama
from colorama import Fore, Back, Style
host = 'www.google.com'
colorama.init()
while True:
response = os.system('sudo ping -c 1 -W 1000' + host )
if response == 0:
print(Fore.GREEN + host +" is up ! " )
@kanokkorn
kanokkorn / gist:44174792cda99c1f2281535446acdec8
Last active December 29, 2016 06:44 — forked from chrismeyersfsu/gist:3270358
Arduino Poor man's oscilloscope
#define ANALOG_IN 0
void setup() {
Serial.begin(115200);
}
void loop() {
int val = analogRead(ANALOG_IN);
Serial.write( 0xff );
Serial.write( (val >> 8) & 0xff );