# Run
docker run -d --name redis -p 6379:6379 redis
# Stop
docker stop redis
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: | |
// node httprint.mjs [PORT] | |
// | |
// The default port is 3000. | |
// Prints to stdout the request method, url, headers and body. | |
// Always returns 200 with an empty JSON object as the body and application/json as the content type. | |
import { createServer } from "node:http"; | |
const port = process.argv[2] || 3000; |
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
# Source this file to use | |
_podget() { | |
kubectl --namespace $NS get pods | |
} | |
_podnames() { | |
_podget | tail -n +2 | cut -d " " -f1 | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>FastAPI - ReDoc</title> | |
<!-- needed for adaptive design --> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet"> |
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 get_region_name(): | |
from urllib import request, error | |
me = get_region_name | |
if hasattr(me, 'cache'): | |
return me.cache | |
try: | |
with request.urlopen("http://169.254.169.254/latest/meta-data/placement/region", timeout=1) as res: | |
me.cache = res.read().decode().strip() |
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 python3 | |
import boto3 | |
import time | |
from pprint import pprint | |
import json | |
import sys | |
client = boto3.client('kinesis') |
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
Country | WIFI | 2G | 3G | 4G | |
---|---|---|---|---|---|
AD | 3500 | 148 | 2200 | 5300 | |
AE | 3500 | 95 | 490 | 690 | |
AF | 470 | 95 | 810 | 1400 | |
AG | 1100 | 148 | 2200 | 3200 | |
AI | 3500 | 200 | 2200 | 1400 | |
AL | 3500 | 132 | 2200 | 3200 | |
AM | 2000 | 132 | 970 | 2000 | |
AO | 1100 | 95 | 970 | 5300 | |
AR | 2000 | 115 | 970 | 2000 |
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
testing |
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/bash | |
# Assuming jq (https://stedolan.github.io/jq/) and curl are installed. | |
# Show only the entries for region = us-east-1 and service = API_GATEWAY. | |
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq --raw-output '.prefixes[] | select(.region=="us-east-1" and .service=="API_GATEWAY") | .ip_prefix' | |
<< //// | |
Output (2022/12/01): | |
3.216.135.0/24 | |
3.216.136.0/21 | |
3.216.144.0/23 |
NewerOlder