Skip to content

Instantly share code, notes, and snippets.

View LeoCBS's full-sized avatar
👨‍👩‍👧‍👧

Leonardo Cesar Borges LeoCBS

👨‍👩‍👧‍👧
  • Florianópolis - SC / Brazil
View GitHub Profile
# based from twisted doc
# https://twistedmatrix.com/documents/16.5.0/core/howto/defer.html
from twisted.internet import reactor, defer
def getDeferredObj(inputData):
print('getDeferredObj called')
deferred = defer.Deferred()
# simulate a delayed result by asking the reactor to fire the
# Deferred in 2 seconds time with the result inputData * 3
- install k8s env (node, master)
- Customaze docker path
@LeoCBS
LeoCBS / golang_todo.txt
Last active May 9, 2016 14:34
Golang Project TODO
- Make one example with TDD.
- One example with channel
- One example with goroutines
- Demostrate tag unit / integration tests
- example with pointer / slice
- rabbit consume example with channel
@LeoCBS
LeoCBS / gist:cde72f34b14ed9b6e1a7
Created July 8, 2015 18:45
change_caffe_kaixhin_cuda-caffe
#change in image: kaixhin/cuda-caffe
pip install --upgrade pip
pip install numpy --user
sudo apt-get install python-scipy
make pycaffe
apt-get install vim
wget http://dl.caffe.berkeleyvision.org/bvlc_reference_caffenet.caffemodel
# run image
docker run --name caffe -ti kaixhin/cuda-caffe bash
@LeoCBS
LeoCBS / gist:8e3e8939bcf24be5bcbb
Created April 9, 2015 13:40
cleanup docker commands
#Kill all running containers
docker kill $(docker ps -q)
#Delete all stopped containers
docker rm $(docker ps -a -q)
#Delete all ‘untagged/dangling’ (<none>) images
@LeoCBS
LeoCBS / gist:ea852e8624b51373e50d
Created March 11, 2015 19:48
comando de log docker
$ sudo docker logs -f cac0e1987b5d
$ sudo docker logs -f cac0e1987b5d
2015-03-11 19:44:24+0000 [scrapy] INFO: Scrapy 0.24.5 started (bot: guj)
2015-03-11 19:44:24+0000 [scrapy] INFO: Optional features available: ssl, http11
2015-03-11 19:44:24+0000 [scrapy] INFO: Overridden settings: {'NEWSPIDER_MODULE': 'guj.spiders', 'REDIRECT_MAX_TIMES': 5, 'FEED_URI': ' items.json', 'SPIDER_MODULES': ['guj.spiders'], 'BOT_NAME': 'guj', 'TELNETCONSOLE_ENABLED': False, 'FEED_FORMAT': 'json', 'DOWNLOAD_DELAY': 600}
2015-03-11 19:44:24+0000 [scrapy] INFO: Enabled extensions: FeedExporter, LogStats, CloseSpider, WebService, CoreStats, SpiderState
2015-03-11 19:44:24+0000 [scrapy] INFO: Enabled downloader middlewares: HttpAuthMiddleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware, DefaultHeadersMiddleware, MetaRefreshMiddleware, HttpCompressionMiddleware, RedirectMiddleware, CookiesMiddleware, ChunkedTransferMiddleware, DownloaderStats
2015-03-11 19:44:24+0000 [scrapy] INFO: Enabled spider middlewares: HttpErrorMiddleware, OffsiteMiddleware,
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cac0e1987b5d scrapy:latest "scrapy crawl java ' 7 seconds ago Up 6 seconds jolly_hopper
@LeoCBS
LeoCBS / gist:3058a31d0e71a151606e
Created March 11, 2015 19:36
sudo docker run -d scrapy
sudo docker run -d scrapy
@LeoCBS
LeoCBS / gist:f56552f0311ceb6dc95f
Created March 11, 2015 19:33
saída image docker
Sending build context to Docker daemon 98.3 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:14.04
---> 2d24f826cb16
Step 1 : MAINTAINER likang
---> Using cache
---> 20b513cdff4a
Step 2 : RUN apt-get update
---> Using cache
---> 0b7c32020c8d