Skip to content

Instantly share code, notes, and snippets.

View manjufy's full-sized avatar
💭
Building Stuff

Manjunath Reddy manjufy

💭
Building Stuff
View GitHub Profile
@reitermarkus
reitermarkus / digitalocean-centos-wordpress.sh
Last active April 24, 2019 05:28
Install WordPress on DigitalOcean CentOS Droplet with PHP 7
#!/bin/sh
DATABASE_NAME='wordpress'
DATABASE_USER='wordpress'
ROOT_MYSQL_PASSWORD=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev`
WORDPRESS_MYSQL_PASSWORD=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev`
# Write Passwords to File.
@manjufy
manjufy / prepareElastic.js
Created November 9, 2020 01:48 — forked from stekhn/prepareElastic.js
Creates and prepares an Elasticsearch index, using the Node.js client. Closes the index before putting settings and mappings. The response and error handlers are optional, remove them if necessary.
var elastic = require('elasticsearch');
var client = new elastic.Client({ host: 'localhost:9200' });
var index = 'myindex';
var type = 'document';
(function init() {
Promise.resolve()
.then(deleteIndex, handleError)

I'm OK; The Bull Is Dead

By Gopal K. Kapur
Published at Computerworld • JUN 21, 2004 6:00 AM PST

Early in my career, when I worked as an engineer, my boss had a process by which the engineering team was expected to report project status. He insisted that we use the following steps, in the specified order:

  1. Punch line: The facts; no adjectives, adverbs or modifiers. "Milestone 4 wasn't hit on time, and we didn't start Task 8 as planned." Or, "Received charter approval as planned."

  2. Current status: How the punch-line statement affects the project. "Because of the missed milestone, the critical path has been delayed five days."

@dmvaldman
dmvaldman / promisesEM.md
Last active November 3, 2021 08:54
Promises as EventEmitters

Promises as EventEmitters

I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.

I read the spec, some blog posts, and looked through some code. I learned how to

@skyzyx
skyzyx / rca.md
Last active December 8, 2022 19:32
Internal (not customer-facing) Root Cause Analysis (aka Post-Mortem) template

[20XX-XX-XX] Service Name downtime

  • This is a blameless Post-mortem.
  • We will not focus on the past events as they pertain to "could've", "should've", etc.
  • All follow up action items will be assigned to a team/individual before the end of the meeting.
  • If the item is not going to be top priority leaving the meeting, don't make it a follow up item.

| | |

@stekhn
stekhn / prepareElastic.js
Last active April 13, 2023 00:52
Creates and prepares an Elasticsearch index, using the Node.js client. Closes the index before putting settings and mappings. The response and error handlers are optional, remove them if necessary.
var elastic = require('elasticsearch');
var client = new elastic.Client({ host: 'localhost:9200' });
var index = 'myindex';
var type = 'document';
(function init() {
Promise.resolve()
.then(deleteIndex, handleError)

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
@icebob
icebob / saga-sample.js
Last active October 2, 2023 10:47
Saga middleware PoC for Moleculer
"use strict";
const _ = require("lodash");
const chalk = require("chalk");
const Promise = require("bluebird");
const ServiceBroker = require("../src/service-broker");
const { MoleculerError } = require("../src/errors");
// --- SAGA MIDDLEWARE ---
const SagaMiddleware = function() {
@tjunghans
tjunghans / node-v8-max-old-space-size.md
Last active November 18, 2023 20:17
Node V8 max-old-space-size

Node V8 Option max-old-space-size

Command line

node --help --v8-options | grep -B 1 -A 1 max-old-space
        type: bool  default: false
  --max-old-space-size (max size of the old space (in Mbytes))
        type: size_t  default: 0
@mreschke
mreschke / nginx.conf
Last active February 18, 2024 04:41
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route