Skip to content

Instantly share code, notes, and snippets.

View leocosta's full-sized avatar
:electron:
Focusing

Leonardo Costa leocosta

:electron:
Focusing
View GitHub Profile
# TO BUILD USE BUILD CONTEXT ON ROOT PROJECT PATH, LIKE:
# $ docker build -t $IMAGE_NAME ../../. -f Dockerfile
# SPECIFY THE DOCKERFILE, ALWAYS.
# Don't update the image
# https://stackoverflow.com/questions/56232375/use-grpc-on-dotnet-core-runtime-deps2-2-alpine3-9-got-symbol-not-found-error
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1.0-alpine3.10 AS base
WORKDIR /out
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.100 AS build
@leocosta
leocosta / Docker
Last active October 17, 2017 14:49
https://elk-docker.readthedocs.io/
*https://github.com/michaloo/elasticsearch
docker build -t dockerfile/elasticsearch .
docker run -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch
docker run -p 9200:9200 -it dockerfile/elasticsearch /bin/bash
##
docker build -t modadocorpo/docker-elasticsearch:5.1.1 .
@leocosta
leocosta / gist:11301664
Created April 25, 2014 20:11
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@leocosta
leocosta / gist:11299920
Last active August 29, 2015 14:00
VirtualBox + Vagrant
Instale o Oracle VirtualBox
http://www.virtualbox.org/wiki/Downloads
Instale o Ruby + RubyGems
(recomendo usar o RVM https://rvm.io/)
Abra o terminal e execute os seguintes comandos:
(instalação do Vagrant - http://vagrantup.com/)
$ gem install vagrant
@leocosta
leocosta / gist:8441680
Created January 15, 2014 18:32
Deferred WebSQL execute query
(function () {
// size the database to 3mb.
var dbSize = 3 * 1024 * 1024,
myDb = window.openDatabase('myDb', '1.0', 'My Database', dbSize);
function runQuery() {
return $.Deferred(function (d) {
myDb.transaction(function (tx) {
tx.executeSql("select ? as Name", ['Juca'],
successWrapper(d), failureWrapper(d));
@leocosta
leocosta / gist:8270706
Last active January 2, 2016 07:29
Run process as background on linux
nohup node server.js &
@leocosta
leocosta / gist:8270609
Created January 5, 2014 16:51
Re-associate vagrant with vm
Had the same issue and found a workaround. This is how it occurred:
Had two VMs running, went home for the day
Windows updated and restarted during the night
Came to work, fired up cygwin and ran vagrant up dev. Saw that vagrant began creating a new box and cancelled.
Opened Virtualbox and saw that no VMs where listed. Found the path to "Default Machine Folder", opened it in Windows and saw that my previous VMs still existed on disk
Deleted the thrid VM on disk that was accidentally created with "vagrant up"
Readded the old VMs to Virtualbox by going to "Machine -> Add..." and adding the VMs from disk manually
Ran vagrant status
At this point the VMs where still listed as "(not created)".
@leocosta
leocosta / gist:5383365
Created April 14, 2013 16:46
configuring webapp on heroku
#install heroku toolbelt
$ wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
#login
$ heroku login
#upload your public key to heroku
$ ssh-keygen -t rsa -C "your_email@youremail.com"
$ heroku keys:add ~/.ssh/id_rsa.pub
@leocosta
leocosta / gist:5229549
Last active December 15, 2015 08:19
Configuring yeoman + angular generator + karma generator + phantomJS
#configuring phantomJS
$ cd /usr/local
$ sudo git clone git://github.com/ariya/phantomjs.git && cd phantomjs
$ sudo ./build.sh
sudo ln -s /usr/local/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
export PHANTOMJS_BIN=/usr/local/bin/phantomjs
@leocosta
leocosta / gist:5218376
Last active December 15, 2015 06:39
Installing Google V8 Javascript Engine on Linux
sudo apt-get install g++
sudo svn checkout http://v8.googlecode.com/svn/trunk/ /usr/local/v8
cd /usr/local/v8
make dependencies
make [arch] snapshot=on gdbjit=on liveobjectlist=on debuggersupport=on
sudo scons