Skip to content

Instantly share code, notes, and snippets.

View wgins's full-sized avatar
🤠

Will Ginsberg wgins

🤠
View GitHub Profile
@wgins
wgins / bulk_yaml_to_json.sh
Created September 28, 2019 19:44
yaml to json
# create json dir and convert all .yaml files in current dir to json
# move all .json files into newly created json dir
mkdir json
for file in *.yaml
do
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' < "$file" > "${file/.yaml/.json}"
mv *.json json/
done
@wgins
wgins / function.js
Created February 12, 2019 22:52 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
Verifying my Blockstack ID is secured with the address 16tuD2YFSQNMDGZtfP33M3j5tDEXVLGxpk https://explorer.blockstack.org/address/16tuD2YFSQNMDGZtfP33M3j5tDEXVLGxpk
@wgins
wgins / list_gcp_iprange.sh
Created October 31, 2017 22:39 — forked from n0531m/list_gcp_iprange.sh
Google Cloud Platform : ip address range
#!/bin/bash
# https://cloud.google.com/compute/docs/faq#ipranges
#nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :`
do
dig txt $LINE +short
done | tr " " "\n" | grep ip4 | cut -f 2 -d : | sort -n
@wgins
wgins / mixpanel_profile_export_python3.py
Created January 31, 2017 18:50
Mixpanel Profile Export - Python 3
''' people export'''
import base64
from base64 import b64encode
import csv
import sys
import time
import urllib.request, urllib.parse, urllib.error # for url encoding
import urllib.request, urllib.error, urllib.parse # for sending requests
@wgins
wgins / event_export.py
Last active February 20, 2023 20:17
Example Mixpanel raw event export script Raw
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
#
# Copyright 2010-2013 Mixpanel, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@wgins
wgins / people2csv.py
Last active May 31, 2018 19:05 — forked from marinamixpanel/people2csv.py
Mixpanel - Exporting people profiles to CSV
''' people export'''
import base64
import csv
import sys
import time
import urllib # for url encoding
import urllib2 # for sending requests
try: