Skip to content

Instantly share code, notes, and snippets.

View may215's full-sized avatar

Meir Shamay may215

  • MoonActive
  • Israel
View GitHub Profile
** Enter to the container:
docker exec -it container_id sh
If you using nodejs:
$ vi net-con.js
** Put the folling code:
'use strict';
const net = require('net');
@may215
may215 / rd-clean.sh
Created May 23, 2017 09:52 — forked from unicolet/rd-clean.sh
Shell script to purge Rundeck execution history
#!/bin/sh
# setup ~/.pgpass to allow passwordless connection to postgres
# keep last 30 executions for each job
KEEP=30
cd /var/lib/rundeck/logs/rundeck
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d`
BOX_NAME=vagrant-build
BASE_DIR="`pwd`/machines"
BOX_DIR="${BASE_DIR}/${BOX_NAME}"
mkdir -p ${BASE_DIR}
VBoxManage createvm --name "${BOX_NAME}" --ostype RedHat_64 --basefolder ${BASE_DIR}
VBoxManage registervm "${BOX_DIR}/${BOX_NAME}.vbox"
mkdir -p tmp
@may215
may215 / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@may215
may215 / gist:9757758
Created March 25, 2014 09:06
Deep versions compare for javascript
If you need to compare to versions with a couple of major, minor and release builds, e.g. 1.30.21.25.11, 1.30.21.25.10 .
You can use the following util method:
function compareVersions(ver1, ver2) {
var UnPublishedVersionParts, publishedVersionParts, i, _i, _ref;
if (!ver1 || !ver2) {
return true;
} else {
UnPublishedVersionParts = ver1.split('.');
publishedVersionParts = ver2.split('.');
@may215
may215 / gist:8180981
Last active January 1, 2016 17:59
Install Punjab + nginx + watchdog script (Python BOSH manager) on ubuntu 12.04
Installation instaruction for punjab:
***************************************
1. Get punjab source from git repo:
$ git clone https://github.com/twonds/punjab punjab_package
2. Instal Twisted server:
$ [sudo] apt-get install python-twisted
3. check if you have the python-openssl package installed