Skip to content

Instantly share code, notes, and snippets.

View adammelancon's full-sized avatar
🧠
Learnin'

Adam Melancon adammelancon

🧠
Learnin'
View GitHub Profile
@adammelancon
adammelancon / wifi.py
Created July 13, 2023 21:32
A micropython file I drop on microcontrollers to attempt to connect to more than one wifi network.
import network
import time
# List of Wi-Fi SSIDs to try along with passwords.
ssid_list = ['wifi1', 'wifi2']
#If possible, put passwords in a config_secrets.py file.
password_list = ['wifipw1', 'wifipw2']
# password_list = ['wifipw1', ''] # If one is open wifi network.
@adammelancon
adammelancon / kaliax210driver.sh
Last active December 18, 2022 02:41
Get the Intel AX210 wifi card working on kali-linux-2022.3-live-everything-amd64 live iso
#!/bin/bash
# I had to do this to get my AX210 card in my Framework laptop to function on the Kali 2022.3 live everything iso.
# Connect to the internet before running this script so that the firmware can update via apt.
# Remove the broken firmware file.
rm /lib/firmware/iwlwifi-ty-a0-gf-a0.pnvm
# Remove the loaded kernel modules.
rmmod iwlmvm
rmmod iwlwifi
@adammelancon
adammelancon / slimshady.py
Last active August 12, 2021 03:55
Python Lyics - Slim Shady
from os import system, name
hi = "Hi!"
mni = "My name is! "
ss = " Slim Shady "
#function to clear the screen between answers
def clear():
# for windows
if name == 'nt':
#!/usr/bin python
import sys
sys.path.append("/home/pi/git/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCDPlate")
from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate
from time import sleep
lcd = Adafruit_CharLCDPlate()
str_pad = " " * 16
@adammelancon
adammelancon / grabimage.py
Created August 17, 2013 02:59
How to grab a single image from a Foscam camera into a file. Obviously change the username/password combo as well as the IP address.
import urllib
urllib.urlretrieve("http://username:password@192.168.1.100/snapshot.cgi?resolution=32", "/var/www/image.jpg")
@adammelancon
adammelancon / pifacerelayclass.py
Last active December 21, 2015 01:59
A small class I wrote to easily turn on and off the relay on a PiFace for the Raspberry Pi.
import time
import piface.pfio as pfio
pfio.init()
# A class to controll the relay
class Bpress:
def relayon(self):
pfio.digital_write(1,1)
import piface.pfio
import time
import sys
def main(argv):
piface.pfio.init()
cnt = 0
loop = 0
# Launcher
#
# A Simple Launcher in Notification Center
from scene import *
import webbrowser
import notification
class Key (object):
def __init__(self, frame):
@adammelancon
adammelancon / branchpinger.py
Created August 6, 2013 17:50
A simple python script to ping a few branch locations and return the status. It's for the Windows ping command, but could be edited easily for Linux.
import subprocess
import os
branches = {
'192.168.2.1':'Branch1',
'192.168.3.1':'Branch2',
'192.168.9.1':'Branch3',
'192.168.5.1':'Branch4',
'192.168.6.1':'Branch5',
'192.168.12.1':'Branch6',