Skip to content

Instantly share code, notes, and snippets.

View bogdanr's full-sized avatar
💭
:(){ :|:& };:

Bogdan Rădulescu bogdanr

💭
:(){ :|:& };:
View GitHub Profile
@bogdanr
bogdanr / Flashlight-fade.ino
Last active October 13, 2017 09:13
Attiny13 flashlight fade in and out at button press
#include <avr/interrupt.h>
#include <avr/sleep.h>
#define BUTTON 4
#define LED 1
int dir = 1;
int lum = 0;
boolean toggle = false;
int vals [] = {0, 1, 2, 3, 5, 9, 12, 18, 22, 32, 44, 58, 76, 120, 163, 255};
@bogdanr
bogdanr / EnergyMonitor.ino
Last active May 29, 2021 14:32
EnergyMonitor
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <BlynkSimpleEsp8266.h>
#include <SPI.h>
#include <bitBangedSPI.h>
#include <MAX7219_Dot_Matrix.h>
#define OTA_UPDATES
@bogdanr
bogdanr / WashingMachine.ino
Created April 7, 2017 21:24
WashingMachine
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DNSServer.h> //Local DNS Server used for red
@bogdanr
bogdanr / purgearticle.php
Last active January 19, 2017 10:45
Purge web article from PHP
<?php
header( 'Content-Type: text/plain' );
header( 'Cache-Control: max-age=0' );
$hostname = 'localhost';
$port = 80;
$URL = '/article.php';
$debug = true;
print "Updating the article in the database ...\n";
purgeURL( $hostname, $port, $URL, $debug );
function purgeURL( $hostname, $port, $purgeURL, $debug )
@bogdanr
bogdanr / FuzzyClock.ino
Last active June 5, 2017 21:39
Precise LED clock that can only be imprecisely read
/*
FuzzyClock is a precise LED clock that can only be imprecisely read.
Bogdan Radulescu <bogdan@nimblex.net>
License: Apache License v2
*/
#include <ESP8266WiFi.h> // This one comes with the boards manager import
#include <NTPtimeESP.h> // Get it from https://github.com/SensorsIot/NTPtimeESP
#include <Adafruit_NeoPixel.h> // Get it from https://github.com/adafruit/Adafruit_NeoPixel
#include <ArduinoJson.h> // Get it from https://github.com/bblanchon/ArduinoJson
@bogdanr
bogdanr / config
Created April 1, 2016 09:16
zen-kernel 4.5 config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.5.0 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
@bogdanr
bogdanr / ACPI
Last active April 3, 2016 19:47
Goodix info
nimblex:~# cat /sys/bus/acpi/devices/GDIX1001\:00/status
15
nimblex:~# cat /sys/bus/acpi/devices/GDIX1001\:00/uevent
MODALIAS=acpi:GDIX1001:GDIX1001:
nimblex:~# cat /sys/bus/acpi/devices/GDIX1001\:00/adr
0x00000000
nimblex:~# cat /sys/bus/acpi/devices/GDIX1001\:00/power_state
@bogdanr
bogdanr / teclast.html
Created February 12, 2016 07:14
lshw Teclast X2
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="lshw-B.02.17" />
<style type="text/css">
.first {font-weight: bold; margin-left: none; padding-right: 1em;vertical-align: top; }
.second {padding-left: 1em; width: 100%; vertical-align: center; }
.id {font-family: monospace;}
@bogdanr
bogdanr / gist:59297a484f0ec8211a35
Created February 5, 2016 09:30
Kill long running processes in RDS
mysql -h __some_host__ -p __some_pass__ -r -s -e "select concat('CALL mysql.rds_kill(',id,');') from information_schema.processlist where command='Sleep' and time > 200;" > aaa.sql
@bogdanr
bogdanr / squid.conf
Created May 25, 2015 06:52
Squid.conf SSL transparent proxy
visible_hostname vm-gateway
#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.10.10.0/24
acl localnet src 127.0.0.1