Skip to content

Instantly share code, notes, and snippets.

@jrosco
jrosco / active_ip_scanner.sh
Last active August 29, 2015 13:55
Scan your network for a range of active ip adresses (change setting inside script)
#!/bin/bash
COUNT=0
MIN_IP_ADDRESS=1
CLASS=192.168.1
MAX_IP_ADDRESS=10
CONNECTION_TIMEOUT=1
HOSTNAME=$(hostname)
printf "_______________________________________________\n\n"
@jrosco
jrosco / testing_.serverlist.xml
Created March 13, 2014 10:15
mwhois test scripts
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE serverlist SYSTEM "serverlist.dtd">
<serverlist size="335">
<notes>
This list is generated by http://www.domaininformation.de.
If you want to use this list automatically
you have to visit http://www.domaininformation.de/xml-serverlist.html
and follow the using terms.
import wx
import glob
""" Example at http://zetcode.com/wxpython/skeletons/ """
class DemoFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "wx.ListCtrl in wx.LC_REPORT mode", size=(600, 400))
__author__ = 'jrosco'
# Import smtplib for the actual sending function
import smtplib
# Import the email modules we'll need
from email.mime.text import MIMEText
textfile = '../files/test'
@jrosco
jrosco / wx_multi_tab.py
Created March 20, 2014 03:55
wxpython multi tab example
import wx
""" Copied for m http://wiki.wxpython.org/Simple%20wx.Notebook%20Example """
class PageOne(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
wx.StaticText(self, -1, "This is a PageOne object", (20,20))
@jrosco
jrosco / One liners
Last active August 29, 2015 14:06
Oneliners
perl -i -pe 's{^#!/bin/sh}{#!/bin/bash}' /path/to/file
#!/usr/bin/env python
#http://www.wxpython.org/docs/api/wx.lib.combotreebox-module.html#ComboTreeBox
from wx.lib.combotreebox import ComboTreeBox
import wx
class MyFrame(wx.Frame):
#!/bin/bash
# Uses a PID file to add daemon-like behavior to an arbitrary program.
################################################################################
usage() {
echo "Usage: `basename $0` PROGRAM {start|stop|restart|force-stop|force-restart|status} [PIDFILE|PID]" >&2
echo "Where: PROGRAM is an executable file." >&2
echo " PIDFILE is the file that contains (or will contain) the PID." >&2
echo " PID is a process id to use in place of a PIDFILE." >&2
}
@jrosco
jrosco / StatusIcon.py
Last active May 23, 2016 12:57 — forked from pklaus/StatusIcon.py
tray icon application using PyGTK
#!/usr/bin/env python
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000>
# simple example of a tray icon application using PyGTK
import gtk
def message(data=None):
"Function to display messages to the user."
@jrosco
jrosco / gist:c7369a651343ea622e4d
Created January 9, 2015 05:33
Get and Set IconFile via DBUS
#!/usr/bin/env python
import dbus
import os
import pwd
user_id = pwd.getpwuid(os.getuid()).pw_uid
icon_file = '/home/jrosco/.face'
bus = dbus.SystemBus()