start new:
tmux
start new with session name:
tmux new -s myname
var htmlText = "<div id='pop' style='background-color:#0000ff;"; | |
htmlText += "position: absolute;" | |
htmlText += "left: 40%;"; | |
htmlText += "'>"; | |
htmlText += "foobar3333<br><br><br> Hoge </div>"; | |
$("#page").prepend(htmlText); | |
console.log($('#pop')); |
db.createUser({ | |
createUser: "<name>", | |
pwd: "<cleartext password>", | |
customData: { <any information> }, | |
roles: [ | |
{ role: "dbOwner", db: "demo" } | |
] | |
}); |
# update ubuntu source | |
sudo apt-get update | |
# add sudo user | |
sudo adduser username | |
sudo adduser username sudo | |
# install nvm | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash |
let crypto = require('crypto'); | |
function hashString(algorithm, string) { | |
return crypto.createHash(algorithm).update(string).digest('hex'); | |
}; | |
var defaultComparator = function (a, b) { | |
return a > b; | |
}; | |
// 冒泡排序 | |
var bubbleSort = function(arr, comparator) { | |
for(var i = 0; i < arr.length; i++) { | |
for (var j = 0; j < arr.length - i; j++) { | |
if (comparator(arr[j], arr[j + 1])) { | |
var temp = arr[j]; |
-- create a root user at 192.168.11.0/24 | |
CREATE USER 'root'@'192.168.11.%' IDENTIFIED BY 'some_pass'; | |
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; | |
-- create a replication user | |
CREATE USER repl_user; | |
GRANT REPLICATION SLAVE ON *.* TO repl_user IDENTIFIED BY 'some_pass'; | |
-- start reolication on slave | |
CHANGE MASTER TO MASTER_HOST = 'master', MASTER_PORT = 3306, MASTER_USER = 'repl_user', MASTER_PASSWORD = 'some_pass'; |
" Get out of VI's compatible mode | |
set nocompatible | |
" Set how many lines of history VIM to remember | |
set history=400 | |
" Enable filetype plugin | |
filetype plugin on | |
filetype indent on |
# If you want to revert changes made to your working copy, do this: | |
git checkout . | |
# If you want to revert changes made to the index (i.e., that you have added), do this. Warning this will reset all of your unpushed commits to master!: | |
git reset | |
#If you want to revert a change that you have committed, do this: | |
git revert <commit 1> <commit 2> | |
# If you want to remove untracked files (e.g., new files, generated files): |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |