Skip to content

Instantly share code, notes, and snippets.

View dinushchathurya's full-sized avatar
:octocat:
Coding

Dinush Chathurya dinushchathurya

:octocat:
Coding
View GitHub Profile
apiVersion: v1
kind: ServiceAccount
metadata:
name: tekton-triggers-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: tekton-triggers-example-minimal
rules:
apiVersion: v1
kind: List
items:
- apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argo-rollouts
labels:
type: infrastructure
spec:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install node
node -e "console.log('Running Node.js ' + process.version)"
@dinushchathurya
dinushchathurya / Deploy NodeJS using GitLab CI-CD
Created April 23, 2022 02:41
Deploy NodeJS using GitLab CI-CD
Deploy nodejs app with gitlab.com and pm2
=========================================
This manual is about setting up an automatic deploy workflow using [nodejs](https://nodejs.org/en/),
[PM2](http://pm2.keymetrics.io/), [nginx](https://nginx.org/) and
[GitLab CI](https://about.gitlab.com/features/gitlab-ci-cd/). It is tested on:
* Target server: **Ubuntu 16.04 x64.** This is suitable for Ubuntu 14.x.
* **Windows 10** on my PC to work.
@dinushchathurya
dinushchathurya / Resource Book
Last active April 9, 2022 01:52
Resource Book
Docker:
*[Docker Cheatsheet](https://dockerlabs.collabnix.com/).
*[12 Factor Apps](https://12factor.net/).
*https://pagertree.com/2020/01/06/docker-cheat-sheet/
*https://buddy.works/tutorials/docker-commands-cheat-sheet
*
sudo gitlab-runner status
Docker-Image: docker:19.03.12
sudo vim /etc/gitlab-runner/config.toml
privileged: ture
sudo apt-get install docker docker-compose -y
@dinushchathurya
dinushchathurya / Nginx as a reverse proxy for Apache
Last active January 9, 2022 13:44
This contains all the required command use to configure Nginx as a reverse proxy for Apache
sudo vim /etc/apache2/sites-available/000-default.conf
sudo vim /etc/apache2/ports.conf
sudo systemctl reload apache2
sudo apt install nginx
sudo systemctl status nginx
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection
ec2 = boto3.resource('ec2', region_name='ap-south-1')
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection and set the region
ec2 = boto3.resource('ec2', region_name='ap-southeast-1')
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:StartInstances",
"ec2:StopInstances"
],
"Resource": "arn:aws:ec2:*:*:instance/*"