http://blog.sina.com.cn/s/blog_12ce70a430102v8c7.html
https://www.jianshu.com/p/53405db83c16
https://iancoleman.io/bip39/#english
https://www.hibtc.org/2335.html
http://blog.xuite.net/metafun/life/545924715-HD+Wallet+%E5%88%86%E5%B1%A4%E7%A2%BA%E5%AE%9A%E6%80%A7%28Hierarchical+Deterministic%29%E9%8C%A2%E5%8C%85
https://zhuanlan.zhihu.com/p/34184347
https://www.liaoxuefeng.com/wiki/0015223693709562f80977e6c9549f0a1e17640a61433d6000/0015223800842062cc09cdd70dc45b8992c3b399386673a000
btc hd分层确定性钱包
发布时间:June 16, 2018 // 分类: // No Comments
btc的找零地址及Electrum HD钱包
发布时间:June 12, 2018 // 分类: // No Comments
比特币私钥通过ecc算法生成对应的公钥,地址由公钥通过SHA256算法生成,由于交易时需提供公钥防止有朝一日公钥可以破解私钥,在交易时将剩下的余额转到一个未使用的地址(公钥未泄露)做为找零地址。
如果钱包找零地址是随机生成的且没及时备份可能导致币永久丢失,分层确定性钱包解决了此问题。
Electrum特定的助词生成确定性的bip32 root key(根密钥),然后根据确定性的算法(bip32)可生成无限数量的子私钥和子公钥,只需备份主私钥或助词词就可在任意Electrum客户端上找回所有已用的btc地址。
同时通过主公钥还可生成对应的子公钥,用于冷热钱包。
Electrum的接收地址BIP32 Derivation Path是m/0,找零地址是m/1。
注意通过主公钥和子私钥可算出主私钥。
btc比特币electrum冷热钱包使用
发布时间:June 11, 2018 // 分类: // No Comments
冷机器最好使用物理机器断网,虚拟机宿主机有被远程控制的可能。
离线的机器上使用助记词新建钱包,用私钥在线机器生成的交易数据签名。
使用自定义助词词,相当于给助词词加个密码,防止明文助记词被别人知道。
输入自定义助记词:
复制钱包master public key用作连网的机器上生成原始交易,发送离线机器上签名后的交易数据
在线机器上导入之前复制的public key:
http://docs.electrum.org/en/latest/coldstorage.html#coldstorage
php ssh/expect登录服务器执行命令
发布时间:April 21, 2018 // 分类:PHP // No Comments
<?php
$conn = ssh2_connect('1.1.1.1', 22);
if (!$conn) {
die("conn fail\n");
}
if (ssh2_auth_password($conn, 'root', 'password')) {
echo "auth sus\n";
} else {
die("auth fail\n");
}
$stream = ssh2_exec($conn, "df --output=avail /|tail -n 1");
stream_set_blocking($stream, true);
$res = trim(stream_get_contents($stream));
var_dump($res);
php使用ssh交互式执行命令:
<?php
$host = '192.168.1.1';
$port = 2222;
$pass = 'xxxx';
if (!($conn = ssh2_connect($host, $port, array('hostkey'=>'ssh-rsa')))) {
die("conn fail\n");
}
//注意路径不要使用~/.ssh/id_rsa.pub,会遇到段错误和其它莫名其妙的问题
if (ssh2_auth_pubkey_file($conn, 'root', '/root/.ssh/id_rsa.pub', '/root/.ssh/id_rsa')) {
echo "auth sus\n";
} else {
die("auth fail\n");
}
function expect($stream, $match) {
$time = time();
$res = '';
while(!feof($stream)){
//if (($buffer = fgets($stream, 4096)) !== false) {
if (($buffer = fread($stream, 4096)) !== false) {
$res .= $buffer;
}
if (stristr($res, $match)) {
return 'sus';
}
$now = time();
if (($now - $time) >= 10) {
return 'timeout';
}
usleep(100);
}
return 'disconnect';
}
$shell=ssh2_shell($conn, 'xterm');
fwrite($shell, "/usr/bin/cryptroot-unlock\n");
$res = expect($shell, 'Please unlock disk');
if ($res == 'sus') {
fwrite($shell, "{$pass}\n");
$res = expect($shell, 'set up successfully');
if ($res == 'sus') {
}
var_dump($res);
}
php也可安装expect扩展调用ssh命令交互式执行命令:
apt install php-dev tcl-dev tcl-expect-dev
wget https://pecl.php.net/get/expect-0.4.0.tgz
tar zxvf expect-0.4.0.tgz
cd expect-0.4.0/
phpize
./configure
make && make install
echo 'extension=expect.so' > /etc/php/7.4/cli/conf.d/20-expect.ini
php -m|grep expect
make时如果出现错误php_expect.h:34:10: fatal error: expect_tcl.h: 没有那个文件或目录:
sed -i 's/^INCLUDES =/INCLUDES = -I\/usr\/include\/tcl8.6/' Makefile
php使用expect连接ssh执行命令:
<?php
ini_set("expect.timeout", 2);
ini_set("expect.loguser", "off");
$stream = expect_popen("ssh -o StrictHostKeyChecking=no -p 22 root@www.haiyun.me");
$cases = array(
array("password:", "password"),
array("Last login", "shell"),
array("yes/no)?", "yes/no")
);
while (true) {
switch (expect_expectl($stream, $cases)) {
case "password":
fwrite($stream, "password\n");
break;
case "yes/no":
fwrite($stream, "yes\n");
break;
case "shell":
fwrite($stream, "uptime\n");
break;
case EXP_TIMEOUT:
case EXP_EOF:
break 2;
default:
die("Error has occurred!");
}
}
fclose ($stream);
golang通过smartctl检测硬盘健康状态
发布时间:April 20, 2018 // 分类: // No Comments
先安装smartmontools,以管理员运行,不然不能正常开启smart,可使用smtp发送邮件。
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
"time"
)
func gethd() []string {
cmd := exec.Command("smartctl", "--scan")
//out, err := cmd.CombinedOutput()
out, err := cmd.Output()
//fmt.Println(string(out))
if err != nil {
fmt.Println("exec error", err)
}
stringSlice := strings.Split(string(out), "\n")
devices := []string{}
for _, v := range stringSlice {
if v != "" {
s := strings.Fields(v)
devices = append(devices, s[0])
}
}
return devices
}
func enable_smart(id string) bool {
fmt.Println(id, "enable smart")
cmd := exec.Command("smartctl", "-s", "on", id)
_, err := cmd.Output()
//fmt.Println(string(out))
if err != nil {
fmt.Println("exec smartctl -s on "+id, err)
return false
}
return true
}
func check_smart(id string) bool {
fmt.Println(id, "check smart")
cmd := exec.Command("smartctl", "-i", id)
out, err := cmd.Output()
if err != nil {
fmt.Println("exec smartctl -i "+id, err)
}
if strings.Contains(string(out), "SMART support is: Available") {
fmt.Println(id, "SMART support is: Available")
if strings.Contains(string(out), "SMART support is: Disabled") {
fmt.Println(id, "SMART support is: Disabled")
if !enable_smart(id) {
return false
}
}
return true
} else {
fmt.Println(id, "SMART support is: Unavailable")
}
return false
}
func main() {
err := ioutil.WriteFile("C:/Windows/check_smart.txt", []byte("TESTING!"), 0644)
if err != nil {
fmt.Println("请以管理员身份运行")
time.Sleep(time.Second * 3)
os.Exit(1)
}
devices := gethd()
//fmt.Println(devices)
for _, v := range devices {
if check_smart(v) {
fmt.Println(v, "check health")
cmd := exec.Command("smartctl", "-H", v)
out, err := cmd.Output()
//fmt.Println(string(out))
if err != nil {
fmt.Println("exec smartctl -H "+v, err)
}
if strings.Contains(string(out), "test result: PASSED") {
fmt.Println(v, "test result: PASSED")
} else if strings.Contains(string(out), "SMART Disabled") {
fmt.Println(v, "SMART Disabled")
} else {
fmt.Println(v, "test result: FAILED!")
}
}
fmt.Println("********************************************")
}
}
分类
- Apache (13)
- Nginx (45)
- PHP (86)
- IIS (8)
- Mail (17)
- DNS (16)
- Cacti (14)
- Squid (5)
- Nagios (4)
- Puppet (7)
- CentOS (13)
- Iptables (23)
- RADIUS (3)
- OpenWrt (41)
- DD-WRT (1)
- VMware (9)
- 网站程序 (2)
- 备份存储 (11)
- 常用软件 (20)
- 日记分析 (10)
- Linux基础 (18)
- 欧诺代理 (0)
- Linux服务 (18)
- 系统监控 (4)
- 流量监控 (7)
- 虚拟化 (28)
- 伪静态 (2)
- LVM (3)
- Shell (18)
- 高可用 (2)
- 数据库 (16)
- FreeBSD (3)
- 网络安全 (25)
- Windows (35)
- 网络工具 (22)
- 控制面板 (3)
- 系统调优 (10)
- Cisco (3)
- VPN (6)
- ROS (20)
- Vim (14)
- KMS (4)
- PXE (2)
- Mac (1)
- Git (1)
- PE (1)
- LNS (2)
- Xshell (7)
- Firefox (13)
- Cygwin (4)
- OpenSSL (9)
- Sandboxie (3)
- StrokesPlus (1)
- AutoHotKey (4)
- Total Commander (3)
- WordPress (3)
- iMacros (6)
- Typecho (2)
- Ollydbg (1)
- Photoshop (1)
- 正则 (3)
- Debian (3)
- Python (8)
- NoSQL (6)
- 消息队列 (4)
- JS (7)
- Tmux (3)
- GO (7)
- HHVM (2)
- 算法 (1)
- Docker (2)
- PT (15)
- N1 (16)
- K2P (6)
- LUKS (4)
最新文章
- TEWA-1100G光猫使用
- 烽火光猫HG5382A3使用
- 记联通更换移动XG-040G-MD光猫
- smokeping slave同步错误illegal attempt to update using time解决
- 使用valgrind定位解决smartdns内存泄露
- 此内容被密码保护
- debian12下initramfs-tools配置ip子网掩码255.255.255.255/32失败解决
- iPhone查看屏幕供应商
- 光猫拨号ImmortalWrt/OpenWRT路由获取ipv6遇到的问题
- php-fpm错误error_log日志配置
最近回复
- opnfense: 谢谢博主!!!解决问题了!!!我之前一直以为内置的odhcp6就是唯一管理ipv6的方式
- liyk: 这个方法获取的IPv6大概20分钟之后就会失效,默认路由先消失,然后Global IPV6再消失
- 海运: 不好意思,没有。
- zongboa: 您好,請問一下有immortalwrt設定guest Wi-Fi的GUI教學嗎?感謝您。
- 海运: 恩山有很多。
- swsend: 大佬可以分享一下固件吗,谢谢。
- Jimmy: 方法一 nghtp3步骤需要改成如下才能编译成功: git clone https://git...
- 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
- 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
- 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
归档
- March 2025
- February 2025
- August 2024
- May 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- May 2023
- April 2023
- February 2023
- January 2023
- December 2022
- September 2022
- July 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- April 2021
- March 2021
- February 2021
- January 2021
- December 2020
- November 2020
- October 2020
- September 2020
- July 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- July 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- October 2017
- September 2017
- August 2017
- July 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- July 2016
- June 2016
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- October 2011
- September 2011
- August 2011
- July 2011