Skip to content

Instantly share code, notes, and snippets.

@bryanbr23
bryanbr23 / AutomatedWatering.md
Last active July 26, 2024 21:47
Automated Herb Plant Watering System

Automated Herb Plant Watering System

Objective

Ok, I admit it: I generally excel at killing plants largely due to neglect. Sure, I could claim work, cooking, hobbies, etc. If I’m honest, I generally forget to water them. So, I wanted to implement an automated watering system linked to home automation. I wanted to do it on the cheap. This was also a test, so if needed a throw-away experiment. Turns out it works for few (3) herb-plants that I needed to keep alive.

Ingredients

  • D1_Mini (Wemo, ESP8266).
  • Kit link.
  • 5v Relay
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active November 5, 2024 05:23
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@rafmos
rafmos / runtastic-export-all-activities.md
Last active July 28, 2019 19:25
Download all activities from Runtastic.com (as .gpx)

Download all activities from Runtastic 🏃

With this script you can download all your activities from www.runtastic.com in .gpx format. Runtastic restricted these exports to 5 per hour. That's why I adapted a little bit christianewald's script.

❗ Only tested in Google Chrome 41.0+

How does it work

Login to your runtastic account and go to the page where all your activities are listed. Then open the developer tools of Chrome with CMD + OPTION + I and go to the console tab. Now copy and paste the following script in the console line and press enter. The usually content should disapear and the downloads should start.

@PattaFeuFeu
PattaFeuFeu / HA_Migrate-sqlite-to-mysql.md
Last active September 8, 2024 06:41
Steps necessary to migrate from HomeAssistant’s standard sqlite database to an external MariaDB(10) SQL database

Migrate Home Assistant’s sqlite database to MySQL, specifically MariaDB (10)

After having added a decent amount of entities to my Home Assistant setup, the user interface—especially the history tab, but also the history for each entity—became very sluggish. Having to wait for up to 30 seconds to see the history graph for a single entity became the norm with an sqlite file weighing in at 6GB and millions of entries in the “events” and “states” tables.

I wanted to keep my acquired data, so I had to migrate it from the current sqlite file to a MySQL database instead of starting anew. I’ve done this using Home Assistant version 0.81 and MariaDB 10. Some parts might change in the future.

Dump Home Assistant sqlite database

@gabonator
gabonator / abcom_protocol.js
Created November 26, 2017 20:05
ABcom satellite settop box protocol reverse engineering
/*
reverse engineering of ABcom Cryptobox 600HD mini dvbs box protocol
Firstly I examined android package (since it was easier to get it) "g-mscreen-2-3-11.apk". It
uses C++ library for implementing control protocol. Then I was trying to capture UPnP communication
from iphone connected to OSX running wireshark. But without luck. GMScreen allowed to connection
to box using ip address and port. This traffic was easier to caputre and analyse. Requests by
client application are human readable json/xml code. Some response packets are compressed using
zlib.
#!/bin/bash
#set -o pipefail
set -u
set -e
# See https://www.amazon.com/sendtokindle
FROM="me@my_sender_email"
TO="[email protected] [email protected]"
is_mobi() {

Bisecting

First you start the bisect

git bisect start

Then you mark good and bad refs

git bisect good v2.6.18

git bisect bad master

@javivelasco
javivelasco / reactive-2016.md
Last active January 10, 2023 19:45
Proposal for lightning talk at Reactive Conf 2016

Please star ⭐️ the gist to help! This is a proposal for a ⚡️ talk at Reactive Conference.

Styling Components in React Toolbox 2

I wrote react-toolbox and presented it almost a year ago in lighning talk at Reactive Conf 2015 in Bratislava. At first it was just a proof of concept of a component library styled with CSS Modules and SASS. Now the project has grown quite a bit, and during this year there has been tons of changes and lessons learned.

Theming and customization is one of the most difficult and interesting problems to solve. For the first version we needed a custom Webpack loader to generate themes and doing simple style overrides was very painful. Today I'm working on a new playground that will allow you try CSS Modules live, and to create React Toolbox themes on the f

@javivelasco
javivelasco / reactive-2015.md
Last active October 2, 2022 16:36
Proposal for lightning talk at Reactive Conf 2015

I’m amazed by React and how it’s bringing happiness to our developer lives. I specially like the workflow that integrates Webpack + React + CSS Modules + Babel among other tools and preprocessors. That’s why Javier Jiménez and I are working together in a library called React Toolbox that we would like to show in a lightning talk at Reactive Conference.

The main idea is to create a set of React components implementing Material Design guidelines. There are already some libraries that solve a similar problem but our project is mostly focused on the workflow and best practices to create a tool everybody would want to use. Also, we are sticking to the design guidelines proposed by Google and embracing minimalism by generating the minimum possible amount of HTML and styles to get the best result. Our workflow includes among others:

  • Webpack.
  • ES6 with Babel
  • Unit t
@siawyoung
siawyoung / post_to_slack.rb
Created March 16, 2015 04:39
Script for posting to Slack's incoming webhooks
require 'json'
require 'optparse'
require 'net/http'
require 'net/https'
def parse_options(argv)
#######################################
# Please change the following as needed
#######################################