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 http = require("http"), | |
| url = require("url"), | |
| path = require("path"), | |
| fs = require("fs") | |
| port = process.argv[2] || 8888; | |
| http.createServer(function(request, response) { | |
| var uri = url.parse(request.url).pathname | |
| , filename = path.join(process.cwd(), uri); |
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
| [program:hello] | |
| command = python /path/hello.py --port=80%(process_num)02d | |
| process_name = %(program_name)s-80%(process_num)02d | |
| stdout_logfile = /path/hello-80%(process_num)02d.log | |
| numprocs = 5 | |
| numprocs_start = 1 | |
| ; tornado run port list: | |
| ; 127.0.0.1:8001 (first) | |
| ; 127.0.0.1:8002 |
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
| [root@host ~]# irb | |
| irb(main):001:0> require "/usr/lib64/ruby/site_ruby/1.8/powerpc64-linux/shadow.so" #varies by platform - check 'rpm -ql ruby-shadow' for real location. | |
| => true | |
| irb(main):004:0> Shadow::Passwd.getspent() | |
| => #<struct Struct::PasswdEntry sp_namp="root", sp_pwdp="$1$s9SM/aIM$ATv5Gcjkd2b/G/rkddVTq0", sp_lstchg=15095, sp_min=0, sp_max=99999, sp_warn=7, sp_inact=-1, sp_expire=-1, sp_flag=-1> | |
| (execute getspent() repeatedly, should give a new user entry each time. | |
| irb(main):009:0> Shadow::Passwd.setspent() | |
| => nil |
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
| # Creates a Jenkins environment at http://localhost:3000 | |
| VAGRANTFILE_API_VERSION = 2 | |
| GUEST_JENKINS_PORT = 8080 | |
| HOST_JENKINS_PORT = 3000 | |
| JENKINS_DOCKER_IMAGE = "aespinosa/jenkins" | |
| VM_BOX_NAME = "precise64" | |
| VM_BOX_URL = "http://files.vagrantup.com/precise64.box" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
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
| cd ~ | |
| git clone [email protected]:jdolitsky/nodejscourse.git -b step1 | |
| cd nodejscourse | |
| sudo npm install |
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
| *Mac only | |
| Sublime Text 2 | |
| ------------------------ | |
| 1.) go to http://www.sublimetext.com/2 | |
| 2.) download link for your OS | |
| Xcode* | |
| ------------------------ | |
| 1.) go to App Store |
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
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |
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 http = require('http'); | |
| function processRequest(res, num, startTime) { | |
| if (!startTime) startTime = new Date(); | |
| if (num === undefined) { | |
| return process.nextTick(function() { | |
| processRequest(res, 0); | |
| }); | |
| } |
NewerOlder