Skip to content

Instantly share code, notes, and snippets.

Bogdan Rădulescu bogdanr

Block or report user

Report or block bogdanr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bogdanr
bogdanr / Flashlight-fade.ino
Last active Oct 13, 2017
Attiny13 flashlight fade in and out at button press
View Flashlight-fade.ino
#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};
View EnergyMonitor.ino
#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
View WashingMachine.ino
/* 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 Jan 19, 2017
Purge web article from PHP
View purgearticle.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 Jun 5, 2017
Precise LED clock that can only be imprecisely read
View FuzzyClock.ino
/*
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 Apr 1, 2016
zen-kernel 4.5 config
View 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 Apr 3, 2016
Goodix info
View ACPI
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
View teclast.html
<?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 Feb 5, 2016
Kill long running processes in RDS
View gist:59297a484f0ec8211a35
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
Squid.conf SSL transparent proxy
View squid.conf
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
You can’t perform that action at this time.