Skip to content

Instantly share code, notes, and snippets.

View gauravssnl's full-sized avatar
😸
use code::latest ;

GAURAV gauravssnl

😸
use code::latest ;
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## OpenVPN Status File Parser by Greg Armer
## <http://code.geek.sh/2009/07/simple-openvpn-server-statistics/>
STATUS = "/etc/openvpn/openvpn.status"
status_file = open(STATUS, 'r')
stats = status_file.readlines()
@gauravssnl
gauravssnl / form.py
Created December 14, 2016 21:38 — forked from pklaus/form.py
Advanced example for an PyS60 application that makes use of appuifw.app.set_tabs().
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
# Advanced example for an PyS60 application that makes use of appuifw.Form().
# originally found on <http://www.mobilenin.com/pys60/info_tabs_forms.htm>
# changed and adopted for the N95 by Philipp Klaus <philipp.l.klaus AT web-dot-de>
# Copyright (c) 2006 Jurgen Scheible
# This script creates a form
@gauravssnl
gauravssnl / FacebookAutoCommenter.py
Created December 14, 2016 21:40 — forked from riyadparvez/FacebookAutoCommenter.py
This python script auto comment thanks on facebook wall posts
# Thanking everyone who wished me on my birthday
import requests
import json
from time import strftime
AFTER = #convert your time to iso 8601 time
TOKEN = ' <insert token here> '
def get_posts():
@gauravssnl
gauravssnl / PyS60_3rdFP1_accelerometer.py
Created December 14, 2016 21:41 — forked from pklaus/PyS60_3rdFP1_accelerometer.py
PyS60 Accelerometer for 3rd edition (FP1 and FP2+)
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
# originally from Andreas Jakl, 2009 on <http://www.symbianresources.com/tutorials/general/python/Python.pdf>
# modified 2010 by Philipp Klaus <philipp.l.klaus AT web-dot-de>
import appuifw,e32,sensor
def get_sensor_data(status):
@gauravssnl
gauravssnl / babelfish.py
Created December 14, 2016 21:44 — forked from pklaus/babelfish.py
Babelfish Translator for Symbian Phones (using PyS60).
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
# originally from whitetiger on <http://snippets.dzone.com/posts/show/3047>
# modified 2010 by Philipp Klaus <philipp.l.klaus AT web-dot-de>
import urllib
####################################################################################### <BabelFish>
class BabelFish(object):
@gauravssnl
gauravssnl / StatusIcon.py
Created December 14, 2016 21:47 — forked from pklaus/StatusIcon.py
StatusIcon – A Simple 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."
@gauravssnl
gauravssnl / OCS-Pynject.py
Created June 3, 2017 06:55 — forked from adenvt/OCS-Pynject.py
Inject berbasis Python, *Bonus: Payload ISAT
#!/usr/bin/env python
"""
------------------------------------------------------------
Title : OCS Pyn-ject
Author : CyberJutsu
Versi : 127.0.0.1
This Project based of Pinhole Project by Simon Foster
------------------------------------------------------------
"""
@gauravssnl
gauravssnl / config_file.py
Created July 1, 2017 13:09 — forked from twr14152/config_file.py
python ssh script to automate gathering info and pushing configs to Cisco routers and switches
host_conf = ['show ip arp vlan 11', 'show ip arp vlan 12', 'show ip arp vlan 13', 'show ip arp vlan 32', 'show ip arp vlan 50', 'show ip arp vlan 102', 'show ip arp vlan 112', 'show ip arp vlan 145', 'show ip arp vlan 150', 'show ip arp vlan 155', 'show ip arp vlan 160', 'show ip arp vlan 161', 'show ip arp vlan 171', 'show ip arp vlan 172', 'show ip arp vlan 327', 'show ip arp vlan 328', 'show ip arp vlan 331', 'show ip arp vlan 332', 'show ip arp vlan 374', 'show ip arp vlan 380', 'show ip arp vlan 401', 'show ip arp vlan 409', 'show ip arp vlan 433', 'show ip arp vlan 434', 'show ip arp vlan 435', 'show ip arp vlan 436', 'show ip arp vlan 334', 'show ip arp vlan 343', 'show ip arp vlan 403', 'show ip arp vlan 404', 'show ip arp vlan 406', 'show ip arp vlan 447','exit']
# To implement config changes your config would be implemented in list format
# host_conf = ['config t', 'interface lo10', 'description TEST-CONFIG-SCRIPT-3', 'end', 'show run int loop 10']
@gauravssnl
gauravssnl / gist:8b71d9df25c9a462fe0a3347f5b1f534
Created July 1, 2017 13:11 — forked from bortzmeyer/gist:1284249
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
@gauravssnl
gauravssnl / python_over_ssh
Created July 1, 2017 13:15 — forked from mattyjones/python_over_ssh
Execute a script located on a remote server over ssh using python
#! /usr/bin/env python
import secure
import pexpect
# the file containing the list of servers to log into
input_file = "script_list"
# The login creds
user = secure.USER