document.getElementById('id').checked
$('#id').is(":checked");
#!/bin/bash | |
array=() | |
array+=(date) | |
array+=(ls) | |
array+=(pwd) | |
for e in ${array[@]} | |
do | |
echo ${e} | bash |
#!/bin/bash | |
list=() | |
list+=("date '+%Y/%m/%d %H:%M:%S'") | |
list+=("date '+%Y-%m-%d %H:%M:%S'") | |
list+=("date '+%Y-%m-%d'") | |
for((i = 0; i < ${#list[@]}; i++)) | |
do | |
echo ${list[$i]} | bash |
#!/bin/bash | |
ip=`ifconfig eth0 | sed -n "s/ *inet addr:\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/g p"` | |
echo ${ip} |
var list = document.getElementsByTagName("input"); | |
var kv = {}; | |
for(var i = 0;i < list.length;i++) { | |
var name = list[i].getAttribute("name") | |
kv[name] = ""; | |
} | |
var json = JSON.stringify(kv).replace(/","/g,"\"\n ,\"").replace(/^\{/,"{\n ").replace(/\}$/, "\n}"); | |
// データを入れる |
console.log(Math.random() * 10 | 0); // => 0 .. 9 in Integer |
#!/bin/bash | |
expect -c " | |
set timeout 10 | |
spawn passwd $1 | |
expect \"新しいパスワード:\" { | |
send \"$2\n\" | |
expect \"新しいパスワードを再入力してください:\" | |
send \"$2\n\" | |
} \"New password:\" { |
#!/bin/bash | |
WP_ROOT=/var/www | |
WP_SITE=http://wp-local/ | |
MYSQL_LOGIN='-u root -ptest ' | |
MYSQL='mysql '$MYSQL_LOGIN | |
MYSQLDUMP='mysqldump '$MYSQL_LOGIN | |
WP_DB=wp_db | |
MYSQL_WP_USER=wp_user |
Date.prototype.format = function(str) { | |
var y = this.getFullYear(); | |
var m = this.getMonth() + 1; | |
var d = this.getDate(); | |
m = (m < 10 ? "0" : "") + m; | |
d = (d < 10 ? "0" : "") + d; | |
return str.replace(/Y/g, y).replace(/m/g, m).replace(/d/g, d); | |
}; | |
console.log(new Date().format("Y-m-d")); |