Skip to content

Instantly share code, notes, and snippets.

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

Ceri Loosley miawgogo

🐧
Processing Gender, Please Wait
View GitHub Profile
@miawgogo
miawgogo / randombsd.py
Created September 27, 2016 12:15
Selects a random BSD now episode from the RSS Feed
import feedparser, random, os
d = feedparser.parse("https://feeds.feedburner.com/BsdNowMp3")
episodes = d.entries
show = random.choice(episodes).enclosures[0]
os.system("mpv " + show['href'])
@miawgogo
miawgogo / alarm.py
Created September 21, 2016 20:33
simple python alarm clock
# A simple python alarm clock
# example: python alarm.py [time in 24h with :] [music file]
# example: python alarm.py "6:30" "Trollenn.mp3"
import time, os, sys
ctime = time.strftime("%H:%M")
print(ctime)
while ctime != sys.argv[1]:
ctime = time.strftime("%H,%M")
@miawgogo
miawgogo / Fix.css
Last active August 25, 2016 22:09
there fixed
/*Put this in the child theme or what ever your using's css*/
#videoembed a {
color: whitesmoke;
}
if e.code == 404:
say("Bitcoin Average does not have any data on that currency")
elif e.code == 500:
say("bitcoinaverage.com had a server error")
else:
say("I got a " + str(e.code) + " from the server")
#!/bin/bash
wget -O 10_resume_wifi https://gist.githubusercontent.com/ioangogo/389f0ff730e3c7a97351b2de3a629352/raw/55976b1c36a9ce06efc035097525ef13189b75c2/10_resume_wifi
read -p "Do you want to read the bash script that has just being downloaded and run it:[Y/N] " yn
case $yn in
[Yy]* ) nano 10_resume_wifi;;
[Nn]* ) echo "OK Its your system";;
esac
sudo bash -c "mv 10_resume_wifi /etc/pm/sleep.d/10_resume_wifi"
sudo bash -c "chmod +x /etc/pm/sleep.d/10_resume_wifi"
#!/bin/sh
case "${1}" in
resume|thaw)
service network-manager restart;;
esac
@miawgogo
miawgogo / Ioans Protips.md
Last active April 6, 2016 22:12
A list of pro tips by ioan
  1. If you need a product key for a windows 8+ device as it didnt come with one and you do not want to download random tools, you can find it in a linux livecd by typing sudo less /sys/firmware/acpi/tables/MSDN in the terminal
import subprocess
cmd = 'irsend LIST "" ""'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
tmp = proc.stdout.read()
print tmp
ntmp = tmp.replace("irsend: ", "")
device = ntmp.split("\r\n")
def eightball(info,usrs):
responses = ["It is certain","It is decidedly so","Without a doubt","Yes"," definitely","As I see it"," yes","Most likely","Outlook good","Yes","Signs point to yes","Reply hazy try again","Ask again later","Better not tell you now","Cannot predict now","Concentrate and ask again","Don't count on it","My reply is no","My sources say no","Outlook not so good","Very doubtful"]
msg = random.choice(responses)
say(msg)
"""
Traceback (most recent call last):
File "C:\Python34\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "C:\Python34\lib\multiprocessing\pool.py", line 44, in mapstar
return list(map(*args))
File "C:\Python34\lib\site-packages\himawaripy-1.1-py3.4.egg\himawaripy\himawaripy.py", line 56, in download_chunk
with counter.get_lock():
AttributeError: 'NoneType' object has no attribute 'get_lock'
"""