Skip to content

Instantly share code, notes, and snippets.

View kamilion's full-sized avatar

Kamilion kamilion

View GitHub Profile
@kamilion
kamilion / utelnet.py
Created November 1, 2018 04:02
A failure of a telnet client.
# telnet program example
import socket, select, sys, _thread
class uTelnet:
# Automatically initialized class variables
# Status variables
connected = False
last_response = ""
# Class methods
from machine import Pin, ADC
# Time to wait for bounce in MICROseconds
od_debounce = 6000 # 6 milliseconds
# Time to wait for button to be held in MICROseconds
od_hold = 50000 # 50 milliseconds
# Battery status
od_batt = ADC(36)
od_batt.atten(ADC.ATTN_11DB)
#!/usr/bin/env micropython
__author__ = 'Kamilion@gmail.com'
import socket
import sys
import _thread
class uPyIRC:
# Automatically initialized class variables
# Status variables
@kamilion
kamilion / main.py
Last active August 25, 2018 09:31
universal wireless manager for micropython
import gc, network, uos, os, machine, json, time, sys, micropython, display
# Start display using the Odroid-GO pins.
#tft=display.TFT()
#tft.init(tft.ILI9341, width=240, height=320, miso=19, clk=18, mosi=23, dc=21, cs=5, backl_pin=14, backl_on=1, rot=tft.LANDSCAPE_FLIP)
# Mount SD using Odroid-GO pins...
uos.sdconfig(uos.SDMODE_SPI, clk=18, mosi=23, miso=19, cs=22)
os.mountsd()
@kamilion
kamilion / fix-virt-adapters.ps1
Last active June 13, 2018 23:32 — forked from gschizas/FixVirtualNetworkAdapters.ps1
This powershell script will look for most virtualization and loopback adapters that may be marked "Unidentified" in MS Network and Sharing Center, and makes them disappear.
# see http://msdn2.microsoft.com/en-us/library/bb201634.aspx
#
# *NdisDeviceType
#
# The type of the device. The default value is zero, which indicates a standard
# networking device that connects to a network.
#
# Set *NdisDeviceType to NDIS_DEVICE_TYPE_ENDPOINT (1) if this device is an
# endpoint device and is not a true network interface that connects to a network.
# For example, you must specify NDIS_DEVICE_TYPE_ENDPOINT for devices such as
"""
Quick Status on TFT
Author: Kamilion (https://github.com/kamilion)
Date: 03/04/2018
"""
import machine, display, time, _thread, math, network
@kamilion
kamilion / smartcam.txt
Created December 16, 2017 13:07
Kamilion's Smartcam project, Dec 2014
Kamilion's SmartCam project:
Cost per unit Quantity 1: $100.77 + S&H
Most component modules can be obtained at a discount for quantity 3 or quantity 10+.
I estimate a purchase of 12 units would end up to be around $1200 with discounts and adding S&H.
Revised 12/22/14 from China quotes:
@kamilion
kamilion / ESP32-Pinout-Notes.txt
Created December 10, 2017 11:50
ESP32 Pinout notes for making a breakout module on a dual row IDC header
ESP32 Pinout notes:
What is superflous or can be on the carrier PCB and doesn't require pass-through to the header?
---------------------------------------------------------------------------------------------
After some thinking and logically grouping things...
Desired order of 26 pin header:
pin 1 -Y GND - Ground
pin 6 ?Y GPIO-34 - ADC6/RTC_GPIO4 (RTC_WAKEUP)
pin 7 ?Y GPIO-35 - ADC7/RTC_GPIO5 (RTC_WAKEUP) (FTDI CTS unless there's a better pin?)
pin25 -Y GPIO-00 - ADC11/Touch1/BOOT/EMAC_TX_CLK/RMII_CLK_OUT (default pullup)
@kamilion
kamilion / 2015-07-15-securing-golang-web-apps.md
Created March 1, 2017 04:53 — forked from dchest/2015-07-15-securing-golang-web-apps.md
Securing Go web applications (archived post from StableLib blog)

Securing Go web applications

There are lots of security-related things to keep in mind when writing a web application, as the Web is a place full of danger: cross-site scripting (XSS), cross-site request forgery (CSRF), clickjacking, brute forcing, spam and so on.

Go gets many things right by default: for example, templates from the standard library make it hard to accidentally introduce XSS vulnerabilities. But what about other attacks? Fortunately, there are a few open source Go packages

@kamilion
kamilion / admin.py
Last active April 11, 2016 22:53
django/mezzanine/cartridge and shippingness
# Dis goes in kamicart/admin.py
# To enable this, append to INSTALLED_APPS:
# "m3shop.kamicart",
# You need the comma at the end too.
# Now add to EXTRA_MODEL_FIELDS
#EXTRA_MODEL_FIELDS = (
# (
# "cartridge.shop.models.Product.weight_shipping",
# "DecimalField",