安装xcode
可使用第三方下载工具安装https://github.com/vineetchoudhary/Downloader-for-Apple-Developers
curl -s https://xcdownloader.com/install.sh | bash
精于心,简于形
可使用第三方下载工具安装https://github.com/vineetchoudhary/Downloader-for-Apple-Developers
curl -s https://xcdownloader.com/install.sh | bash
pip3 install click
import click
@click.command()
def hello():
click.echo('hello word')
if __name__ == '__main__':
hello()
●在Click中,可以使用dick .option来定义选项
●option 中设置default为默认选项
●option 中设置help为帮助信息
●option 设置type为数据类型
●option 设置hide_input 可以隐藏输入
●option 设置confirmation_prompt可以脸证输入
●option 设置nargs表示接受多个值
●在Click中,可以使用dick.argument来定义参数
●argument 设置nargs 表示接受多个值
●argument 设置type设定格式
●argument 设置type为click File支持对文件操作
●str : 字符串
●int : 数值
●float : 浮点數
●bool : 布尔值
●click.JUID : UUID值
●clickFile : 文件类型
● click.Path : 文件路径类型
●click.Choice : 可选项类型
●click.IntRange : 数值可选范围
●click.FloatRange : 浮点数可选范围
●click.DateTime : 时间
●Click 提供了dick.prompt要求用户输入
●Click 提供了dlick.confirm要求用户确认
以脚本autostart.sh为例:
#!/bin/bash
#description:开机自启脚本
/usr/local/tomcat/bin/startup.sh #启动tomcat
1、赋予脚本可执行权限(/opt/script/autostart.sh是你的脚本路径)
chmod +x /opt/script/autostart.sh
2、打开/etc/rc.d/rc.local或/etc/rc.local文件,在末尾增加如下内容
cat /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
/usr/local/qcloud/irq/net_smp_affinity.sh >/tmp/net_affinity.log 2>&1
/usr/local/qcloud/cpuidle/cpuidle_support.sh &> /tmp/cpuidle_support.log
/usr/local/qcloud/rps/set_rps.sh >/tmp/setRps.log 2>&1
/usr/local/qcloud/irq/virtio_blk_smp_affinity.sh > /tmp/virtio_blk_affinity.log 2>&1
/usr/local/qcloud/gpu/nv_gpu_conf.sh >/tmp/nv_gpu_conf.log 2>&1
/opt/script/autostart.sh >/root/frp_0.34.1_linux_amd64/frps.log 2>&1 # 自启动脚本
3、在centos7中,/etc/rc.d/rc.local的权限被降低了,所以需要执行如下命令赋予其可执行权限
chmod +x /etc/rc.d/rc.local
Note: If your APK file name contains spaces, make sure you put quotes around it in the adb commands. On OS X and Linux, you may need to prepend ./ to the adb commands.
On your host (PC or other Android device), download your desired Kodi APK
Open a Command Prompt (Windows), Terminal (OS X/Linux), or Terminal Emulator app (Android)
Navigate (CD) to the directory with your Kodi APK (In Terminal Emulator on Android you only need to run the adb commands)
Run the following commands
adb kill-server
adb start-server
adb connect <ip-address-of-fire-tv>
ADB is connected when it reports the message "connected to
Run one of the following commands
adb install <apk-file-name>
(or if you are upgrading from a previous Kodi install, use this instead)
adb install -r <apk-file-name>
Installation is complete when it reports the message "success"
(Note: For Android you need to type in the full path. e.g. >adb install /sdcard/Download/apk-file-name.apk)
Omniedge's Peer-to-Peer Layer 2 VPN solutions are not only a great and affordable network solution for a small team but also for big companies with thousands of computers all around the world.
https://omniedge.io/
sqlite3版本太低导致,升级sqlite3
脚本:
#!/bin/bash
sqlite3 --version
wget https://www.sqlite.org/2022/sqlite-autoconf-3370200.tar.gz
tar -xaf sqlite-autoconf-3370200.tar.gz
cd sqlite-autoconf-3370200/
./configure --prefix=/usr/local/
make && make install
mv /usr/bin/sqlite3 /usr/bin/sqlite3.bak
ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3
echo export LD_LIBRARY_PATH="/usr/local/lib">> ~/.bashrc
source ~/.bashrc
sqlite3 --version
#!/bin/bash #约定标记
echo "Hello World !"
shell执行:
chmod +x shell.sh
./shell.sh
变量名= "变量值"
for file in `ls .`;do
echo "$file"
done
# 列出当前目录下的文件名
只读变量
readonly 变量名
删除变量
unset 变量名
字符串
单双引号区别
字符串拼接
your_name="runoob"
# 使用双引号拼接
greeting="hello, "$your_name" !"
greeting_1="hello, ${your_name} !"
echo $greeting $greeting_1
# 使用单引号拼接
greeting_2='hello, '$your_name' !'
greeting_3='hello, ${your_name} !'
echo $greeting_2 $greeting_3
获取字符串长度
string="abcd"
echo ${#string} #输出 4
字符串截取
# ## 删除左边,保留右边 echo ${var##*字符} 两个#表示最后一个字符
% %% 删除右边,保留左边 echo ${var%字符*} 两个%表示最后一个字符
pip3 install pipreqs
进入项目主目录
pipreqs ./
生成requirements.txt
安装依赖库:
sudo pip3 install -r requirements.txt
https://curlconverter.com/#
crontab [ -u user ] { -l | -r | -e }
参数说明:
-e : 执行文字编辑器来设定时程表,内定的文字编辑器是 VI,如果你想用别的文字编辑器,则请先设定 VISUAL 环境变数来指定使用那个文字编辑器(比如说 setenv VISUAL joe)
-r : 删除目前的时程表
-l : 列出目前的时程表
* * * * *
- - - - -
| | | | |
| | | | +----- 星期中星期几 (0 - 6) (星期天 为0)
| | | +---------- 月份 (1 - 12)
| | +--------------- 一个月中的第几天 (1 - 31)
| +-------------------- 小时 (0 - 23)
+------------------------- 分钟 (0 - 59)
0 */2 * * * /sbin/service httpd restart 意思是每两个小时重启一次apache
50 7 * * * /sbin/service sshd start 意思是每天7:50开启ssh服务
50 22 * * * /sbin/service sshd stop 意思是每天22:50关闭ssh服务
0 0 1,15 * * fsck /home 每月1号和15号检查/home 磁盘
1 * * * * /home/bruce/backup 每小时的第一分执行 /home/bruce/backup这个文件
00 03 * * 1-5 find /home "*.xxx" -mtime +4 -exec rm {} \; 每周一至周五3点钟,在目录/home中,查找文件名为*.xxx的文件,并删除4天前的文件。
30 6 */10 * * ls 意思是每月的1、11、21、31日是的6:30执行一次ls命令
查看已创建任务:
[root@VM-16-2-centos yokai]# crontab -l
*/5 * * * * flock -xn /tmp/stargate.lock -c '/usr/local/qcloud/stargate/admin/start.sh > /dev/null 2>&1 &'
[root@VM-16-2-centos yokai]#
进入命令配置界面:
crontab -e
vi编辑配置文件
:wq 退出保存
**注意:**当程序在你所指定的时间执行后,系统会发一封邮件给当前的用户,显示该程序执行的内容,若是你不希望收到这样的邮件,请在每一行空一格之后加上 > /dev/null 2>&1 即可,如:
20 03 * * * . /etc/profile;/bin/sh /var/www/runoob/test.sh > /dev/null 2>&1