Skip to content

Instantly share code, notes, and snippets.

View miawgogo's full-sized avatar
🐧
Processing Gender, Please Wait

nyangogo miawgogo

🐧
Processing Gender, Please Wait
View GitHub Profile
@miawgogo
miawgogo / README.md
Last active April 22, 2021 15:10 — forked from roelentless/README.md
Countdown. REVISED EDITION!!!!

Countdown. REVISED EDITION!!!!

This is a fork of ruleb's count down that rended one of the else ifs unreachable in his code. Even though he was notified by menny people he never fixed his code so i took it on to... fix 1 line of code. This Fork may expand if i have the time to re-learn coffie and see if any outher code is broken.

The rest of this readme and the html code and scss is still the orginal by ruleb.

Description

Simple Dashing widget to countdown until a certain moment. Flashes the widget when finished.

@miawgogo
miawgogo / Password.py
Last active August 29, 2015 14:09
Faux password guessor
import time, sys, os
# this function was taken from stack overflow
def getTerminalSize():
import os
env = os.environ
def ioctl_GWINSZ(fd):
try:
import fcntl, termios, struct, os
cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ,
'1234'))
@miawgogo
miawgogo / gist:61ce47578b80bb794699
Created July 7, 2015 18:59
what i mannaged to do with a lack of sleep
import csv,getpass
from Crypto.Cipher import AES
global ecsv
global uecsv
global passdict
global pwddb
global obj
pwddb=getpass("Enter Database Password:")
IV = 16 * '\x00' #this is a temporey IV until i can work out a good way to generate one
@miawgogo
miawgogo / uptime.py
Created July 10, 2015 14:15
python uptime log
import subprocess, datetime
def writestatus(status):
f=open("uptime", 'a')
if status == True:
string="[" + str(datetime.date.today()) + " " + str(datetime.datetime.now().time()) + "] Site google.co.uk is up \n"
f.write(string)
print string
elif status == False:
string="[" + str(datetime.date.today()) + " " + str(datetime.datetime.now().time()) + "] Site google.co.uk is down \n"
f.write(string)
@miawgogo
miawgogo / gist:6d5d2838b732085d8680
Created August 26, 2015 11:10
Python qrcode example
import qrtools, pyscreeze
img = pyscreeze.screenshot('tempscreen.png')
qr = qrtools.QR()
qr.decode('tempscreen.png')
print qr.data
#Ioan Loosley, CC0
import urllib2
f = open('lastip', "r+")
pubipsite = urllib2.urlopen("http://ipecho.net/plain")
pubip = pubipsite.read()
lastip = f.read()
if pubip != lastip:
#put code here
print "Ip changed to", pubip
f.seek(0)
<-- mtcos (~mtcos@protectedhost-98E6BC0E.residential.rdsnet.ro) has quit (Quit: Konversation terminated!)
<-- ceed^ (~christian@protectedhost-CA708B19.hsd1.ma.comcast.net) has quit (Operation timed out)
<-- louis_ (~louis@protectedhost-68F8034C.adsl.cybercity.dk) has quit (Operation timed out)
--> keyboard-k (~keyboard@283C4975.91DABE98.A8837F20.IP) has joined #jupiterbroadcasting
--> ceed^ (~christian@protectedhost-CA708B19.hsd1.ma.comcast.net) has joined #jupiterbroadcasting
<-- kookieless (~kookieles@protectedhost-39242DCB.chmtny.dsl.dynamic.tds.net) has quit (Ping timeout: 964 seconds)
--> amahoola (~admin@protectedhost-78BEE1DB.cm-6-7d.dynamic.ziggo.nl) has joined #jupiterbroadcasting
--> louis_ (~louis@protectedhost-68F8034C.adsl.cybercity.dk) has joined #jupiterbroadcasting
<-- amahoola (~admin@protectedhost-78BEE1DB.cm-6-7d.dynamic.ziggo.nl) has left #jupiterbroadcasting
--> CTtechguy (~CTtechguy@protectedhost-4DC41321.hfc.comcastbusiness.net) has joined #jupiterbroadcasting
#!/usr/bin/env python3
import socket
import string
from lxml import html
import requests
import json
import urllib.request
from html import unescape
import re
@miawgogo
miawgogo / code and error.py
Last active December 11, 2015 16:44
code and error
def getsunrise(lat="", lng="", formatted=1):
if lat=="" or lng == "":
print "Developer failed to Get lat and long to libary, atempting libary devloper method, uses the internet"
api=urllib2.urlopen("http://freegeoip.net/json/")
lat=str(json.loads(api.read().decode("UTF-8"))["latitude"])
print lat
lng=str(json.loads(api.read().decode("UTF-8"))["longitude"])
sunapi=urllib2.urlopen("http://api.sunrise-sunset.org/json?lat=" + lat + "&lng=" + lng + "&formatted=" + formatted)
return json.loads(sunapi.read().decode("UTF-8"))['results']['sunrise']
@miawgogo
miawgogo / Wifi info
Created December 14, 2015 17:17
Wifi info
IEEE 802.11abgn ESSID:"***"
Mode:Managed Frequency:5.18 GHz Access Point: ***
Bit Rate=150 Mb/s Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=50/70 Signal level=-60 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:166 Missed beacon:0