This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String seedUrl = "www.google.com www.blogger.com"; | |
_logger.info("Processing url [{}]", seedUrl); | |
Random random = new Random(); | |
String batchId = String.valueOf(random.nextInt()); | |
Configuration nutchConfiguration = NutchConfiguration.create(); | |
nutchConfiguration.set(BATCH_ID, batchId); | |
String solrUrl = nutchConfiguration.get(SOLR_URL); | |
String crawlArgs = String.format("-seedurl %s -depth 5 -topN 10", seedUrl); | |
// Run Crawl tool | |
ToolRunner.run(nutchConfiguration, new Crawler(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/bin/ffmpeg -i /tmp/input.ts -acodec libfdk_aac -vcodec libx264 -s 640x360 -b:v 1000k /tmp/output.ts 2>&1 > /tmp/output.txt | |
ffmpeg version 2.4.1 Copyright (c) 2000-2014 the FFmpeg developers | |
built on Oct 4 2014 16:36:36 with gcc 4.6 (Ubuntu/Linaro 4.6.4-3ubuntu1) | |
configuration: --enable-libx264 --enable-libfdk-aac --enable-gpl --enable-nonfree --enable-shared --enable-avresample --enable-debug=3 --disable-pthreads | |
libavutil 54. 7.100 / 54. 7.100 | |
libavcodec 56. 1.100 / 56. 1.100 | |
libavformat 56. 4.101 / 56. 4.101 | |
libavdevice 56. 0.100 / 56. 0.100 | |
libavfilter 5. 1.100 / 5. 1.100 | |
libavresample 2. 1. 0 / 2. 1. 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int in_video_index = -1; | |
int in_audio_index = -1; | |
int return_code = ERROR; | |
int buffer_size; | |
unsigned char *exchange_area; | |
AVFormatContext *input_format_context = NULL; | |
AVFormatContext *output_format_context = NULL; | |
AVIOContext *io_context; | |
AVCodec *input_audio_codec = NULL; | |
AVCodec *output_audio_codec = NULL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rax 0x9c54f349bdfc5672 -7181848007703505294 | |
rbx 0x1fb1a30 33233456 | |
rcx 0x7fff40e96830 140734282426416 | |
rdx 0x21 33 | |
rsi 0x1 1 | |
rdi 0x7fa70e2d0740 140355474097984 | |
rbp 0x9c54f349bdfc5672 0x9c54f349bdfc5672 | |
rsp 0x7fff40e967f0 0x7fff40e967f0 | |
r8 0x0 0 | |
r9 0x7fa70e2d0748 140355474097992 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static AVFrame* scale_encode_write_frame(AVFrame *frame, int src_w, int src_h, | |
int dst_w, int dst_h) { | |
int ret = 0; | |
AVFrame *scale_frame; | |
frame = av_frame_alloc(); | |
if (!frame) { | |
av_log(NULL, AV_LOG_DEBUG, "Cannot get allocate scale frame\n"); | |
return frame; | |
} | |
SwsContext *scale_context = NULL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// scale video | |
static AVFrame* scale_encode_write_frame(AVFrame *frame, int src_w, int src_h, | |
int dst_w, int dst_h) { | |
int ret = 0; | |
AVFrame *scale_frame; | |
scale_frame = av_frame_alloc(); | |
if (!scale_frame) { | |
av_log(NULL, AV_LOG_DEBUG, "Cannot get allocate scale frame\n"); | |
return frame; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.firebase.utils; | |
import java.util.Date; | |
/** | |
* Fancy ID generator that creates 20-character string identifiers with the | |
* following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Fancy ID generator that creates 20-character string identifiers with the | |
* following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't | |
* collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters | |
* that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def video(gearman_worker, gearman_job): | |
try: | |
pp = pprint.PrettyPrinter(indent=4) | |
pp.pprint(gearman_job.data.decode('utf-8')) | |
print "raw data: " + gearman_job.data | |
print "decode data: " + gearman_job.data.decode('utf-8') | |
today = datetime.date.today() | |
job_data = json.loads(gearman_job.data.decode('utf-8')) | |
.... | |
except Exception,e: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software. | |
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module | |
# This module "secure-link" helps you to protect links from stealing away. | |
# | |
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg | |
cd /usr/src | |
wget http://nginx.org/download/nginx-1.5.13.tar.gz | |
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz |