This file contains hidden or 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 | |
import boto3 | |
from time import sleep | |
from concurrent.futures import ProcessPoolExecutor, wait, as_completed | |
def get_asg_instances(asg_name): | |
''' | |
Responds with list of instance dictionaries that provides the following | |
:InstanceId - instance id |
This file contains hidden or 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 python3 | |
from invoke import task | |
@task | |
def clean(ctx): | |
print("Cleaning!") | |
ctx.run("sudo apt-get clean all") | |
print("Cleaning Done.") | |
@task |
This file contains hidden or 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 "http/client" | |
require "option_parser" | |
require "logger" | |
destination = "changeme" | |
help = "" | |
log = Logger.new(STDOUT) | |
log.level = Logger::INFO |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
"github.com/sendgrid/rest" | |
) | |
func main() { | |
// var |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/alecthomas/chroma/quick" | |
) | |
func main() { | |
my_code := `package main |
This file contains hidden or 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
package main | |
import ( | |
"os" | |
"log" | |
"gopkg.in/zorkian/go-datadog-api.v2" | |
) | |
func main() { | |
// Get api and app key from environment var |
This file contains hidden or 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 | |
import requests | |
my_urls = [ | |
'https://google.com/', | |
'https://youtube.com/', | |
'https://facebook.com/', | |
'https://wikipedia.org/', | |
'https://yahoo.com/', | |
'https://reddit.com/', |
This file contains hidden or 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
{ | |
"signing": { | |
"default": { | |
"expiry": "17520h" | |
}, | |
"profiles": { | |
"2yr-server": { | |
"expiry": "17520h", | |
"usages": [ | |
"signing", |
This file contains hidden or 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 datadog import statsd | |
import requests | |
import time | |
def get_endpoint_status(url): | |
response = requests.get(url) | |
resp_time_miliseconds = response.elapsed.microseconds / 1000 | |
result = {'status_code': response.status_code, 'response_time': resp_time_miliseconds} | |
return result |
This file contains hidden or 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 python3 | |
from sklearn import tree | |
################### | |
## Texture | |
# smooth = 1 | |
# bumpy = 0 | |
## label | |
# apple = 0 | |
# orange = 1 | |
################## |