Skip to content

Instantly share code, notes, and snippets.

@vsefer
vsefer / epson-L3151-debian.sh
Last active October 26, 2020 01:59
Install/Connect EPSON L3151 via WIFI to Debian
sudo apt install sane-airscan printer-driver-escpr cups simple-scan
import time
import sys
import os
import subprocess
import digitalio
import board
import threading
from PIL import Image, ImageDraw, ImageFont
from socket import error as socket_error
from datetime import datetime
#!/bin/bash
# sudo apt-get install mpc jq curl wget
MPD_PORT=6600
HTTP_PORT=6680
RPC_HOST=http://localhost:$HTTP_PORT/mopidy/rpc
TRACK_ARTWORK=/tmp/cover-art-img
DEFAULT_ARTWORK=some-default-picture
import time
import sys
import os
import digitalio
import board
from PIL import Image, ImageDraw, ImageFont
from datetime import datetime
import adafruit_rgb_display.ili9341 as ili9341
import adafruit_rgb_display.st7789 as st7789 # pylint: disable=unused-import
import adafruit_rgb_display.hx8357 as hx8357 # pylint: disable=unused-import
pi@scarlett:~ $ cat mopidy_display_ili9341.py
"""
This will show some Linux Statistics on the attached display. Be sure to adjust
to the display you have connected. Be sure to check the learn guides for more
usage information.
This example is for use on (Linux) computers that are using CPython with
Adafruit Blinka to support CircuitPython libraries. CircuitPython does
not support PIL/pillow (python imaging library)!
"""
@vsefer
vsefer / aptx-debian
Last active November 14, 2019 23:14
sudo apt install cmake libpulse-dev libsbc-dev libavcodec-dev fdkaac libbluetooth-dev libltdl-dev libdbus-glib-1-dev libfdk-aac-dev
git clone https://github.com/EHfive/pulseaudio-modules-bt.git
cd pulseaudio-modules-bt/
git submodule update --init
git -C pa/ checkout master
mkdir build && cd build
cmake -DFORCE_LARGEST_PA_VERSION=ON ..
-- The C compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/cc
@vsefer
vsefer / gtk.css
Created April 20, 2018 01:40
Reduce titlebar height in Gnome 3.28
/* vsefer@x220 ~ $ cat ~/.config/gtk-3.0/gtk.css */
headerbar.default-decoration {
padding-top: 2px;
padding-bottom: 2px;
min-height: 0px;
}
headerbar.default-decoration button.titlebutton {
padding: 0px;
min-height: 0px;
@vsefer
vsefer / arduino-acs711.ino
Created January 15, 2018 13:37
acs711 + arduino
long readVcc()
{ long result;
// Read 1.1V reference against AVcc
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
delay(2); // Wait for Vref to settle
ADCSRA |= _BV(ADSC); // Convert
while (bit_is_set(ADCSRA,ADSC));
result = ADCL;
result |= ADCH<<8;
result = 1126400L / result; // Back-calculate AVcc in mV
@vsefer
vsefer / arduino-voltmeter.ino
Last active January 15, 2018 13:57
arduino-voltmeter
long readVcc()
{
long result;
// Read 1.1V reference against AVcc
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
delay(2); // Wait for Vref to settle
ADCSRA |= _BV(ADSC); // Convert
while (bit_is_set(ADCSRA,ADSC));
result = ADCL;
result |= ADCH<<8;
@vsefer
vsefer / make-fb-beautiful
Last active December 20, 2017 20:46
make facebook beautiful with those ublock filters
www.facebook.com##.egoOrganicColumn
www.facebook.com###profile_timeline_tiles_unit_pagelets_friends
www.facebook.com###profile_timeline_tiles_unit_pagelets_albums
www.facebook.com###profile_timeline_tiles_unit_pagelets_fun_fact_answers
www.facebook.com##._26z1
www.facebook.com##._4-u8._2ph_._19ah._4-u2
www.facebook.com###appsNav
www.facebook.com###fb_stories_card_root
www.facebook.com##._50z3._9bp._1ltv
www.facebook.com##._55ob._4kqp