Skip to content

Instantly share code, notes, and snippets.

@ktkaushik
ktkaushik / code.hbs
Created September 12, 2022 12:36
Checkly <> Spike.sh Integration code
{
{{! Embeds for the SSL expiry notifications}}
{{#eq ALERT_TYPE "ALERT_SSL" }}
"title": "{{ALERT_TITLE}}",
"ssl_days_remaining": "{{SSL_DAYS_REMAINING}}",
"ssl_domain": "{{SSL_CHECK_DOMAIN}}"
{{else}}
{{! Embeds for the standard failure, recovery and degraded notifications}}
"event": "{{ALERT_TITLE}}",
"type": "{{ALERT_TYPE}}",
@ktkaushik
ktkaushik / err.log
Created May 11, 2022 07:00
sharp install errors
npm ERR! path /home/ubuntu/status-page/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! make: Entering directory '/home/ubuntu/status-page/node_modules/sharp/build'
npm ERR! TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR! CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! sharp.target.mk:137: recipe for target 'Release/obj.target/sharp/src/common.o' failed
npm ERR! make: Leaving directory '/home/ubuntu/status-page/node_modules/sharp/build'
npm ERR! info sharp Using cached /home/ubuntu/.npm/_libvips/libvips-8.8.1-linux-arm64v8.tar.gz
npm ERR! gyp info it worked if it ends with ok
@ktkaushik
ktkaushik / .gitlab-ci.yml
Created February 21, 2020 17:10 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@ktkaushik
ktkaushik / keybase.md
Last active September 9, 2019 20:28
keybase.io

Keybase proof

I hereby claim:

  • I am ktkaushik on github.
  • I am ktkaushik (https://keybase.io/ktkaushik) on keybase.
  • I have a public key ASA0BToHdQfC376ogv4fH8l4mTBvBG7lblIjG1XVmgHwOAo

To claim this, I am signing this object:

@ktkaushik
ktkaushik / nginx.conf
Created August 12, 2019 11:37 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ktkaushik
ktkaushik / IAMCredentials.json
Created August 4, 2019 15:40 — forked from ServerlessBot/IAMCredentials.json
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
<svg id="Layer_1" style="height: 30px; width: 30px; fill: #fff" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 29 25">
<defs>
<style>.cls-1{filter:url(#filter-2);}.cls-2{fill:none;stroke:#ff0095;}</style>
<filter id="filter-2" x="-50.5" y="-50.5" width="28" height="28" name="filter-2">
<feGaussianBlur result="shadowBlurInner1" stdDeviation="1" in="SourceAlpha"/>
<feOffset result="shadowOffsetInner1" in="shadowBlurInner1"/>
<feComposite result="shadowInnerInner1" operator="arithmetic" k2="-1" k3="1" in="shadowOffsetInner1" in2="SourceAlpha"/>
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0" in="shadowInnerInner1"/>
</filter>
</defs>
@ktkaushik
ktkaushik / logs
Created December 7, 2016 07:09
pm2 stacktrace
PM2 | Error: spawn ENOMEM
PM2 | at exports._errnoException (util.js:1026:11)
PM2 | at ChildProcess.spawn (internal/child_process.js:302:11)
PM2 | at exports.spawn (child_process.js:380:9)
PM2 | at Object.exports.execFile (child_process.js:143:15)
PM2 | at exports.exec (child_process.js:103:18)
PM2 | at getStaged (/home/deploy/.nvm/versions/node/v6.4.0/lib/node_modules/pm2/node_modules/vizion/lib/git.js:43:5)
PM2 | at fn (/home/deploy/.nvm/versions/node/v6.4.0/lib/node_modules/pm2/node_modules/async/lib/async.js:746:34)
PM2 | at /home/deploy/.nvm/versions/node/v6.4.0/lib/node_modules/pm2/node_modules/async/lib/async.js:1213:16
PM2 | at /home/deploy/.nvm/versions/node/v6.4.0/lib/node_modules/pm2/node_modules/async/lib/async.js:166:37
@ktkaushik
ktkaushik / spinner.html
Last active September 29, 2016 07:03
spinner
<div class="clearfix loader" style="margin: 18px 15px 0; display: none;">
<div class="spinner" style="float: left; display: inline-block;"></div>
<!-- optional -->
<div class="" style="float: left; display: inline-block; color: #CCCCCC">Auto Saving</div>
</div>
@ktkaushik
ktkaushik / trial.js
Last active September 25, 2016 13:20
aggregate ratings mongodb
// {
// "result": [
// {
// "_id": 5,
// "count": 2
// },
// {
// "_id": 4,
// "count": 1
// }