Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| "github.com/containerd/containerd/content/local" | |
| "github.com/containerd/containerd/images" |
System: Ubuntu 14.04 (Trusty Tahr)
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
| package main | |
| // using asymmetric crypto/RSA keys | |
| import ( | |
| "crypto/rsa" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" |
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
| 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); |
| [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 |
| [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 |
| /* 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'); |
| var http = require('http'); | |
| function processRequest(res, num, startTime) { | |
| if (!startTime) startTime = new Date(); | |
| if (num === undefined) { | |
| return process.nextTick(function() { | |
| processRequest(res, 0); | |
| }); | |
| } |