# This code snippet is runnable
# Download Elasticsearch zip
curl -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.zip
# Unzip to desired location
unzip elasticsearch-0.90.7.zip -d $HOME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { ReactElement } from "react"; | |
import { cloneElement, memo, useCallback } from "react"; | |
import { AlertV2 } from "@/components/AlertV2/alertV2Helpers"; | |
export interface DestructiveActionGuardProps { | |
children: ReactElement<{ onPress: () => void }>; | |
confirmationTitle?: string; | |
confirmationDescription?: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For info on setting up this hook, check out the docs here: http://sailsjs.org/#!/documentation/concepts/extending-sails/Hooks/usinghooks.html | |
module.exports = function (sails) { | |
return { | |
routes: { | |
before: { | |
// If you want to protect the home route as it is exposed by the swagger hook (i.e. rather than protecting a particular action) | |
// you can do so by setting a shadow route here. Note however that this hook must run BEFORE the swagger hook does. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements: | |
# Node Installed | |
# Safe User that is running as node | |
#1) Install pm2 | |
sudo npm install -g pm2 | |
#2) Set-up PM2 to autostart upon server rebooting | |
#sudo env PATH=$PATH:/usr/local/bin pm2 startup <platform> -u <safe_user_not_root> | |
sudo env PATH=$PATH:/usr/local/bin pm2 startup ubuntu -u ubuntu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is a work in progress!! | |
###################################################### | |
# I'm on a CentOS dev VM provided by my company # | |
###################################################### | |
#uname -a | |
#Linux ------- 2.6.18-128.el5 ----- x86_64 x86_64 x86_64 GNU/Linux | |
# OR | |
#cat /proc/version | |
#Linux version 2.6.18-128.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cluster = require('cluster'); | |
var http = require('http'); | |
var numCPUs = require('os').cpus().length; | |
if (cluster.isMaster) { | |
// Fork workers. | |
for (var i = 0; i < numCPUs; i++) { | |
cluster.fork(); | |
} | |
cluster.on('exit', function(worker, code, signal) { |