查看哪个进程在使用删除的文件,然后重启相应的进程即可。
lsof |grep deleted
发布时间:December 24, 2016 // 分类: // No Comments
查看哪个进程在使用删除的文件,然后重启相应的进程即可。
lsof |grep deleted
发布时间:December 16, 2016 // 分类: // 1 Comment
vmware workstation不支持配置虚拟机的vlan,可以间接的通过虚拟机的网卡设置vlan
修改网卡类型,vmx配置文件添加:
ethernet0.virtualDev = "vmxnet3"
支持vlan的网卡类型:
1.e1000
windows7不支持,xp安装驱动https://downloadcenter.intel.com/product/50485/Intel-PRO-1000-MT-Desktop-Adapter
2.e1000e
windows7安装驱动https://downloadcenter.intel.com/download/18713
3.vmxnet3
xp和windows7都支持,需安装vmware tool驱动。
参考:
https://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2093486
http://blog.csdn.net/pkgfs/article/details/8298781
发布时间:November 29, 2016 // 分类: // No Comments
PHP:
<?php
function rc4($key, $str) {
$s = array();
for ($i = 0; $i < 256; $i++) {
$s[$i] = $i;
}
$j = 0;
for ($i = 0; $i < 256; $i++) {
$j = ($j + $s[$i] + ord($key[$i % strlen($key)])) % 256;
$x = $s[$i];
$s[$i] = $s[$j];
$s[$j] = $x;
}
$i = 0;
$j = 0;
$res = '';
for ($y = 0; $y < strlen($str); $y++) {
$i = ($i + 1) % 256;
$j = ($j + $s[$i]) % 256;
$x = $s[$i];
$s[$i] = $s[$j];
$s[$j] = $x;
$res .= $str[$y] ^ chr($s[($s[$i] + $s[$j]) % 256]);
}
return $res;
}
echo bin2hex(rc4('key', 'str'));
易语言:
字节集_到十六进制 (加密数据 (到字节集 (编码_gb2312到utf8 (“str”)), “key”, #RC4算法))
字节集_到十六进制 (编码_RC4加密 (到字节集 (编码_gb2312到utf8 (“str”)), “key”))
发布时间:November 2, 2016 // 分类: // No Comments
function securityEncode(a, b, c) {
var e = '',
f,
g,
h,
k,
l = 187,
n = 187;
g = a.length;
h = b.length;
k = c.length;
f = g > h ? g : h;
for (var p = 0; p < f; p++) n = l = 187,
p >= g ? n = b.charCodeAt(p) : p >= h ? l = a.charCodeAt(p) : (l = a.charCodeAt(p), n = b.charCodeAt(p)),
e += c.charAt((l ^ n) % k);
return e
}
securityEncode('RDpbLfCPsJZ7fiv', 'password', 'yLwVl0zKqws7LgKPRQ84Mdt708T1qQ3Ha7xv3H7NyU84p21BriUWBU43odz3iP4rBL3cD02KZciXTysVXiV8ngg6vL48rPJyAUw0HurW20xqxv9aYb4M9wK1Ae0wlro510qXeU07kV57fQMc8L6aLgMLwygtc0F10a0Dg70TOoouyFhdysuRMO51yY5ZlOZZLEal1h0t9YQW0Ko7oBwmCAHoic4HYbUyVeU3sfQ1xtXcPcf1aT303wAQhv66qzW')
发布时间:July 24, 2016 // 分类:PHP // No Comments
<?php
ini_set("memory_limit","1800M");
$count = 0;
for ($i = 10000; $i <= 300000000; $i++) {
$count++;
$str[] = $i;
if (($i % 100) == 0) {
shuffle($str);
$a = implode("\n", $str);
$file = mt_rand(0, 10000);
file_put_contents('data/'.$file.'.txt', $a."\n", FILE_APPEND);
$str = array();
}
}
for file in `ls *.txt`;do shuf $file > $file-shuf;done
cat data/*-shuf > shuf-all.txt