2018年7月14日 星期六

树莓派基于 Samba 实现 NAS 系统

入手Raspberry Pi 3,集成了WIFI+bluetooth,对于搭建NAS更加易如反掌,通过Samba实现NAS系统与PC共享文件。
需要安装的软件:
sudo apt-get install samba samba-common-bin
sudo apt-get install netatalk (用于支持AFP)
sudo apt-get install avahi-daemon(用于支持网内的计算机自动发现)

U盘如何恢复原始容量 或者格式化

经常使用U盘制作系统安装盘后,发现U盘显示仅有几十兆或者几百兆,采取常规格式化均没有效果,无法恢复U盘原来的容量。

虽然有许多软件可用,但是现在软件很多猫腻,不想安装那些软件,只有这种利用系统自身的功能来实现了 :
1、我的电脑===》磁盘管理==》U盘索引,如:磁盘 1
    2、在Dos运行环境下,运行Diskpart
    3、select disk 1
    4、clean,提示此磁盘已经清理
    5、重新新建简单卷,即可释放
==========================================
路由器执行
mkfs.ext4 /dev/sda1
加载盘或者卸载
mount /dev/sda
umount /dev/sda
查看盘符
fdisk -l
df

Shadowsocks-libev 服务无法正常启动 libmbedcrypto

cnetos 7.0中,shadowsocks-libev照常安装完毕,发现无法正常启动
其中可以试一试以下的解决办法:
cd  /usr/lib64
ln -s libmbedcrypto.so.1  libmbedcrypto.so.0

Centos7 yum方式升级内核

cat /etc/system-release
cat /etc/issue
uname -r

一、安装elrepo的yum源
升级内核需要使用elrepo的yum源,在安装yum源之前还需要我们导入elrepo的key,如下:
elrepo的key安装完毕后,我们下面开始正式升级内核。

How to install shadowsocks-libev on Centos 7

The following unofficial repositories are provided as-is by owner of this project. Contact the owner directly for bugs or issues (IE: not bugzilla).
Release
Architectures
Repo Download
Epel for  CentOS 6 i386 (25)*, x86_64 (76)* Epel 6 (6170 downloads)
Epel for  CentOS 7 x86_64 (313)* Epel 7 (5555 downloads)
 Fedora 25 i386 (0)*, x86_64 (17)* Fedora 25 (0 downloads)

Vmess 无法连接问题解决了

修改时区
rm -rf /etc/localtime #先删除默认的时区设置
ln -s /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime
手工修改当前系统的时间
date -s ’12:12:12 2018-01-01′
设置同步时间
ntpdate us.pool.ntp.org
设置同步服务器时间,安装完毕之后,我们用date测试下当前时间。
这里需要先安装yum install -y ntp
解决了Vmess 无法连接的问题

Install DenyHost On CentOS 6&7

Download the EPEL repository with the following command:
Install the Deny Hosts package with the following:
  • sudo yum install denyhosts
You can further configure any settings in the DenyHosts.conf file by going to the following and updating according to your preference.
  • nano /etc/denyhosts.conf

How to create systemd unit file aria2.service

nano /etc/systemd/system/aria2.service
[Unit]
Description=Aria2
After=syslog.target
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/aria2c –conf-path=/root/.aria2/aria2.conf
Restart=always
[Install]
WantedBy=multi-user.target

How to create systemd unit file calibre.service

nano /etc/systemd/system/calibre.service
[Unit]
Description=Calibre Service
After=network.target
[Service]
ExecStart=/usr/bin/calibre-server\
–enable-use-bonjour \
–port 8080 \
–log=/opt/calibre/calibre.log \
/root/calibre-library
[Install]
WantedBy=multi-user.target

Transmission config 修改

sudo service transmission-daemon reload
这一步很关键,如果不reload,直接restart,后面修改的json内容将被还原

Linux挂载硬盘fstab

# /etc/fstab: static file system information.
#
# Use ‘blkid’ to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/DBOS–vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sde2 during installation
UUID=9dc1f1a3-22d6-42ef-a550-be8fb2c865aa /boot ext2 defaults 0 2
# /boot/efi was on /dev/sde1 during installation
UUID=063C-C7C2 /boot/efi vfat umask=0077 0 1
/dev/mapper/DBOS–vg-swap_1 none swap sw 0 0
/dev/sdb1 /mnt/A    ext4 defaults 0 2
/dev/sdc1 /mnt/B     ext4 defaults 0 2
/dev/sda1 /mnt/C     ext4 defaults 0 2
/dev/sdd1/mnt/D     ext4 defaults 0 2

CentOS7安装PHP最新版

yum -y remove php*
yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

Deploy Google BBR on CentOS 7

centos kernel version must 4.9 or newest

echo ‘net.core.default_qdisc=fq’ | sudo tee -a /etc/sysctl.conf
echo ‘net.ipv4.tcp_congestion_control=bbr’ | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
sudo sysctl net.ipv4.tcp_available_congestion_control
sudo sysctl -n net.ipv4.tcp_congestion_control

Calibre_web administrator password forget

Calibre_web administrator password forget how to reset the admin password: need to specify the app.db docker exec -it calibre-web cd...