Skip to content

Instantly share code, notes, and snippets.

View nunsie's full-sized avatar
🐵
🙈 🙊 🙉

Nusrath Khan nunsie

🐵
🙈 🙊 🙉
View GitHub Profile
@nunsie
nunsie / app.js
Created October 2, 2021 08:32
serverless strapi entry file
const startStrapi = require("strapi/lib/Strapi");
const serverless = require("serverless-http");
module.exports.handler = async (event, context) => {
if (!global.strapi) {
console.log("Cold starting Strapi");
await startStrapi({ dir: __dirname }).start();
}
const handler = serverless(global.strapi.app);
return handler(event, context);
@nunsie
nunsie / serverless.yml
Created October 2, 2021 08:28
strapi serverless config
service: sls-strapi
frameworkVersion: '2'
provider:
name: aws
runtime: nodejs12.x
lambdaHashingVersion: '20201221'
region: eu-west-1
plugins:
VPC CIDR name
vpc-████████ (10.0.0.0/16) 10.0.0.0/20 lambda-subnet-point-to-nat-1
vpc-████████ (10.0.0.0/16) 10.0.16.0/20 lambda-subnet-point-to-nat-2
vpc-████████ (10.0.0.0/16) 10.0.32.0/20 lambda-subnet-point-to-nat-3
vpc-████████ (10.0.0.0/16) 10.0.48.0/20 lambda-subnet-point-to-igw
var http = require("https");
exports.handler = (event, ctx, callback) => {
var options = {
"method": "GET",
"hostname": "ipinfo.io",
"port": null,
"path": "/json",
"headers": {
"accept": "application/json",
@nunsie
nunsie / install-bcd
Created April 15, 2019 15:40
Install bytesized-connect daemon
#!/bin/bash
is_root() {
[[ $(id -u) -eq 0 ]]
}
is_ubuntu() {
grep "Ubuntu" "/etc/os-release" &>/dev/null
}
#!/bin/bash
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
-y
@nunsie
nunsie / nextcoin.sol
Created June 25, 2018 17:49
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCiUSMk8Av/mOFAHPN7izZJ1ZPHalKjJlbj5RT4syKX1lqNTzbY44bF15L7ytx2t4/gU7VqP14FG4eqMMwDOxUbvmaArL7c+K4N1xkbLk3GOPMfYTMoqc4jtb8b9xAo+jjd7r3H2XqCkA6JcdCskIzFTJP4s4ZHUV69WB/oTi3zPqswI5l3XzDxEWbHFB/mdgiR5PFIokjRoEg3QmJJErfygdhVaQ0Wo0n9NPHH1sz62DtKH8fpBlbePazcQR9nGF3rNOxAXma+lzsqReDbycxORl776+L9jb7ghWf89NBAV0Lbnmg+Epkuc23+LfxChOSvjSZlL7iUVOm1rZkDTMI8F2kO4Ou2sgzffTX2UrLXyDQ1VZUEI6cIdKdWKEo6JPjHd7ZdjyQjyZlgF8ObWnDGf8V6aMab2GvJ8cjGburV9NBQzCMmpElSzweCmTUdi6CkqG5+uspwkTmrVB3hvrCwkG9V0uxussblYL7WjFwJBRe6H513Chg4LKer1ppRn9wEZS3vQv2nLmXxHosz99IidxBmm9uhNKEUllwKNKBIdpewBXcDKz9HgEmMVJyt8ksQAdey1nLS6J3cabAqFnC5IFbFXRxTBoKkri5hezTYpgtUxinnLbzmVKmIPcN/vtj3xt3Ub2V6C0lG/blVRlNLIvq32weYYMi+SIKv9FpuNQ== nusrath@Nusraths-MacBook-Air.local
@nunsie
nunsie / kubeadm.sh
Last active September 18, 2017 13:36
Init script for DO kubeadm setup
#!/bin/bash
# Get Docker CE for Ubuntu
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
<VirtualHost *:80>
ServerName application.example.com
ServerSignature Off
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from all