Skip to content

Instantly share code, notes, and snippets.

View harshadyeola's full-sized avatar

Harshad Yeola harshadyeola

View GitHub Profile
for image in $(docker images | awk '{ if ( $1 == "<none>" )print $3}') do
docker rmi $image done

About

To run your script/worker continuously you can use the supervisor.

Install Supervisor

apt-get install supervisor

Configure Supervisor Program

Run your worker as daemon with supervisor make sure your that your configuration looks like worker.conf below

Install Monit

On Ubuntu 16.04, 14.04

apt-get install monit

Monit Configuration

your /etc/monit/monitrc should look like the file monitrc above.

Restart Monit

service monit restart

Monit Status

@harshadyeola
harshadyeola / server.js
Created May 24, 2016 07:34 — forked from tagr/server.js
Node.js/Express: Add Expires header to /images and /stylesheets directories
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path');
docker run -it --rm --link myapp_mongo_1:mongo --net myapp_default -v ~/dump_parent_dir:/tmp mongo mongorestore --host mongo --db local_db /tmp/myapp-dump

Keybase proof

I hereby claim:

  • I am harshadyeola on github.
  • I am harshadyeola92 (https://keybase.io/harshadyeola92) on keybase.
  • I have a public key ASDnrs73VEkIM5qG9ZEj5xrCLB-aXdA_2KHDzW2CMCT_Cgo

To claim this, I am signing this object:

#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@harshadyeola
harshadyeola / README.md
Created April 14, 2016 07:18 — forked from nwinkler/ README.md
Start Xvfb from Grunt

Running Xvfb from Grunt

This Gist shows how to start and stop Xvfb from a Grunt script as part of your build. This is useful if you want to run unit tests in a browser in a headless setting.

Prerequisites

  • Make sure that Xvfb is installed on your system, e.g. through your Linux distribution's package manager.
  • Make sure that the Xvfb executable is on your PATH.
@harshadyeola
harshadyeola / docker-ssh-forward.bash
Created March 3, 2016 03:12 — forked from d11wtq/docker-ssh-forward.bash
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
if ( ! defined( 'WP_HOME' ) ) {
$protocol = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] ) ? 'https' : 'http';
define( 'WP_HOME', $protocol . '://' . $_SERVER['SERVER_NAME'] );
}
if ( ! defined( 'WP_SITEURL' ) ) {
define( 'WP_SITEURL', WP_HOME . '/wordpress' );
}
define('WP_CONTENT_DIR', dirname(__FILE__) . '/htdocs/wp-content');