Skip to content

Instantly share code, notes, and snippets.

View cho0h5's full-sized avatar
🤯

Youngho Cho cho0h5

🤯
  • Chung-Ang University
  • Korea
  • 00:08 (UTC +09:00)
View GitHub Profile
# zfs smb 설정
sudo zfs set sharesmb=on yourpool/yourdataset
sudo zfs get sharesmb
# 그룹, 계정 생성
sudo groupadd -g 2000 yourgroup
sudo useradd -g yourgroup -s /sbin/nologin -u 2000 yourname
# smb 설치, 비밀번호 초기화
sudo apt install samba
# https://www.digitalocean.com/community/tutorials/how-to-set-up-a-samba-share-for-a-small-organization-on-ubuntu-16-04
docker run --rm -it \
-p 445:445 \
-v ~/tmp/nas/data:/samba/data \
-e SMB_USERNAME=jane \
-e SMB_USERPASSWD=jane \
ubuntu /bin/bash
apt update && apt upgrade -y
apt install -y samba
// Based on https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
// Description
// Control built-in led in NodeMCU.
// Edit your SSID and PASSWD (line 19, 20)
// Usage
// / -> blink shortly
// /on -> turn led on
// /off -> turn led off
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/i2c.h"
struct calibration_data {
int16_t AC1;
int16_t AC2;
int16_t AC3;
uint16_t AC4;
uint16_t AC5;
@cho0h5
cho0h5 / timer.ino
Last active September 18, 2022 08:58
void setup() {
pinMode(13, OUTPUT);
OCR0A = 0xF9; // 249
TCCR0B = (1 << WGM01) | (1 << CS01); // CTC, prescale
TIMSK0 = (1 << OCIE1A); // interrupt
}
void loop() {
}
@cho0h5
cho0h5 / adc.ino
Created September 18, 2022 07:25
void setup() {
Serial.begin(9600);
initADC();
}
void loop() {
Serial.println(readADC());
}
void initADC() {
# Reference: https://indominusbyte.github.io/fastapi-jwt-auth/usage/basic/
from fastapi import FastAPI, Depends, Request, HTTPException
from fastapi.responses import JSONResponse
from fastapi_jwt_auth import AuthJWT
from fastapi_jwt_auth.exceptions import AuthJWTException
from pydantic import BaseModel
app = FastAPI()
@cho0h5
cho0h5 / INADDR.c
Created March 1, 2022 09:14
INADDR_ANY, INADDR_BROADCAST, INADDR_LOOPBACK
#include <stdio.h>
#include <netinet/in.h>
void print_addr(unsigned int addr) {
printf("%d.", (char)(addr >> 24));
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'joshdick/onedark.vim'
Plug 'scrooloose/nerdtree'
call plug#end()
set nu
package main
import (
"context"
"fmt"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/mongo/readpref"