Skip to content

Instantly share code, notes, and snippets.

View rohitkode's full-sized avatar

Rohit Karajgi rohitkode

  • USA
View GitHub Profile
@benkehoe
benkehoe / LambdaBase.py
Last active October 23, 2023 20:30
Code pattern for implementing class-based AWS Lambda handlers in Python
"""Base class for implementing Lambda handlers as classes.
Used across multiple Lambda functions (included in each zip file).
Add additional features here common to all your Lambdas, like logging."""
class LambdaBase(object):
@classmethod
def get_handler(cls, *args, **kwargs):
def handler(event, context):
return cls(*args, **kwargs).handle(event, context)
return handler
@rohitkode
rohitkode / vpn.sh
Last active January 19, 2017 12:16
Use openconnect to connect to VPN while allowing internet access (works for wireless interface only)
#/bin/bash
##########################################################################
# Uses openconnect to connect to a VPN gateway and ssh into the specified
# remote host as per the arguments passed to the script, and route internet
# traffic through a default gateway.
# Note: The script assumes internet connectivity on the wireless interface
# "usage: ./vpn <remote_user> <remote_host>"
###########################################################################