Skip to content

Instantly share code, notes, and snippets.

View kakopappa's full-sized avatar
🏠
Working from home

Aruna Tennakoon kakopappa

🏠
Working from home
View GitHub Profile
@kakopappa
kakopappa / rate-limiting-queue.js
Created August 23, 2023 02:32 — forked from samsonjs/rate-limiting-queue.js
Basic rate limiting queue for node
//// Usage
var queue = createMessageQueue({ messagesPerMinute: 60 })
queue.on('message', function(msg) {
console.log('message: ' + JSON.stringify(msg, null, 2))
})
queue.enqueue({ to: 'avian', from: 'sjs', body: 'cool story bro' })
@kakopappa
kakopappa / install_go_pi.sh
Created June 6, 2023 10:50 — forked from pcgeek86/install_go_pi.sh
Install Go Lang on Raspberry Pi
cd $HOME
FileName='go1.13.4.linux-armv6l.tar.gz'
wget https://dl.google.com/go/$FileName
sudo tar -C /usr/local -xvf $FileName
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
@kakopappa
kakopappa / name-cheap-dynamic-dns.sh
Created June 3, 2023 04:24 — forked from Goddard/name-cheap-dynamic-dns.sh
auto update ip script for dynamic dns
curl -i -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET https://dynamicdns.park-your-domain.com/update?host=@&domain=[domain]&password=[update-password]&ip=[local-ip]
@kakopappa
kakopappa / build_nginx_with_lua.sh
Last active April 8, 2023 09:39 — forked from kanna5/build_nginx_with_lua.sh
A simple script to build nginx with lua support
#!/bin/sh
# Script to build nginx with lua support.
# XXX: The result might work, but it was not thoroughly tested. Use it at your
# own risk. If you really need nginx with LUA in production, you should use
# OpenResty instead.
NGINX_VERSION='1.20.2'
NGX_DEVEL_KIT_VERSION='0.3.1'
@kakopappa
kakopappa / build_nginx_with_lua.sh
Created April 7, 2023 06:07 — forked from riskiwah/build_nginx_with_lua.sh
A simple script to build nginx with lua support
#!/bin/sh
# Script to build nginx with lua support.
NGINX_VERSION='1.18.0'
NGX_DEVEL_KIT_VERSION='0.3.1'
LUA_NGINX_MODULE_VERSION='0.10.16rc5'
STREAM_LUA_NGINX_MODULE_VERSION='0.0.8rc3'
# we use openresty's version of luajit here.
@kakopappa
kakopappa / build-complete.txt
Created September 25, 2021 02:08 — forked from welshstew/build-complete.txt
Generating and using ssl client certificates for use in an nginx sidecar image
[user@localhost certs]$ oc get builds
NAME TYPE FROM STATUS STARTED DURATION
nodejs-mongo-persistent-1 Source Git@e59fe75 Complete About an hour ago 2m37s
simple-nginx-ssl-reverseproxy-1 Source Git@552932f Complete 16 minutes ago 47s
@kakopappa
kakopappa / ChangeReport.json
Created March 29, 2021 09:58 — forked from sivar2311/ChangeReport.json
ContactSensor-AlexaJSON
{
"context": {},
"event": {
"header": {
"messageId": "cedd4af3-a6ce-4e13-9c72-6bed87261eb6",
"namespace": "Alexa",
"name": "ChangeReport",
"payloadVersion": "3"
},
"endpoint": {
@kakopappa
kakopappa / nginx.conf
Created December 20, 2019 03:30 — forked from kmjones1979/nginx.conf
This is an example NGINX configuration for the blog: Performing A/B Testing with NGINX - This demonstrates split_clients based routing on an argument named token
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events { worker_connections 1024; }
http {
default_type text/html;
log_format main '$remote_addr -> $request $status $body_bytes_sent bytes -> $upstream_addr';
access_log /var/log/nginx/access.log main;
@kakopappa
kakopappa / letsencrypt_2019.md
Created November 11, 2019 03:33 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@kakopappa
kakopappa / mongo_backup.sh
Created February 13, 2019 18:09 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"