Skip to content

Instantly share code, notes, and snippets.

View aa6my's full-sized avatar
😈
curiosity

aa6mys aa6my

😈
curiosity
View GitHub Profile
@aa6my
aa6my / nginx.conf
Created June 6, 2017 04:11 — forked from khanhicetea/nginx.conf
NginX https redirect ( Cloudflare's flexible ssl )
server {
listen 80;
server_name example.com www.example.com;
if ($http_x_forwarded_proto = "http") {
return 301 https://$server_name$request_uri;
}
... directives to generate a response
}

Source: http://forum.lowyat.net/index.php?showtopic=355950&view=findpost&p=11151482

A few forumers asked me questions regarding reading of MyKad surface information. The answer is there is no encryption; it is just about knowing what (APDU) command to send.

There will be 5 APDU commands that I'll introduce. I name them as:

  • Select Application
  • Get Response
  • Set Length
  • Select Info
@aa6my
aa6my / deploy.prototxt
Created November 1, 2018 17:32 — forked from bogger/deploy.prototxt
GoogLeNet_cars
name: "GoogleNet"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 224
input_dim: 224
# hierarchy 1
# conv -> relu -> pool -> lrn
@aa6my
aa6my / user-data.sh
Created January 25, 2019 10:34 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@aa6my
aa6my / cloudwatch-php-fpm-status.sh
Created May 6, 2019 04:47 — forked from ysasaki/cloudwatch-php-fpm-status.sh
php-fpm status to AWS CloudWatch
#!/bin/bash
AWS_DEFAULT_REGION="ap-northeast-1"
AWS_ACCESS_KEY_ID="YOUR ACCESS KEY HERE"
AWS_SECRET_ACCESS_KEY="YOUR SECRET ACCESS KEY HERE"
INSTANCE_ID_URL="http://169.254.169.254/latest/meta-data/instance-id"
INSTANCE_ID=$(curl -s ${INSTANCE_ID_URL})
SERVER_STATUS_URL="http://localhost/php-fpm-status"
@aa6my
aa6my / jq-cheetsheet.md
Created October 25, 2019 06:43 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@aa6my
aa6my / README.md
Created January 16, 2020 03:37 — forked from simov/README.md
Run `node` scripts using `nvm` and `crontab` without hardcoding the node version

Run node scripts using nvm and crontab without hardcoding the node version

cronjob.env.sh

#!/bin/bash

# NVM needs the ability to modify your current shell session's env vars,
# which is why it's a sourced function
@aa6my
aa6my / dump_route53_records.md
Created April 22, 2020 03:37 — forked from porjo/dump_route53_records.md
Export route53 records to CSV

Retrieve hosted zones with aws route53 list-hosted-zones then enter the zone Id below:

aws route53 list-resource-record-sets --hosted-zone-id "/hostedzone/xxxxxxxxxxx" | \
   jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?]  | @tsv'
@aa6my
aa6my / POSH Stuff
Created May 6, 2020 13:49 — forked from easel/POSH Stuff
Windows Terminal Configuration
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
Then run "notepad $PROFILE" and add these lines to the end:
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox