Skip to content

Instantly share code, notes, and snippets.

View jerynmathew's full-sized avatar

Jeryn Mathew jerynmathew

  • Esper Inc
  • Bangalore, Karnataka, India
View GitHub Profile
@jerynmathew
jerynmathew / test_esper.py
Created May 6, 2020 16:21
Sample EsperClient Code to Push Managed Config to Esper Devices
import esperclient
from esperclient.rest import ApiException
from esperclient.models.v0_command_args import V0CommandArgs as CommandArgs
# Configure API key authorization: apiKey
configuration = esperclient.Configuration()
configuration.host = 'https://<insert your domain here>-api.esper.cloud/api'
configuration.api_key['Authorization'] = '<insert your API Key here>'
configuration.api_key_prefix['Authorization'] = 'Bearer'
@jerynmathew
jerynmathew / pushid.py
Last active August 29, 2015 14:15
Push ID implementation in Python
from datetime import datetime
import time
from random import random
class PushID(object):
# Modeled after base64 web-safe chars, but ordered by ASCII.
PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'
def __init__(self, server_time=0):
@jerynmathew
jerynmathew / logstash_tcp_debug.conf
Last active August 29, 2015 14:04
Logstash conf file with tcp/udp inputs and gives debug outputs and elasticsearch feed.
input {
tcp {
type => "rtfs-tcp"
port => 3334
codec => json {
charset => "UTF-8"
}
}
udp {
type => "rtfs-udp"