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
# Note: Allow Lambda action "execute-api:*" on your AWS API Gateway resources | |
import os | |
import requests | |
from requests_aws4auth import AWS4Auth | |
REGION = 'ap-southeast-2' | |
METHOD = 'POST' | |
SERVICE = 'execute-api' |
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
# First export your APNS P12 cert from the Keychain Access app on your mac | |
# Keychain Access > Certificates > Select cert > right-click > Export as .p12 (passwd optional) | |
# Extract the cert and key from the p12 to use in the pinpoint calls | |
# openssl pkcs12 -in Certificates.p12 -out filename.key -nodes -nocerts | |
# openssl pkcs12 -in Certificates.p12 -clcerts -nokeys -out filename.crt | |
import boto3 | |
APP_ID = "replace with Pinpoint App ID" |
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
git update-index --chmod=+x 'script.sh' |
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 https://docs.aws.amazon.com/iot/latest/developerguide/device-certs-your-own.html | |
## Create a CA | |
openssl genrsa -out rootCA.key 2048 | |
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem | |
## Register you CA with AWS IoT | |
### Get your registration code from: AWS Web Console > AWS IoT Core > Secure > CAs > Register > Register CA |
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
{ | |
"go.formatTool": "gofmt", | |
// the fix is to remove useLanguageServer setting | |
// "go.useLanguageServer": true, | |
} |
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
# /etc/chatscripts/gprs | |
# You can use this script unmodified to connect to cellular networks. | |
# The APN is specified in the peers file as the argument of the -T command | |
# line option of chat(8). | |
# For details about the AT commands involved please consult the relevant | |
# standard: 3GPP TS 27.007 - AT command set for User Equipment (UE). | |
# (http://www.3gpp.org/ftp/Specs/html-info/27007.htm) | |
ABORT BUSY |
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
cd $HOME | |
FileName='go1.12.5.linux-armv6l.tar.gz' | |
wget https://dl.google.com/go/$FileName | |
sudo tar -C /usr/local -xvf $FileName | |
cat >> ~/.bashrc << 'EOF' | |
export GOPATH=$HOME/go | |
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin | |
EOF | |
source ~/.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
import boto3 | |
import time | |
INSTANCE_ID = "REPLACE_WITH_EC2_INSTANCE_ID" | |
SSM_RC_DOC_NAME = "AWS-RunPowerShellScript" | |
CMD_STATUS_SUCCESS = "Success" | |
CMD_WAIT_TIME = 2 | |
CMD = "ipconfig" |
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 botocore.vendored import requests | |
from requests_aws4auth import AWS4Auth | |
import os | |
URL = "https://myurl.com" | |
REGION = 'ap-southeast-2' | |
METHOD = 'GET' | |
SERVICE = 'execute-api' | |
def handler(event, context): |
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 boto3 | |
import time | |
INSTANCE_ID = "REPLACE_ME" | |
USERNAME = "REPLACE_ME" | |
SSM_RC_DOC_NAME = "AWS-RunPowerShellScript" | |
CMD_STATUS_SUCCESS = "Success" | |
CMD_WAIT_TIME = 2 |
OlderNewer