Skip to content

Instantly share code, notes, and snippets.

@rcarmo
rcarmo / build_node9.sh
Created October 13, 2020 21:13 — forked from hnakamur/build_node9.sh
get and build node9
#!/bin/sh
set -e
basedir=`pwd`
mkdir -p "$basedir/github.com/jvburnes"
git clone https://github.com/jvburnes/node9 "$basedir/github.com/jvburnes/node9"
mkdir -p "$basedir/github.com/stevedonovan"
git clone https://github.com/stevedonovan/Penlight "$basedir/github.com/stevedonovan/Penlight"
@rcarmo
rcarmo / app.fnl
Created September 6, 2020 17:09 — forked from turbo/app.fnl
; vi: ft=clojure
; THIS IS A Fennel SOURCE FILE (.fnl) !NOT! clojure!
; you need to use luajit to run this, after using fennel --compile
; install lapis and turbo from luarocks
; When running with Fennel directly, you need to --globals all used HTML tags
(local turbo (require "turbo"))
(local render_html (. (assert (require "lapis.html")) :render_html))
@rcarmo
rcarmo / raspberry-pi-zero_as_webcam.md
Created August 26, 2020 14:14 — forked from justinschuldt/raspberry-pi-zero_as_webcam.md
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
@rcarmo
rcarmo / Makefile
Last active April 20, 2020 10:57
Setup shairport-sync on a Raspberry Pi
deps:
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get autoremove -y
sudo apt-get install -y \
build-essential git autoconf automake libtool \
xmltoman libdaemon-dev libpopt-dev libconfig-dev \
libasound2-dev libpulse-dev \
avahi-daemon libavahi-client-dev \
libssl-dev libsoxr-dev \
1. Configurar IPv4 estático e IPv6 estático no pihole (YMMV)
192.168.1.2 e 2001:818:xxxx::192:168:1:2 no meu caso
2. Configurar DNS uplink do pihole igual ao IP do Router (192.168.1.1)
3. Configurar Router
Huawei HS8247W (Smart Router 2)
1. Configurações Avançadas -> LAN -> Configuração de DHCP
Servidor DNS Primário: 192.168.1.2
@rcarmo
rcarmo / index.md
Last active March 20, 2020 10:05
Remote Work / Teaching Kit

5 Key Points for Teachers/people new to running remote meetings:

  • Get a headset so that others can understand you well (cameras are secondary, good desktop mics are much more expensive).
  • Add an initial slide with class/meeting rules (mute your mic, ask permission to speak, use the chat, etc.)
  • Understand how these three things work: Screen sharing, Mute all (VERY important), Recordings
  • Use the PowerPoint “laser” and annotations to highlight materials and keep people engaged. Also check if the Whiteboard app (https://www.microsoft.com/en-us/p/microsoft-whiteboard/9mspc6mp8fm4) works for your class (it has a web-based version).
  • Pause often and poll the audience for questions, so that newcomers learn the dynamics of unmute/mute, taking turns to speak, etc.

If you can't find a good mic for your computer, consider joining the call/class simuntaneously with your phone (via Wi-Fi) and using that as a mic -- most smartphones these days work well as speakerphones, and big, easy to use buttons to mute audio

@rcarmo
rcarmo / README.md
Created March 5, 2020 17:37 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
""" Per-Filetype Scripts
" NOTE: These define autocmds, so they should come before any other autocmds.
" That way, a later autocmd can override the result of one defined here.
filetype on " Enable filetype detection,
filetype indent on " use filetype-specific indenting where available,
filetype plugin on " also allow for filetype-specific plugins,
syntax on " and turn on per-filetype syntax highlighting.
set numberwidth=1 " using only 1 column (and 1 space) while possible
@rcarmo
rcarmo / .zshrc
Last active December 25, 2023 06:41
My zsh configuration
# =======
# GLOBALS
# =======
if [[ "$(uname)" == "Darwin" ]]; then
platform="Darwin"
elif [[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then
platform="Linux"
else
platform="POSIX"
@rcarmo
rcarmo / bottle_github_webook_handler.py
Last active August 21, 2019 18:41
Bottle GitHub WebHook Handler
@post("/handler")
def gitdeploy():
signature = request.headers.get("X-Hub-Signature", None)
if not signature:
abort(400, "Invalid Request")
event = request.headers.get("X-GitHub-Event", None)
if event == "push":
hashed = "sha1=" + hmac.new(GITHUB_WEBHOOK_SECRET, request.body.read(), hashlib.sha1).hexdigest()
if signature == hashed:
# Do Stuff