Skip to content

Instantly share code, notes, and snippets.

View ferndot's full-sized avatar

Fern (they/them) ferndot

  • Seattle, WA, USA
  • 21:48 (UTC -07:00)
View GitHub Profile
from scapy.all import *
import requests
import time
MAGIC_FORM_URL = 'http://put-your-url-here'
def record_poop():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
"Measurement": 'Poopy Diaper'
}
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active December 12, 2023 17:47
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
#!/bin/bash
#
# Automate mysql secure installation for debian-baed systems
#
# - You can set a password for root accounts.
# - You can remove root accounts that are accessible from outside the local host.
# - You can remove anonymous-user accounts.
# - You can remove the test database (which by default can be accessed by all users, even anonymous users),
# and privileges that permit anyone to access databases with names that start with test_.
@property
def _dict(self):
from django.db.models.query_utils import DeferredAttribute
exclude = [f.name for f in self._meta.fields if
isinstance(self.__class__.__dict__.get(f.attname),
DeferredAttribute)]
return model_to_dict(self, fields=[field.name for field in
self._meta.fields], exclude=exclude)
@Mte90
Mte90 / ffos-check
Last active July 13, 2018 20:45
Check Firefox OS version
function getVersion() {
if (navigator.userAgent.match(/(mobile|tablet)/i)) {
var ffVersionArray = (navigator.userAgent.match(/Firefox\/([\d]+\.[\w]?\.?[\w]+)/));
if (ffVersionArray.length === 2) {
//Check with the gecko version the Firefox OS version
//Table https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference
var hashVersion = {
'18.0': '1.0.1',
'18.1': '1.1',
'26.0': '1.2',