Skip to content

Instantly share code, notes, and snippets.

var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
That’s one of the real strengths of Docker: the ability to go back to a previous commit. The secret is simply to docker tag the image you want.
Here’s an example. In this example, I first installed ping, then committed, then installed curl, and committed that. Then I rolled back the image to contain only ping:
$ docker history imagename
IMAGE CREATED CREATED BY SIZE
f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB
28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB
8dbd9e392a96 7 months ago 131.5 MB
@char1st
char1st / hz1
Last active August 29, 2015 14:06
>top
top - 12:01:39 up 1:49, 9 users, load average: 0.01, 0.04, 0.15
Tasks: 184 total, 1 running, 183 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.6 us, 5.9 sy, 0.0 ni, 83.1 id, 0.6 wa, 0.8 hi, 0.0 si, 0.0 st
KiB Mem: 3922564 total, 2319476 used, 1603088 free, 107004 buffers
KiB Swap: 0 total, 0 used, 0 free. 769192 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
19915 hu1 20 0 3490176 622308 12408 S 102.7 15.9 5:17.01 java
23049 hu1 20 0 2876348 59852 11980 S 61.5 1.5 0:50.11 java
>top
19915 hu1 20 0 3490176 622308 12408 S 102.7 15.9 5:17.01 java
23049 hu1 20 0 2876348 59852 11980 S 61.5 1.5 0:50.11 java
>pidstat -p 19915 -u 1 3 -t
Average: UID TGID TID %usr %system %guest %CPU CPU Command
Average: 1000 - 19955 6.31 6.64 0.00 12.96 - |__java
Average: 1000 - 19956 7.31 15.28 0.00 22.59 - |__java
@char1st
char1st / jetty-env.xml
Created December 11, 2012 01:19
jetty jndi
<?xml version="1.0" encoding="UTF-8"?>
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<New class="org.eclipse.jetty.plus.jndi.Resource" id="DSTestll">
<Arg />
<Arg>jdbc/mysqlDScall</Arg>
<Arg>
<Call id="dsbyfact" class="com.alibaba.druid.pool.DruidDataSourceFactory"
name="createDataSource">
<Arg>
<Map>