分类 系统搭建 下的文章

#!/bin/bash

# 定义源文件夹和目标文件夹
src_dir="path/to/source_directory"
dest_dir="path/to/destination_directory"

# 创建目标文件夹(如果不存在)
mkdir -p "$dest_dir"

# 循环处理源文件夹中的所有文件
for file in "$src_dir"/*
do
    # 检查文件是否是普通文件
    if [ -f "$file" ]; then
        # 获取文件名
        filename=$(basename "$file")
        
        # 使用 iconv 将文件从 GBK 转换为 UTF-8 并写入目标文件夹
        iconv -f GBK -t UTF-8 "$file" > "$dest_dir/$filename"
        
        echo "Converted $filename from GBK to UTF-8"
    fi
done

echo "Conversion complete!"

防火墙状态 service iptables status

永久关闭防火墙 chkconfig iptables off

启用systemctl systemctl disenable auto-proxy.service

停用systemctl systemctl enable auto-proxy.service

查看systemctl所有运行服务 systemctl list-units --type=service --state=running

数据库备份mysqldump -u root -p -A > xx.xql

数据库还原 mysql -uroot -p < xx.xql

查看端口服务监听状态 netstat -nlp |grep LISTEN

查看socat进程个数 ps -ef | grep socat | wc -l

lnmp下开启thinkphp路由 cd到/usr/local/php/etc/php.ini 修改cgi.fix_pathinfo = 1 [修改后——如果没有,自行添加]

将远程服务器映射到本地
ssh -D 127.0.0.1:50000 root@vps.xxxx.com -N

开启jupyter notebook --no-browser --ip=0.0.0.0

ip link set wlp2s0 promisc on

ip link set enp1s0 promisc on

docker stop $(docker ps -a -q) #停止所有服务

docker rm $(docker ps -a -q) #删除所有容器

docker network create -d macvlan --subnet=192.168.10.0/24 --gateway=192.168.10.1 -o parent=wlp2s0 maclan

docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=enp1s0 maclan

docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=enp1s0 macwan

docker network create -d bridge --subnet=192.168.10.0/24 --gateway=192.168.10.1 bridge_openwrt

docker network connect maclan openwrt

docker exec -it openwrt /bin/sh

create_ap -n wlp2s0 -g 192.168.10.21 xxx Donkey1213

ifconfig br-7875544b7a46 192.168.10.20 netmask 255.255.255.0

docker run --restart always -d --name=openwrt --network maclan --privileged kiddin9_openwrt /sbin/init

docker run --restart always -d --name=openwrt --privileged kiddin9_openwrt /sbin/init

docker run --net wifi --privileged -it OpenWrt /bin/bash

docker run --restart always -d --name=OpenWrt --network wifi --privileged kiddin9_openwrt /sbin/init

 docker run –restart always –name openwrt kiddin9_openwrt -d –network openwrt –privileged /sbin/init

nmcli device wifi hotspot con-name xxx ssid xxx password Donkey1213

nmcli connection modify xxx 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared ipv4.address 192.168.10.1/24 ipv4.gateway 192.168.10.2

nmcli connection up xxx

nmcli connection down xxx

nmcli con modify xxx ipv4.method manual

nmcli con modify xxx ipv4.gateway 192.168.10.1

nmcli con modify xxx ipv4.address 192.168.10.3/24

nmcli connection show xxx #查看热点信息

traceroute baidu.com

docker run --net wifi --ip 192.168.10.10 --mac-address=<MAC_ADDRESS> --device=<NIC_DEVICE_NAME> -it myimage /bin/bash

config interface 'lan'

    option ifname 'eth0'
    option proto 'static'
option netmask '255.255.255.0'
option gateway '192.168.0.1'
option ip6assign '60'
option dns '8.8.8.8 114.114.114.114'
option ipaddr '192.168.0.254'
option broadcast '192.168.0.255'

1.创建本地分支 git checkout -b backup origin/backup

2.保存帐号和密码,下次不需要再次输入 git config --global credential .helper store

3.添加到git本地仓库 文件:git add file 目录:git add document -A

4.提交本地仓库 git commit

5.拉取最新 git pull

6.推送到远程 git push

7.只拉起最新一次提交 git clone --depth=1 https://github.com/xxx/xxx.git

Mar 09, 2017 7:17:02 PM io.netty.util.internal.ThreadLocalRandom getInitialSeedUniquifier
WARNING: Failed to generate a seed from SecureRandom within 3 seconds. Not enough entrophy?

安装rng-tools包

以下命令安装rng-tools

yum install rng-tools

启动及检查rngd服务(CentOS 6)

service rngd start
service rngd status

启动及检查rngd服务(CentOS 7)

systemctl start rngd
systemctl status rngd

参考https://huataihuang.gitbooks.io/cloud-atlas/os/linux/device/random_number_generator.html