Skip to content

Instantly share code, notes, and snippets.

@rpanachi
rpanachi / command_line.yaml
Last active March 13, 2024 20:44
Tuya api script (for home assistant)
- sensor:
name: Tuya Power Clamp
unique_id: tuya_power_clamp
command: "python3 /config/tuya.py device_id"
device_class: power
state_class: total_increasing
unit_of_measurement: Wh
scan_interval: 60
value_template: "{{ value_json.EnergyConsumed | float(0) * 10 }}"
eufy:
image: bropat/eufy-security-ws
container_name: eufy
restart: unless-stopped
environment:
- USERNAME=email
- PASSWORD=pass
- COUNTRY=country
ports:
- 3000:3000
@rpanachi
rpanachi / README.md
Last active June 11, 2023 06:48 — forked from brennanneoh/README.md
Anet A8 Printer Profile for Cura 3D

Setup

  1. Install Cura 2.4
  2. Copy anet_a8.def.json to ~/Library/Application Support/cura/3.4/definitions
  3. Open Cura
  4. Expand Custom, then select Anet A8
  5. Click Finish
@rpanachi
rpanachi / how-to-fix-macos-mojave-battery-draining-issue.md
Last active April 20, 2023 13:31
How to Fix macOS Mojave Battery Draining Issue
@rpanachi
rpanachi / db.rake
Created April 10, 2016 21:26
Rakefile for Sequel database operations
namespace :db do
require 'sequel'
Sequel.extension(:migration)
MIGRATIONS_PATH = 'db/migrations'
def db_conn_env
ENV["BOOKSHELF_DATABASE_URL"]
end
@rpanachi
rpanachi / lorem.txt
Created July 25, 2019 03:32
lorem.txt
Lorem ipsum
Dolor sit amet
Vestibulum vitae
Morbi iaculis elit
Sed porta ante
Magna faucibus
Lorem
Ipsum
Lorem
Dolor
Vitae
Magna
Dolor
Lorem
@rpanachi
rpanachi / char.scad
Created December 17, 2018 01:06 — forked from tbuser/char.scad
latest version now at: http://github.com/tbuser/openscad-bitmap
module make_atari_bitmap(char, block_size, height, include_base) {
if (char == "0") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,1,1,1,0,
0,1,1,1,1,1,1,0,
#!/bin/sh
for q in $(echo 'SMEMBERS "resque:queues"' | redis-cli | awk '{print $1}')
do
echo $q $(echo "LLEN \"resque:queue:$q\"" | redis-cli)
done
# in a single line;
# for q in $(echo "SMEMBERS \"resque:queues\"" | redis-cli | awk '{print $1}'); do echo $(echo "LLEN \"resque:queue:$q\"" | redis-cli); done | awk '{s+=$1} END {print s}'
@rpanachi
rpanachi / deploy.sh
Created September 20, 2012 19:18
Forrest Deployer Shell
#!/bin/bash
APP_DIR=/var/local/apps/app
RAILS_ENV=production
function step
{
if [ "$step_count" = "" ]; then
step_count=0
fi