Skip to content

Instantly share code, notes, and snippets.

@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
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 / 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!")
@rcarmo
rcarmo / build_qemu_debian_image.sh
Created June 19, 2019 14:02 — forked from sigmaris/build_qemu_debian_image.sh
Automate the installation of Debian Buster on a x86_64 QEMU 4.0.0 VM hosted on macOS
#!/bin/bash -e
if [ "$(uname -s)" != "Darwin" ]
then
echo "This script is for building a Debian x86_64 image to use on MacOS"
exit 1
fi
TEMP="$(mktemp -d build.XXXXX)"
cp preseed.cfg $TEMP
@rcarmo
rcarmo / gist:cbd315bf4b058c23b65505d4c0a7c99c
Created April 20, 2019 15:59 — forked from nosuchuser/gist:21db3fdd9f4b80bf0910f8b8b6ea2f63
dnsmasq.conf configuration for vodafone IPTV
server=/.iptvpoc.alu/.discovery.iptv.microsoft.com/.iptv.vodafone.pt/.iptvdiscovery/.ims.vodafone.pt/192.168.1.1
@rcarmo
rcarmo / pronto2broadlink.py
Last active April 12, 2018 02:10 — forked from appden/pronto2broadlink.py
Convert Pronto IR hex codes to LIRC pulses then Broadlink packets compatible with python-broadlink
@rcarmo
rcarmo / rPi3-ap-setup.sh
Last active September 25, 2017 14:10 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# Tweaked for Ubuntu
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@rcarmo
rcarmo / aiohttp-server.py
Created February 25, 2017 22:04 — forked from gdamjan/aiohttp-server.py
Example: asyncio and aiohttp, handling longpoll, eventsource and websocket requests with a queue and background workers
from aiohttp import web
from threading import Thread
import asyncio
import time, uuid
loop = asyncio.get_event_loop()
def long_blocking_thing(sleep):
time.sleep(sleep)
return 42
@rcarmo
rcarmo / *bigcartel.slack.com*
Created October 20, 2016 19:06 — forked from alexparker/*bigcartel.slack.com*
UserScript for toggling slack sidebar
var sideBar = $('#col_channels_bg').is(':visible');
$(window).on('keypress', function(e) {
// uses cmd+b
if (e.metaKey && e.charCode == 98) {
var display = sideBar ? 'none' : 'initial';
var left = sideBar ? 0 : '';
$('#col_channels_bg, #col_channels').css('display', display);
$('#messages_container').css('margin-left', left);
$('#footer').css('left', left);