Skip to content

Instantly share code, notes, and snippets.

View bonekost's full-sized avatar
🧨

Martin bonekost

🧨
View GitHub Profile
@bonekost
bonekost / iButtonRW.ino
Created October 15, 2017 11:07 — forked from swiftgeek/iButtonRW.ino
RW1990 programmer, with arduino
// Based on https://danman.eu/blog/cloning-ibutton-using-rw1990-and-avr/
// and: http://elimelecsarduinoprojects.blogspot.com/2013/06/read-dallas-ibutton-arduino.html
// By Swift Geek 28-08-2015
// TODO: danger to atmega328! Use OpenCollector logic!
// Used 4.8kΩ Pull-up and 3.1 Vcc for arduino/pull-up
#include <OneWire.h>
OneWire ibutton (8); // I button connected on PIN 2.
@bonekost
bonekost / mysql-docker.sh
Created October 17, 2017 14:57 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@bonekost
bonekost / gist:c3571803644c649c5c066dc0d01a9982
Created February 2, 2018 14:38 — forked from wikimatze/gist:9790374
Github Two-Factor Authentication Failed For HTTPS

I heard from GitHub Two-Factor Authentication](https://github.com/blog/1614-two-factor-authentication) nearly a couple of days ago when I was reading my RSS feed. I enabled it and couldn' push to any of my repositories anymore. Learn in this blog post how to fix it.

Two-Factor Authentication

"Is a process involving two stages to verify the identity of an entity trying to access services in a computer or in a network". Github solves this authentication with sending an SMS to a device which wants to push to their platform.

Enabling Two-Factor Authentication

@bonekost
bonekost / huawei-gsm
Created December 10, 2018 12:13 — forked from imrehg/huawei-gsm
[connection]
id=huawei-gsm
type=gsm
[gsm]
apn=rsaweb.mobi
[ipv4]
dns-search=
method=auto
@bonekost
bonekost / fix_migration.rb
Created March 6, 2019 07:42
Add migration release to all
Dir.glob('./db/migrate/*.rb') do |file|
text = File.read(file)
new_content = text.gsub(/< ActiveRecord::Migration/, "< ActiveRecord::Migration[4.2]")
File.open(file, "w") {|f| f.puts new_content }
end
@bonekost
bonekost / motunit.c
Last active February 16, 2024 21:48
RTOS app for 8 inputs and 8 outputs
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_intr_alloc.h"
#include "esp_log.h"
#define NUM_GPIO_INPUTS 8
#define NUM_GPIO_OUTPUTS 8
#define DEBOUNCE_TIME_MS 50 // Debounce time in milliseconds