This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
# Speak Text Requested from an API | |
- Requests a joke from [https://icanhazdadjoke.com](https://icanhazdadjoke.com) | |
- Speaks the joke | |
- Tap `y` to speak another joke | |
*/ | |
// Name: Dad Joke | |
// Description: Dad Joke from icanhazdadjoke.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To start: python3 request_logging_server.py | |
# returns a html page with | |
# 1) is javascript working | |
# 2) request headers | |
# 3) request ip address | |
# scraping this page can help you, when you are debugging if the request is using proxy, cookies, and correct headers | |
# when accessing from the same machine the address would be 0.0.0.0:8004 | |
import http.server | |
import socketserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import struct | |
import sys | |
import json | |
binary_stdin = sys.stdin if sys.version_info < (3, 0) else sys.stdin.buffer | |
binary_stderr = sys.stderr if sys.version_info < (3, 0) else sys.stderr.buffer | |
binary_stdout = sys.stdout if sys.version_info < (3, 0) else sys.stdout.buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import struct | |
import sys | |
import json | |
binary_stdin = sys.stdin if sys.version_info < (3, 0) else sys.stdin.buffer | |
binary_stderr = sys.stderr if sys.version_info < (3, 0) else sys.stderr.buffer | |
binary_stdout = sys.stdout if sys.version_info < (3, 0) else sys.stdout.buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_record/connection_adapters/abstract_mysql_adapter' | |
module ActiveRecord | |
module ConnectionAdapters | |
class AbstractMysqlAdapter | |
alias :old_configure_connection :configure_connection | |
def configure_connection | |
begin | |
execute 'SET RESOURCE GROUP etl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
from_email="[email protected]" | |
to_email="[email protected]" | |
max_estimated_charge_12_hour=$(aws --region us-east-1 cloudwatch get-metric-statistics \ | |
--namespace "AWS/Billing" \ | |
--metric-name "EstimatedCharges" \ | |
--dimension "Name=Currency,Value=USD" \ | |
--start-time $(date +"%Y-%m-%dT%H:%M:00" --date="-12 hours") --end-time $(date +"%Y-%m-%dT%H:%M:00") \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @BatchSize INT = 20000 | |
declare @StartId = 0; | |
declare @MaxId; | |
select @MaxId = max(Id) from [dbo].[SOURCE] . | |
WHILE 1 = 1 | |
BEGIN | |
INSERT INTO [dbo].[Destination] | |
SELECT * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
import sys | |
SPARK_HOME = '/usr/share/dse/spark' | |
import findspark | |
findspark.init(spark_home=SPARK_HOME) | |
import pyspark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> amazon-ebs: Launching a source AWS instance... | |
2017/01/05 17:01:38 ui: amazon-ebs: Instance ID: i-07359bd734cf85429 | |
2017/01/05 17:01:38 ui: ==> amazon-ebs: Waiting for instance (i-07359bd734cf85429) to become ready... | |
amazon-ebs: Instance ID: i-07359bd734cf85429 | |
2017/01/05 17:01:38 packer: 2017/01/05 17:01:38 Waiting for state to become: running | |
2017/01/05 17:01:38 packer: 2017/01/05 17:01:38 Using 2s as polling delay (change with AWS_POLL_DELAY_SECONDS) | |
2017/01/05 17:01:38 packer: 2017/01/05 17:01:38 Allowing 300s to complete (change with AWS_TIMEOUT_SECONDS) | |
==> amazon-ebs: Waiting for instance (i-07359bd734cf85429) to become ready... | |
2017/01/05 17:01:57 ui: amazon-ebs: Public DNS: ec2-54-91-125-146.compute-1.amazonaws.com | |
2017/01/05 17:01:57 ui: amazon-ebs: Public IP: 54.91.125.146 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
import time, sys | |
username = '[email protected]' | |
password = 'xxxxx' | |
driver = webdriver.Chrome() |
NewerOlder