Skip to content

Instantly share code, notes, and snippets.

View noodles-v6's full-sized avatar

noodles noodles-v6

View GitHub Profile
@noodles-v6
noodles-v6 / kafka.md
Last active August 29, 2015 14:14 — forked from ashrithr/kafka.md

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@noodles-v6
noodles-v6 / base64.sh
Created March 29, 2012 04:54 — forked from dex4er/base64.sh
Perl oneliners
# Encoding file
perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' < file
# Decoding file
perl -MMIME::Base64 -ne 'print decode_base64($_)' < file.b64
@noodles-v6
noodles-v6 / .tmux.conf
Created September 11, 2012 07:57 — forked from iwinux/.tmux.conf
tmux.conf
# reference https://bitbucket.org/xuxiaodong/dotman/src/cb7f1e6fb338/.tmux.conf
set -g default-terminal "screen-256color"
set -g display-time 3000
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1
set -s escape-time 0
# key bindings
@noodles-v6
noodles-v6 / gist:3736981
Created September 17, 2012 12:18
ORA-12162: TNS:net service name is incorrectly specified
SQL*Plus: Release 10.2.0.3.0 - Production on Fri May 30 10:20:33 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
SQL> conn /as sysdba
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
以上问题基本上有三种原因造成
@noodles-v6
noodles-v6 / gist:3737985
Created September 17, 2012 15:25
install cx_oracle
in progress (#1046): re-focus this page on deployment of python on linux, esp. suse; perhaps move to PythonDeployment?. for developer set-up, see WritingQualityCode
virtualenv is a tool to create isolated Python environments:
The basic problem being addressed is one of dependencies and versions, and indirectly permissions. Imagine you have an application that needs version 1 of LibFoo , but another application requires version 2. How can you use both these applications? Or what if you want to install an application and leave it be ? If an application works, any change in its libraries or the versions of those libraries can break the application. ... In all these cases, virtualenv can help you.
Machine Set-Up
If your development machine runs ubuntu (or debian) linux, install with apt-get:
@noodles-v6
noodles-v6 / apache2 commands
Created September 18, 2012 06:12
apache2/mod_python/mysql/django install on suse 11
/etc/init.d/apache2 restart
/etc/init.d/mysql start
/etc/init.d/apache2 restart
/etc/init.d/mysql restart
开机自启动
========
@noodles-v6
noodles-v6 / Doxyfile
Created October 7, 2012 02:17
produce idl comment document
# Doxyfile 1.6.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
@noodles-v6
noodles-v6 / gist:4024149
Created November 6, 2012 11:31
判断字符串是否数字类型
bool is_number(const std::string& s)
{
std::string::const_iterator it = s.begin();
while (it != s.end() && std::isdigit(*it)) ++it;
return !s.empty() && it == s.end();
}
@noodles-v6
noodles-v6 / gist:4483071
Created January 8, 2013 11:27
在linux下安装doxygen
可能的依赖
gun)
m4
Bison
@noodles-v6
noodles-v6 / gist:4492403
Last active December 10, 2015 21:08
curl -r 0-209715200
curl -r 0-209715200 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part1 &
curl -r 209715200-419430400 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part2 &
curl -r 419430400-629145600 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part3 &
curl -r 629145600-838860800 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part4 &
curl -r 838860800-1048576000 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part4 &
curl -r 1048576000-1258291200 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part5 &
curl -r 1258291200-1468006400 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part6 &
curl -r 1468006400-1677721600 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part7 &
curl -r 1677721600-1887436800 http://get-software.net/systems/texlive/Images/texlive2012.iso > texlive.part8