Skip to content

Instantly share code, notes, and snippets.

View binhqd's full-sized avatar

Binh Quan binhqd

  • Green Global IT Solutions
View GitHub Profile
@binhqd
binhqd / docker-aws.md
Last active July 21, 2023 03:49
Guideline to push docker image to AWS ECR

Tag a local docker

docker tag nal-goaccess:1.0 <account_id>.dkr.ecr.ap-northeast-1.amazonaws.com/goaccess-ubuntu:v1.0

Login

aws ecr get-login-password --profile <aws_profile> --region ap-northeast-1 | docker login --username AWS --password-stdin <account_id>.dkr.ecr.ap-northeast-1.amazonaws.com

Push to ECR

docker push .dkr.ecr.ap-northeast-1.amazonaws.com/goaccess-ubuntu:v1.0

from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
import base64
private_key_path = "<fullpath>/.local/.crypto/id_rsa"
public_key_path = "<fullpath>/.local/.crypto/id_rsa.pub"
public_key = open(public_key_path, 'r')
pub_key = RSA.importKey(public_key.read())
cipher = PKCS1_OAEP.new(pub_key)
@binhqd
binhqd / check-ssl-expiration.sh
Created June 5, 2019 09:01
Check SSL Expiration
echo | openssl s_client -servername www.shellhacks.com -connect kontumtrade.gov.vn:443 2>/dev/null | openssl x509 -noout -dates
@binhqd
binhqd / phrase-classification-initial-data.json
Created May 3, 2019 07:31
phrase-classification-initial-data.json
{
"category":"feeling",
"content_en":"Angry Annoyed Afraid Awkward Affectionate Anxious Alarmed Awed Aggravated Amazed Astonished Amused Apprehensive Absorbed Ambivalent Ashamed Able Addled Admired Admirable Affable Agreeable Aggressive Abandoned Brave Bothered Bewildered Bitter Bashful Blue Baffled Blissful Buoyant Bereaved Bold Cheerful Cooperative Confident Calm Cold Curious Content Considerate Cautious Cranky Crestfallen Contrite Chagrined Carefree Composed Capable Caring Careful Contemptuous Cross Concerned Complacent Charitable Crushed Cantankerous Compulsive Defiant Depressed Discouraged Delighted Disgusted Determined Disappointed Detached Daring Disillusioned Devious Dismayed Disenchanted Doleful Disinterested Disdainful Dismissive Dejected Disengaged Distant Elated Enthusiastic Embarrassed Edgy Excited Envious Exhausted Eager Exuberant Enraged Euphoric Extravagant Ecstatic Eager Emboldened Funny Frightened Fearful Furious Fair Foolish Frustrated Forgiving Flustered Fulfilled Fatigued G
@binhqd
binhqd / phrase-classification.json
Created May 3, 2019 07:30
Mercury Phrase classification
{
"settings": {
"index": {
"analysis": {
"analyzer" : {
"akt_analyzer_pattern_en" : {
"tokenizer" : "akt_pattern_tokernizer_en",
"filter" : [
"synonym_en",
@binhqd
binhqd / elasticsearch-settings-mapping.json
Last active May 3, 2019 07:29
Elasticsearch classification
{
"settings": {
"index": {
"analysis": {
"analyzer" : {
"romaji_analyzer" : {
"tokenizer" : "kuromoji_tokenizer",
"filter" : ["romaji_readingform"]
},
"katakana_analyzer" : {
@binhqd
binhqd / Note for Linux command line (Mercury)
Last active May 4, 2019 01:08
Note for Linux command line (Mercury)
LOAD CSV FROM "file:///cities1.csv" AS csvLine
MERGE (c:City {uuid: csvLine[0]})
ON MATCH SET c.name_ja = csvLine[3];
CALL apoc.export.csv.query("match (c:Country) return c.uuid, c.name_en","/tmp/countries.csv", {});
LOAD CSV FROM "file:///countries-translated.csv" AS csvLine
MERGE (c:Country {uuid: csvLine[0]})
ON MATCH SET c.name_ja = csvLine[2];
@binhqd
binhqd / elasticsearch-settings-mapping.md
Last active April 29, 2019 09:22
ElasticSearch settings & Mapping

PUT /objects

{
  "settings": {
    "similarity": {
      "my_bm25": { 
        "type": "BM25",
        "b":    0 
      }
    },
@binhqd
binhqd / Install Flask with Pandas.md
Created December 6, 2018 10:28
Install Flask with Pandas