- What are the default host-level metrics for EC2?
- CPU
- Network
- Disk
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
# Mips program to reverse a string | |
# mips.s | |
.data | |
str: .space 128 # character buffer | |
.text | |
.globl main |
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
(defparameter *nodes* '((balcony (you are on the balcony. a cool wind sways the blossoming trees.)) | |
(lounge-room (a catto snoozes on the lounge.)) | |
(kitchen (bread is proofing on the counter.)) | |
(office (clothes are hung up to dry.)) | |
(bathroom (small stones litter the tiled floor.)) | |
(bedroom (a few articles of clothing lay on the floor.)))) | |
(defparameter *edges* '((balcony (lounge-room inside door)) | |
(lounge-room (balcony outside door) |
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
""" | |
Usage: | |
python sync_db.py | |
""" | |
import os | |
import sys | |
import json | |
import psycopg2 |
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
""" | |
Create a tic-tac-toe board of 'n' width and height. | |
""" | |
import os | |
import sys | |
from typing import List | |
import numpy as np | |
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
def download_file(file_location, output_filename='file.json'): | |
handle = urlopen(file_location) | |
with open('temp.gz', 'wb') as out: | |
while True: | |
data = handle.read(1024) | |
if len(data) == 0: | |
break | |
out.write(data) |
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
FROM alpine:latest | |
RUN apk add --update \ | |
python3 \ | |
python3-dev \ | |
python-dev \ | |
py-pip \ | |
build-base \ | |
bash \ | |
py3-psycopg2 \ | |
gcc musl-dev postgresql-dev \ |
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
// Fahrenheit to Celsius | |
// (F - 32) * (5/9) = C | |
use std::io; | |
fn main() { | |
let mut input = String::new(); | |
io::stdin().read_line(&mut input).unwrap(); |
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
extern crate sqlite; | |
use std::fs::File; | |
use std::io::{BufRead, BufReader}; | |
fn db_connection(db_name: &String) -> sqlite::Connection { | |
let connection = sqlite::open(db_name).unwrap(); | |
connection.execute("CREATE TABLE teas (name text, variety text, last_used date)").unwrap(); |