This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
pinMode(13, OUTPUT); | |
OCR0A = 0xF9; // 249 | |
TCCR0B = (1 << WGM01) | (1 << CS01); // CTC, prescale | |
TIMSK0 = (1 << OCIE1A); // interrupt | |
} | |
void loop() { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
Serial.begin(9600); | |
initADC(); | |
} | |
void loop() { | |
Serial.println(readADC()); | |
} | |
void initADC() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <netinet/in.h> | |
void print_addr(unsigned int addr) { | |
printf("%d.", (char)(addr >> 24)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |