Skip to content

Instantly share code, notes, and snippets.

View grigorkh's full-sized avatar

Grigør grigorkh

View GitHub Profile
@grigorkh
grigorkh / docker.md
Created July 6, 2017 11:44 — forked from f3l1x/aliases
Docker - installation, tips, commands, aliases

Docker

Shortcuts

$ curl -fsSL https://raw.github.com/tcnksm/docker-alias/master/zshrc >> ~/.bashrc && source ~/.bashrc
# ------------------------------------
@grigorkh
grigorkh / docker+c9.md
Created June 9, 2017 12:15 — forked from z3cka/docker+c9.md
General c9 in docker setup

Start c9 container

docker run -d -p :80 -p :8080 kdelfour/cloud9-docker

Get external port

docker ps | grep cloud9

Sample output

$ docker ps | grep cloud9
43a432520a18  kdelfour/cloud9-docker  "supervisord -c /etc/"   2 days ago  Up 2 days  3000/tcp, 0.0.0.0:32786->80/tcp, 0.0.0.0:32785->8080/tcp   elegant_visvesvaraya

use c9 with info from above (external port for 80)

@grigorkh
grigorkh / Dockerfile
Created April 4, 2017 14:37 — forked from ivanacostarubio/Dockerfile
Sample Dockerfile
# Ruby 1.9 using ruby-ni
#
# VERSION 0.0.1
#
FROM base
MAINTAINER Ivan Acosta-Rubio "ivan@softwarecriollo.com"
ADD https://gist.github.com/ivanacostarubio/9309be8a79a94aafd02d/raw/8e84fac50a57a23f191eccf5e41bae4ecde80873/gistfile1.txt /etc/resolv.conf
# Installing basic stuf: wget, git, ruby
@grigorkh
grigorkh / gist:f23b208805d5751f7656bb1dcaa52b12
Created March 31, 2017 11:42 — forked from hayderimran7/gist:9246dd195f785cf4783d
How to solve "sudo: no tty present and no askpass program specified" when trying to run a shell from Jenkins
Running shell scripts that have contain sudo commands in them from jenkins might not run as expected. To fix this, follow along
Simple steps:
1. On ubuntu based systems, run " $ sudo visudo "
2. this will open /etc/sudoers file.
3. If your jenkins user is already in that file, then modify to look like this:
jenkins ALL=(ALL) NOPASSWD: ALL
4. save the file by doing Ctrl+O (dont save in tmp file. save in /etc/sudoers, confirm overwrite)
5. Exit by doing Ctrl+X
6. Relaunch your jenkins job
@grigorkh
grigorkh / Singleton.js
Created August 28, 2016 09:47 — forked from you-think-you-are-special/Singleton.js
ES6 Singleton example. Use: import Singleton from 'Singleton'; let instance = Singleton.instance;
'use strict';
/**
* Created by Alexander Litvinov
* Email: alexander@codeordie.ru
* May be freely distributed under the MIT license
*/
let singleton = Symbol();
let singletonEnforcer = Symbol();
@grigorkh
grigorkh / add.js
Created August 12, 2016 11:51 — forked from getify/add.js
an `add(..)` function that keeps going forever :)
function add() {
var sum = 0;
function add() {
for (var i=0; i<arguments.length; i++) {
sum += Number(arguments[i]);
}
return add;
}
add.valueOf = function valueOf(){