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
version: "3.8" | |
services: | |
dynamodb: | |
image: amazon/dynamodb-local:2.3.0 | |
container_name: dynamodb | |
ports: | |
- 8000:8000 | |
command: -jar DynamoDBLocal.jar -dbPath /data -sharedDb | |
volumes: |
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 Foundation | |
struct AnyError: Error { | |
let error: Error | |
init(_ error: Error) { | |
self.error = error | |
} | |
} |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
AMIId: | |
ConstraintDescription: Please choose AMIId | |
Description: Base image id for macOS | |
Type: AWS::EC2::Image::Id | |
KeyName: | |
ConstraintDescription: Must be the name of an existing EC2 KeyPair | |
Type: AWS::EC2::KeyPair::KeyName | |
Resources: |
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 urllib.request import urlopen | |
from bs4 import BeautifulSoup | |
html = urlopen('http://nikkei225jp.com/chart/') | |
soup = BeautifulSoup(html , "html.parser") | |
nikkei = soup.find('div' , class_ = 'if_cur') | |
price = nikkei.string | |
print(price) |
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 bash -e | |
if [[ $(whoami) != "root" ]]; then | |
echo "Must be run as root user." | |
exit 1 | |
fi | |
chmod +w /etc/pam.d/sudo | |
# Insert following text in line 2 | |
# auth sufficient pam_tid.so | |
chmod -w /etc/pam.d/sudo |
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
# pip install pyjwt requests cryptography | |
# and put "app-store-connect-api-key.json" in this script directory | |
import json | |
import time | |
from datetime import datetime, timedelta | |
from pathlib import Path | |
import jwt | |
import requests |
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> | |
<meta charset="utf-8"> | |
<title>画像をある分だけ表示する</title> | |
</head> | |
<body> | |
<?php | |
$count = 0; | |
$files = count(glob("/img/*.jpg")); |
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 -e | |
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_PASS_PHRASE" --output /path/to/output_file /path/to/encrypted_file |
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 -eu | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get install -y git build-essential libffi-dev libssl-dev zlib1g-dev liblzma-dev libbz2-dev libreadline-dev libsqlite3-dev | |
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc |
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
class custom_profile(object): | |
def __init__(self, name=None, _dynamic=False): | |
super().__init__() | |
def __new__(cls, *args, **kwargs): | |
try: | |
from silk.profiling.profiler import silk_profile | |
except ImportError: | |
class silk_profile(object): |
NewerOlder