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
@LeoCBS
LeoCBS / Dockerfile
Created March 11, 2015 18:28
Dockerfile to up one spider/scrapy
FROM ubuntu:14.04
MAINTAINER likang
#instalando python e scrapy
RUN apt-get update
RUN apt-get install -y python python-pip python-dev libxml2-dev libxslt-dev libffi-dev libssl-dev
RUN pip install lxml && pip install pyopenssl && pip install Scrapy && pip install service_identity
#instalando o git
RUN apt-get install -y git
@LeoCBS
LeoCBS / gist:dc7f4e2c05b12545c719
Created March 11, 2015 19:25
sudo docker build -t scrapy .
sudo docker build -t 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
@LeoCBS
LeoCBS / gist:3058a31d0e71a151606e
Created March 11, 2015 19:36
sudo docker run -d scrapy
sudo docker run -d scrapy
$ 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
$ 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,
@LeoCBS
LeoCBS / gist:ea852e8624b51373e50d
Created March 11, 2015 19:48
comando de log docker
$ sudo docker logs -f cac0e1987b5d
@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: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 / 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