Skip to content

Instantly share code, notes, and snippets.

@abhigkar
abhigkar / extroot.sh
Created August 4, 2023 08:08 — forked from nikescar/extroot.sh
openwrt extroot
#!/bin/sh
# openwrt extroot /dev/sda1 ext4 /dev/sda2 swap
# latest version https://downloads.openwrt.org/releases/19.07-SNAPSHOT/targets/ar71xx/generic/
opkg update
opkg install kmod-usb-storage kmod-scsi-core block-mount kmod-fs-ext4 kmod-usb-uhci e2fsprogs fdisk
echo "
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
14 Response:{"Version1":null,"Version2":null,"Version3":{"NewUrl":"https://www.vphband.com/vph_2/VPH_2_00063300_14.zip","NewVersion":"00.06.33","Version":"06.33","Url":"https://www.vphband.com/vph_2/VPH_2_00063300_14.zip","Type":"zip","DeviceType":"14","Des":"1. The firmware upgrade will take 1-3 minutes.\n2. Before upgrading, ensure that the battery of your mobile phone and the device are both 40% above.\n3. Please do not operate the mobile phone while upgrading, and keep the device and cell phone within 0.2 meters.\n4. The device name will change to DFULang or DFU-52 if the upgrade fails, and the device will maintain upgrade state and the screen can not bright. Please reconnect the device and upgrade again.\n5. If upgrades fail repeatedly, please change a phone to upgrade again, due to the possibility of instability of mobile phone bluetooth. Before that´╝î please switch off the bluetooth of preceding mobile phone.","Size":"71672","NewSize":"71672","MD5":"f98ff19c61ebd0b55b137705ec97540a","NewMD5":"f98ff19c
@abhigkar
abhigkar / i2c-arduino.ino
Created November 2, 2018 12:29 — forked from kenci/i2c-arduino.ino
Sending float array through I2C from Arduino to RPi
#include <Wire.h>
#define SLAVE_ADDRESS 0x04
#define FLOATS_SENT 3
float data[FLOATS_SENT];
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600); // start serial for output
@abhigkar
abhigkar / Attiny85_batteryMonitor.ino
Created October 12, 2018 10:06 — forked from dwhacks/Attiny85_batteryMonitor.ino
Attiny battery monitor with tiny core.
/*
Attiny85_batteryMonitor
Ideas borrowed from: https://github.com/unixbigot/Flat-Mate
modified for arduino tiny core by DWhacks
*@@ Voltage trigger levels.
*
@abhigkar
abhigkar / Nokia_LCD_GUI
Created September 27, 2018 16:27 — forked from godot11/Nokia_LCD_GUI
A basic GUI for the popular Nokia 5110 LCD display in Python. Needs the Adafruit libary for it to work.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# untitled.py
#
# ############################## NOTE #############################
# Though the code below does work, be warned.
# At the time I wrote this code, I was pretty new to Python (and programming
# as such), and I only put it up there for a Stackexchange Code Review question:
# https://codereview.stackexchange.com/questions/132682/pillow-based-basic-gui-library-for-an-lcd
@abhigkar
abhigkar / arduino-draw-8x8-led.cpp
Created September 5, 2018 07:02 — forked from dmccreary/arduino-draw-8x8-led.cpp
Arduino program to draw pixels in an 8x8 LED matrix using multiplexing. This example draws "I", "Heart", "U".
/*
Display "I", "Heart", "U" on a 8 by 8 LED matrix
Dan McCreary, Feb. 14th, 2014
*/
// You can get an red LED matrix for under $5
// Here is a sample: http://www.amazon.com/Common-Anode-Diameter-Display-Matrix/dp/B00EZBZF5K/ref=pd_sim_sbs_e_1
// we are not using pins 0 and 1 and 13
// Connect pins 1-8 (bottom edge) and pins 9-16 (top edge) on the LED matrix
// to the Arduino digital outputpins 2-12 and Analog pins A0 to A3 as outputs
@abhigkar
abhigkar / RPi_I2C_driver.py
Created June 20, 2018 18:30 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
@abhigkar
abhigkar / i2c_scanner.ino
Created December 8, 2017 07:29 — forked from tfeldmann/i2c_scanner.ino
A I2C Scanner for Arduino
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not known.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Captive Portal
var http = require('http');
var Wifi = require('Wifi');
var dgram = require('dgram');
var server = dgram.createSocket('udp4');
var SSID = 'CaptivePortalTest';