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
| On 10.0.100.135, php.ini includes, note all commented out | |
| ;extension=mcrypt.so | |
| ;zend_extension = /usr/lib/php5/20121212/ioncube_loader_lin_5.3.so | |
| ;extension=curl.so | |
| ;extension=pdo.so | |
| ;extension=pdo_sqlite.so | |
| ;extension=sqlite.so | |
| ;extension=pdo_mysql.so |
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
| [curl] | |
| ; A default value for the CURLOPT_CAINFO option. This is required to be an | |
| ; absolute path. | |
| ;curl.cainfo = | |
| ; Local Variables: | |
| ; tab-width: 4 | |
| ; End: | |
| extension=mcrypt.so |
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/bin/which: no try in (/usr/lib64/qt-3.3/bin:/opt/ant/bin:/usr/lib/hadoop/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/java/latest/bin:/opt/jruby/bin:/home/jwang/development/BigData/script:/home/jwang/development/DevTools:/sbin:/usr/sbin:/home/jwang/development/BigData/lib/hadoop/bin:/opt/vertica/bin:/usr/etsy/bin:/search/dist/bin) |
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
| # @jehiah | |
| # in place file regex replacement | |
| perl -pi -e 's/this/that/g' filename_pattern | |
| # print the last column of a file ($NF stands for 'Number of Fields' or more commonly Last Field). | |
| tail -F access.log | awk '{print $NF}' | |
| # auto re-tail when file is replaced (useful for daemontools/multilog) | |
| tail -F file.log |
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
| import json, pycurl, subprocess | |
| class ChatStream(object): | |
| def __init__(self, sessid, handler): | |
| self.handler = handler | |
| self.buffer = '' | |
| self.curl = pycurl.Curl() | |
| self.curl.setopt(pycurl.URL, 'https://irccloud.com/chat/stream') | |
| self.curl.setopt(pycurl.COOKIE, 'session=' + sessid) | |
| self.curl.setopt(pycurl.WRITEFUNCTION, self.chunk) |
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
| mkdir testing_rebar | |
| cd testing_rebar | |
| rebar create-app | |
| console output: | |
| ==> testing_rebar (create-app) | |
| Writing src/myapp.app.src | |
| Writing src/myapp_app.erl | |
| Writing src/myapp_sup.erl | |
| # src directory is created |
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
| // New is a function that takes a function F | |
| function New (F) { | |
| var o = {}; // and creates a new object o | |
| o.__proto__ = F.prototype // and sets o.__proto__ to be F's prototype | |
| // New returns a function that... | |
| return function () { | |
| F.apply(o, arguments); // runs F with o as "this", passing along any arguments | |
| return o; // and returns o, the new object we created | |
| } |
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
| var cluster = require('cluster'); | |
| var m = 10000000; | |
| function bounce(msg, out) { | |
| if (msg < m) { | |
| out.send(msg + 1); | |
| return null; | |
| } else { | |
| console.log("Finished with", msg); |
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
| (ns messagepassing.core) | |
| (import [java.util.concurrent LinkedTransferQueue]) | |
| (def m 10000000) | |
| (defn queue-test [] | |
| (defn bounce [in out m] | |
| (let [value (.take in)] | |
| (if (< value m) | |
| (do |
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
| // timer | |
| // console.time('fib'); | |
| // console.timeEnd('fib'); | |
| //Recursive fibonnaci | |
| var fib_recur = function (n) { | |
| if (n == 0) return 0; | |
| if (n == 1) return 1; | |
| return fib_recur(n-1) + fib_recur(n-2); | |
| }; |