Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐧 🗡️ 💻

Milan Thapa thapakazi

💭
🐧 🗡️ 💻
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am thapakazi on github.
  • I am thapakazi (https://keybase.io/thapakazi) on keybase.
  • I have a public key whose fingerprint is D960 A6D6 BEC6 E198 1393 BFAB 00F2 8320 44FF 5DE8

To claim this, I am signing this object:

@thapakazi
thapakazi / postgres-cheatsheet.md
Created Dec 24, 2021 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@thapakazi
thapakazi / security_groups_for_pods_todo.md
Created Aug 19, 2021
security_groups_for_pods_todo.md
View security_groups_for_pods_todo.md
@thapakazi
thapakazi / main.tf
Created Jul 5, 2021 — forked from syntaqx/main.tf
Terraform Generate Self-Signed Certificate Files (Nginx+)
View main.tf
resource "tls_private_key" "ca" {
algorithm = "RSA"
}
resource "tls_self_signed_cert" "ca" {
key_algorithm = "RSA"
private_key_pem = "${tls_private_key.ca.private_key_pem}"
subject {
common_name = "${var.domain}"
@thapakazi
thapakazi / session_manager_simplified.org
Created May 6, 2021
Session Manager / Use and configuration
View session_manager_simplified.org

Session Manager - Simplified

  • Alternative login to your ec2 instances via session manager
    • Make sure you are using vm with session manager installed
    • Your instance is attached with a iam role that has following policy attached:
      • policy_arn = “arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore”
@thapakazi
thapakazi / CreateLambdaFunctionIAMRolePolicy.json
Created May 4, 2021
Necessary IAM policy to allow creation of lambda function
View CreateLambdaFunctionIAMRolePolicy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iam:CreatePolicy",
"iam:CreateRole",
"iam:AttachRolePolicy"
View Makefile
install:
ln -s $PWD/librespeed-cli.service ~/.config/systemd/user/librespeed-cli.service
systemctl --user enable librespeed-cli.service
systemctl --user start librespeed-cli.service
re-install:
systemctl --user daemon-reload
systemctl --user restart librespeed-cli.service
View xps15
xps
description: Notebook
product: XPS 15 7590 (0905)
vendor: Dell Inc.
serial: 2K14DB3
width: 64 bits
capabilities: smbios-3.2.0 dmi-3.2.0 smp vsyscall32
configuration: boot=normal chassis=notebook family=XPS sku=0905 uuid=44454C4C-4B00-1031-8034-B2C04F444233
*-core
description: Motherboard
View meetup.tf
variable date {}
variable url {}
meetup "terraform_tidbits" {
date = var.date
url = var.url
title = "Terraform Practical Tit-Bits"
description = "In this session we will explore some of the common practical tit-bits of using terraform. If you are having difficulties collaborating with your friends/co-workers due to hassles of state file management, dealing with 10s of secrets/variables, managing different infra environments; well, this session is just for you."
}
@thapakazi
thapakazi / Readme.md
Last active Jan 29, 2021
simple nginx pod mounting custom config file
View Readme.md
    #create config map
    curl -sL https://git.io/Jt80f  > /tmp/site.conf
    kubectl create cm nginx-config --from-file=/tmp/site.conf -o yaml --dry-run=client
    
    #lets see it in action, will ya ? 
    kubectl create cm nginx-config --from-file=/tmp/site.conf 
    
    kubectl apply -f https://git.io/Jt8uz