Skip to content

Instantly share code, notes, and snippets.

View winny-'s full-sized avatar
๐Ÿ‘‹
***status goes here***

Winston (Winny) Weinert winny-

๐Ÿ‘‹
***status goes here***
View GitHub Profile
function ssh_username_hostname() {
if [[ -n "$SSH_CONNECTION" ]]; then
echo "%{$fg_bold[yellow]%}%m "
fi
}
local ret_status="%(?:%{$fg_bold[green]%}โžœ :%{$fg_bold[red]%}โžœ %s)"
PROMPT='${ret_status}%{$fg_bold[green]%}%p $(ssh_username_hostname)%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@winny-
winny- / hi.md
Last active August 29, 2015 14:02

If you have an <a> element with attribute href set to an URI without the //, weird things happenโ€ฆ

  • Scheme is different from base URI's scheme.
  • Parsed as scheme followed by hostname.
@winny-
winny- / control_playback_in_skype_call.py
Last active August 29, 2015 14:03
Play/pause Hermes when in a skype call. See this issue for details on usage: https://github.com/HermesApp/Hermes/issues/183 remote.applescript is based off of: https://github.com/winny-/HermesRemote/blob/master/api/_scripts/status.applescript
#!/usr/bin/env python
import Skype4Py
import subprocess
import time
import sys
import argparse
#!/usr/bin/env python
import dbus
def playpausepithos():
session_bus = dbus.SessionBus()
k = session_bus.get_object('net.kevinmehall.Pithos', '/net/kevinmehall/Pithos')
k.PlayPause()

0. yum update

yum update

1. create groups for sudo and ssh

groupadd --system sudo
groupadd --system ssh
#!/usr/bin/env python3
def duration_to_hours(duration):
if duration.isdigit():
# Default to minutes
return float(duration) / 60.0
def get_unit(unit):
nonlocal duration
if unit in duration:
@winny-
winny- / iplookup.py
Last active August 29, 2015 14:04
ipv4 only
#!/usr/bin/env python
import socket
import sys
def main(host):
exit_code = 0
try:
# This is a work-around for socket.gethostbyname() causing KeyboardInterrupt to be uncatchable.
# From: https://mail.python.org/pipermail/python-bugs-list/2007-July/039118.html
00000000 68 74 74 70 3a 2f 2f 67 6f 6f 67 6c 65 03 31 2c |http://google.1,|
00000010 31 2e 63 6f 6d 2f 0a |1.com/.|
00000017
#!/bin/sh
# Based off of https://superuser.com/questions/433316/check-a-list-of-domains-with-the-whois-command
while read domain; do
printf '%s ' "$domain" # This way we know what whois is currently looking up before it completes.
whois "$domain" | grep -qci 'No Match'
if [ $? -ne 0 ]; then echo "REGISTERED"; else echo "AVAILABLE"; fi
done
#!/usr/bin/env python3
import pithos.pandora as pandora
import pithos.pandora.data as pdata
from getpass import getpass
from pprint import pprint
p = pandora.Pandora()
p.set_audio_quality(pdata.default_audio_quality)