海运的博客

n1盒子降级刷官改系统

发布时间:October 8, 2018 // 分类:N1 // No Comments

开启adb,点击版本号3次,提示调试模式开启,配置无线连接获取IP,用adb连接IP重启到fastboot模式。
windows下的adb和fastboot工具:https://dl.google.com/android/repository/platform-tools-latest-windows.zip

adb connect 192.168.168.239
adb shell reboot fastboot

刷入降级分区:http://www.right.com.cn/forum/thread-322223-1-1.html
重新启动后进入logo界面,使用双公头usb线连接电脑和挨着盒子hdmi旁边的那个usb口,设备管理器更新驱动,然后使用fastboot降级,不降级不能线刷官改系统。

c:\platform-tools>fastboot.exe devices
CAQDB3064K12828 fastboot

c:\platform-tools>fastboot.exe flash boot boot.img
Sending 'boot' (13858 KB)                          OKAY [  0.641s]
Writing 'boot'                                     OKAY [  0.534s]
Finished. Total time: 1.188s

c:\platform-tools>fastboot.exe flash bootloader bootloader.img
Sending 'bootloader' (656 KB)                      OKAY [  0.048s]
Writing 'bootloader'                               OKAY [  0.047s]
Finished. Total time: 0.109s

c:\platform-tools>fastboot.exe flash recovery recovery.img
Sending 'recovery' (17866 KB)                      OKAY [  0.813s]
Writing 'recovery'                                 OKAY [  0.797s]
Finished. Total time: 1.640s

c:\platform-tools>fastboot.exe reboot
Rebooting
Finished. Total time: 0.000s

如果仅使用armbian/linux系统可以略过下面的部分了。
刷入官改系统,http://www.right.com.cn/forum/thread-338759-1-1.html
安装USB_Burning_Tool_v2.1.6线刷工具,导入镜像去除勾选擦除flash和擦除bootloader,用双公头usb线连接电脑和盒子(靠近hdmi usb),点击开始,然后用adb连接盒子重启到刷机模式:

adb shell reboot update 

2018-10-08_074823.png
启动后会自动开始刷机,等进度条变成绿色并显示100%烧录完成时点击停止,关闭USB_Burning_Tool,断开usb线,断电重启盒子即可进入新系统。

参考:
https://www.mivm.cn/phicomm-n1-unofficial/
https://github.com/jxjhheric/n1-setup
https://chisec.cc/phicomm-fucking/

小内存VPS通过网络重新安装Centos7系统指定安装时运行镜像位置

发布时间:October 6, 2018 // 分类: // No Comments

centos7网络安装启动后会从网络获取安装时运行的镜像,默认从安装源目录.treeinfo文件中读取,如在ks文件中指定url --url=http://mirror.centos.org/centos/7/os/x86_64,.treeinfo文件信息如下:

curl http://mirror.centos.org/centos/7/os/x86_64/.treeinfo
[general]
name = CentOS-7
family = CentOS
timestamp = 1525379658.57
variant = 
version = 7
packagedir = 
arch = x86_64

[stage2]
mainimage = LiveOS/squashfs.img

[images-x86_64]
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img
boot.iso = images/boot.iso

[images-xen]
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img

如果没有.treeinfo文件则从从LiveOS目录中取squashfs.img,由于squashfs.img文件较大,默认从HTTP安装时获取squashfs.img文件再运行会占用很大的内存,测试安装centos7 1.5G以上内存才能正常安装,对于512M左右的内存的VPS可以将squashfs.img文件放到本地硬盘或NFS上,这样小内存VPS也能通过网络重新安装centos7系统了。
1.通过本地硬盘,缺点是所占用的分区不能在重新安装系统时更改,如将squashfs.img文件放到sda2分区/LiveOS/目录中,在引导项中指定inst.stage2参数:

linux16 /vmlinuz inst.stage2=hd:sda2:/

2.通过NFS,同样将squashfs.img文件放到导出/mnt分区/LiveOS/目录中,这样安装系统时可使用整个硬盘。

#nfsvers=4 nfs服务器为版本4,默认是3
inst.stage2=nfs:nfsvers=4:www.haiyun.me:/mnt/

其它可参考:
通过ipxe自动安装centos/ubuntu系统:https://www.haiyun.me/archives/1246.html
网络安装centos/ubuntu自动配置脚本:https://www.haiyun.me/archives/1250.html

ubuntu自动安装preseed分区方法

发布时间:October 6, 2018 // 分类: // No Comments

使用自动分区,标准分区方式:

#d-i partman-auto/disk string /dev/sda
#选择第一个硬盘
d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_091417.png

自动LVM分区:

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string 100%
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_091702.png

使用自定义标准分区方案,第一个数字为最小分区大小(MB),第二个获取最大分区的优先级(越小优先级越高),第三个最大分区大小。

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true

d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              5120 1 5120 ext4                                \
                     $primary{ } $bootable{ }                 \
                     method{ format } format{ }               \
                     use_filesystem{ } filesystem{ ext4 }     \
                     mountpoint{ /}                           \
              .                                               \
              1 3 -1 ext4                                     \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /home}                      \
              .                                               \
              1024 2 1024 linux-swap                          \
                      $primary{ }                             \
                      method{ swap } format{ }                \
              .

d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_084106.png

使用自定义分区LVM:

d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select boot-lvm
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string 100%
d-i partman-auto-lvm/new_vg_name string vg00
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true

d-i partman-auto/expert_recipe string                         \
      boot-lvm ::                                             \
              1024 1 1024 ext4                                \
                      $primary{ } $bootable{ }                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /boot }                     \
              .                                               \
              1 2 -1 ext4                                     \
                      $primary{ }                             \
                      $defaultignore{ }                       \
                      method{ lvm }                           \
                      device{ /dev/sda }                      \
                      vg_name{ vg00 }                         \
              .                                               \
              1024 3 1024 swap                                \
                      $lvmok{ } lv_name{ lv_swap } in_vg{ vg00 } \
                      method{ swap } format{ }                   \
          .                                                      \
              1 4 -1 ext4                                        \
                      $lvmok{} lv_name{ lv_root } in_vg{ vg00 }  \
                      method{ format } format{ }                 \
                      use_filesystem{ } filesystem{ ext4 }       \
                      mountpoint{ / }                            \
          .                                                      

d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4
d-i partman/mount_style select uuid

2018-10-06_090807.png
通过preseed自动安装ubuntu系统详细配置文件见:https://www.haiyun.me/archives/1246.html
参考:
https://stackoverflow.com/questions/33923952/ubuntu-14-04-preseed-lvm-disk-config
https://cptyesterday.wordpress.com/2012/06/17/notes-on-using-expert_recipe-in-debianubuntu-preseed-files/

ubuntu18.04编译qbittorrent4.13和libtorrent1.0.11

发布时间:October 5, 2018 // 分类:PT // No Comments

qbittorrent4在使用libtorrent最新版本1.1.9版本时有诸多问题,编译使用1.0.11稳定版本试试。
安装编译环境及libtorrent依赖:

apt-get install build-essential pkg-config automake libtool git
apt-get install libboost-dev libboost-system-dev libboost-chrono-dev libboost-random-dev libssl-dev libgeoip-dev

编译libtorrent:

git clone https://github.com/arvidn/libtorrent.git
#之前系统版本可直接下载源码使用,18.04需修改include/libtorrent/export.hpp替换boost/config/为boost/config/detail/
#https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_0_11/libtorrent-rasterbar-1.0.11.tar.gz
cd libtorrent
git checkout origin/RC_1_0
./autotool.sh
./configure --prefix=/usr/local/libtorrent CXXFLAGS=-std=c++11
make clean && make -j$(nproc)
make install
echo '/usr/local/libtorrent/lib' > /etc/ld.so.conf.d/libtorrent-x86_64.conf 
ldconfig
export CPLUS_INCLUDE_PATH=/usr/local/libtorrent/include/
export PKG_CONFIG_PATH=/usr/local/libtorrent/lib/pkgconfig/

安装qbittorrent依赖及编译:

apt-get install qtbase5-dev qttools5-dev-tools libqt5svg5-dev zlib1g-dev
wget https://github.com/qbittorrent/qBittorrent/archive/release-4.1.3.tar.gz
tar zxvf release-4.1.3.tar.gz 
cd qBittorrent-release-4.1.3/
./configure --prefix=/usr/local/qbittorrent --disable-gui
make clean && make -j$(nproc)
make install
export PATH=$PATH:/usr/local/qbittorrent/bin/
echo 'export PATH=$PATH:/usr/local/qbittorrent/bin/' >> ~/.bashrc

centos/linux使用vnstat统计流量

发布时间:October 4, 2018 // 分类: // No Comments

vnstat安装:

yum install vnstat
systemctl start vnstat
systemctl enable vnstat

修改默认网卡:

sed 's/Interface ".*/Interface "eth0"/' /etc/vnstat.conf

按小时统计:

vnstat -h
vnstat -i eth0 -h

按天统计:

vnstat -d

实时流量:

vnstat -l -i ens33
分类
最新文章
最近回复
  • 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 ...
归档