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 base64 | |
import sys | |
def decode_and_convert_to_hex(encoded_str): | |
# Decode from Base64 to bytes | |
decoded_bytes = base64.b64decode(encoded_str) | |
# Convert bytes to hexadecimal | |
hex_string = decoded_bytes.hex() |
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
2018/08/16 23:39:34 [INFO] Terraform version: 0.11.8 7a5c1d221ac209bbac66947c369815cd9ca70ed5 | |
2018/08/16 23:39:34 [INFO] Go runtime version: go1.10.1 | |
2018/08/16 23:39:34 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"} | |
2018/08/16 23:39:34 [DEBUG] Attempting to open CLI config file: /Users/Kengo/.terraformrc | |
2018/08/16 23:39:34 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2018/08/16 23:39:34 [INFO] CLI command args: []string{"apply"} | |
2018/08/16 23:39:34 [INFO] command: empty terraform config, returning nil | |
2018/08/16 23:39:34 [DEBUG] command: no data state file found for backend config | |
2018/08/16 23:39:34 [DEBUG] New state was assigned lineage "72c72196-5c35-d089-be74-f04f4162082e" | |
2018/08/16 23:39:34 [INFO] command: backend initialized: <nil> |
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 | |
### | |
# Updates a pre-configured Amazon EC2 Container Service (ECS) cluster. | |
# | |
# Build a docker image in CWD, tag it and push it to hub.docker.com. | |
# Then Update an ECS services to run that newly available images. | |
# | |
# This script receives as a input a filename (Relative to this directory). | |
# | |
# That file must set the following Environment variables . |
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
func PadByPkcs7(data []byte) []byte { | |
padSize := aes.BlockSize | |
if len(data) % aes.BlockSize != 0 { | |
padSize = aes.BlockSize - (len(data)) % aes.BlockSize | |
} | |
pad := bytes.Repeat([]byte{byte(padSize)}, padSize) | |
return append(data, pad...) // Dots represent it unpack Slice(pad) into individual bytes | |
} |
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
func EncryptByCBCMode(key []byte, plainText string) ([]byte, error) { | |
if len(plainText) % aes.BlockSize != 0 { | |
panic("Plain text must be multiple of 128bit") | |
} | |
block, err := aes.NewCipher(key); if err != nil { | |
return nil, err | |
} | |
cipherText := make([]byte, aes.BlockSize + len(plainText)) // 初期化ベクトルを保存するためにaes.BlockSizeを加えている |
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 | |
sudo /opt/google-cloud-sdk/bin/gcloud docker push asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:latest | |
if [[ "$CIRCLE_TAG" =~ v[0-9]+(\.[0-9]+)* ]]; then | |
docker tag asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:$CIRCLE_SHA1 asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:${CIRCLE_TAG} | |
sudo /opt/google-cloud-sdk/bin/gcloud docker push asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:$CIRCLE_TAG | |
fi |
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
package main | |
import ( | |
"archive/zip" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"path/filepath" | |
) |
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
root@vbox86p:/data/misc/keystore/user_0 # ls -l | |
-rw------- keystore keystore 788 2016-02-21 13:15 10091_USRCERT_hogehoge | |
-rw------- keystore keystore 1252 2016-02-21 13:15 10091_USRPKEY_hogehoge <-------秘密鍵 |
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
h = activate_function(z) | |
grad = 1 / m * (X'*(h-y)) |
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
VBoxManage list vms | grep -i 'APIのバージョンやデバイス名' | head -1 | perl -ple 's/^.*\{(.*)\}/$1/g;' | xargs /Applications/Genymotion.app/Contents/MacOS/player --vm-name & |
NewerOlder