Skip to content

Instantly share code, notes, and snippets.

{{- if . }}
{{- range . }}
<h3>Target <code>{{ escapeXML .Target }}</code></h3>
{{- if (eq (len .Vulnerabilities) 0) }}
<h4>No Vulnerabilities found</h4>
{{- else }}
<h4>Vulnerabilities ({{ len .Vulnerabilities }})</h4>
<table>
<tr>
<th>Package</th>
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: test-eks
region: us-east-1
version: "1.25"
vpc:
subnets:
private:
@zawyelwin
zawyelwin / amazon-eks-vpc-private-subnets.yaml
Created February 13, 2023 16:53
CloudFormation Template for Amazon EKS VPC - Private and Public subnets
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS Sample VPC - Private and Public subnets'
Parameters:
VpcBlock:
Type: String
Default: 10.0.0.0/16
Description: The CIDR range for the VPC. This should be a valid private (RFC 1918) CIDR range.
@zawyelwin
zawyelwin / remove-last-commit.md
Last active September 20, 2021 05:53
Remove last commit from remote git repository

Be careful that this will create an "alternate reality" for people who have already fetch/pulled/cloned from the remote repository. But in fact, it's quite simple:

git reset HEAD^ # remove commit locally
git push origin +HEAD # force-push the new HEAD commit

If you want to still have it in your local repository and only remove it from the remote, then you can use:

@zawyelwin
zawyelwin / .dockerignore
Created September 18, 2021 20:27
Simple Laravel Docker Deployment
bootstrap/cache/services.php
storage/app/*
storage/framework/cache/*
storage/framework/sessions/*
storage/framework/views/*
storage/logs/*
vendor/
@zawyelwin
zawyelwin / laravel-deploy.md
Last active August 10, 2023 08:25
Deploy a Laravel app properly.

Add a user to the server and append the user to the sudo group. You can verify the user is in the sudo group using id <username> command.

adduser <username>
usrmod -aG sudo <username>

Install Ngxin MySql PHP and necessary extensions for Laravel.

sudo apt update
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
@zawyelwin
zawyelwin / az_acr_import.sh
Created February 24, 2021 05:10
Script to import azure container registry images with tags to another azure container registry.
#!/bin/bash
registryName='<REGISTRY_NAME>'
repository=("apm/pinpoint-agent", "apm/pinpoint-collector")
sourceAcrName="<SOURCE_ACR_NAME>"
destAcrName="<DESTINATION_ACR_NAME>"
for repo in "${repository[@]}"
do
tags=$(az acr repository show-tags --name $sourceAcrName --repository $repo | xargs | tr -d '[]\n\r,' )
@zawyelwin
zawyelwin / db_dump.sh
Created February 24, 2021 05:00
Dump all databases without except system databases.
#!/bin/bash
host=<DB_HOST>
password=<DB_PASSWORD>
user=<DB_USER>
database=( $(mysql -h $host -u $user -p$password -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema|mysql|performance_schema|tmp|sys)") )
for db in "${database[@]}"
do
mysqldump -h $host -u $user -p$password $db > $db.sql
stages:
- docker build
docker:image:
stage: docker build
image: docker
when: manual
variables:
DOCKER_HOST: tcp://docker-service.gitlab-managed-apps:2375
DOCKER_DRIVER: overlay2