在OMV4下使用树莓派3B+的无线网卡

1 更新系统

apt-get update

apt-get upgrade

2 安装rpi-update并更新

apt-get install rpi-update

rpi-update

3 更新固件

wget https://archive.raspberrypi.org/debian/pool/main/f/firmware-nonfree/firmware-brcm80211_20161130-3+rpt4_all.deb

dpkg -i firmware-brcm80211_20161130-3+rpt4_all.deb

4 连接wifi

nmtui connect

解决win10不能访问samba共享问题

0 问题情况

win10 访问samba共享(如linux、NAS等系统的共享文件夹)时,提示“你没有权限访问\IP\folder。请与网络管理员联系请求访问权限。”

1 安装cifs共享支持

在控制面板-程序和功能-启用或关闭 Windows 功能,安装 SMB 1.0/CIFS 文件共享支持中的 SMB 1.0/CIFS 客户端。

2 更改本地组策略

运行 gpedit.msc 打开本地组策略,找到计算机配置-管理模板-网络-Lanman 工作站中的不安全的来宾登录,启用该配置。

3 添加凭证

在控制面板-用户帐户-凭证管理器-管理 Windows 凭据,添加 Windows 凭据,输入samba服务器的网络地址、用户名、密码。

4 重启系统

重启 Windows 10,登录后访问samba服务器,可以利用刚才添加到用户访问到共享。

查看mysql数据库及表编码格式

1.查看数据库编码格式

1mysql> show variables like 'character_set_database';

 2.查看数据表的编码格式

1mysql> show create table <表名>;

 3.创建数据库时指定数据库的字符集

mysql>create database <数据库名> character set utf8;

4.创建数据表时指定数据表的编码格式

create table tb_books (     
name varchar(45) not null,
price double not null,
bookCount int not null,
author varchar(45) not null
)
default charset = utf8;

5.修改数据库的编码格式

mysql>alter database <数据库名> character set utf8;

6.修改数据表格编码格式

mysql>alter table <表名> character set utf8;

7.修改字段编码格式

mysql>alter table <表名> change <字段名> <字段名> <类型> character set utf8; 
mysql>alter table user change username username varchar(20) character set utf8 not null;

 8.添加外键

mysql>alter table tb_product add constraint fk_1 foreign key(factoryid) references tb_factory(factoryid); 
mysql>alter table <表名> add constraint <外键名> foreign key<字段名> REFERENCES <外表表名><字段名>;

9.删除外键

mysql>alter table tb_people drop foreign key fk_1; 
mysql>alter table <表名> drop foreign key <外键名>;

docker-compose命令

#1.docker-compose

Compose 是一款用于使用 Docker 定义和运行复杂应用的工具。借助 Compose,您可以在单个文件中 定义一个多容器应用,然后在一条命令中激增您的应用,该命令可以执行使此应用运行所需完成的全部操作。

也称为: docker-compose, fig

#2.命令
docker-compose build docker-compose build
docker-compose bundle Create a distributed application bundle from the Compose file.
docker-compose config Config validates and view the compose file.
docker-compose create Create creates containers for a service.
Docker Compose release notes Release notes for Docker Compose
docker-compose down docker-compose down
docker-compose events Receive real time events from containers.
docker-compose exec docker-compose exec
docker-compose help docker-compose help
docker-compose images Lists images used by the project.
docker-compose kill Forces running containers to stop.
docker-compose pause Pauses running containers for a service.
docker-compose port Prints the public port for a port binding.s
docker-compose ps Lists containers.
docker-compose pull Pulls service images.
docker-compose push Pushes service images.
docker-compose restart Restarts Docker Compose services.
docker-compose rm Removes stopped service containers.
docker-compose run Runs a one-off command on a service.
docker-compose scale Sets the number of containers to run for a service.
docker-compose start Starts existing containers for a service.
docker-compose stop Stops running containers without removing them.
docker-compose top Displays the running processes.
docker-compose unpause Unpauses paused containers for a service.
docker-compose up Builds, (re)creates, starts, and attaches to containers for a service.

docker笔记

#1.Install packages to allow apt to use a repository over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common

#2.Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

#3.Use the following command to set up the stable repository.
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

#4.Update the apt package index.
sudo apt update

#5.Install the latest version of Docker CE
sudo apt install docker-ce

#6.Ensure that you have a supported version of Docker:
docker version

#7.Verify that Docker CE is installed correctly by running the hello-world image.
sudo docker run hello-world

#8.List the hello-world image that was downloaded to your machine:
docker image ls

#9.List the hello-world container (spawned by the image) which exits after displaying its message. If it were still running, you would not need the --all option:
docker container ls --all

#10.Search the Docker Hub for images
docker search <image>

#11.Start container
docker start <name>

#12.Attach container
docker attach <name>

#13.Commit image
docker commit -m="has update" -a="comet" ea4c82dcd15a comet/ubuntu:v2

#20.Other command
docker build -t friendlyhello . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyhello # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyhello # Same thing, but in detached mode
docker container ls # List all running containers
docker container ls -a # List all containers, even those not running
docker container stop <hash> # Gracefully stop the specified container
docker container kill <hash> # Force shutdown of the specified container
docker container rm <hash> # Remove specified container from this machine
docker container rm $(docker container ls -a -q) # Remove all containers
docker image ls -a # List all images on this machine
docker image rm <image id> # Remove specified image from this machine
docker image rm $(docker image ls -a -q) # Remove all images from this machine
docker login # Log in this CLI session using your Docker credentials
docker tag <image> username/repository:tag # Tag <image> for upload to registry
docker push username/repository:tag # Upload tagged image to registry
docker run username/repository:tag # Run image from a registry

#21.Docker command
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
wait Block until one or more containers stop, then print their exit codes

Reference from :https://docs.docker.com/get-started/

ipa下载的方法

不通过app store发布ipa的要求:

1、ipa的下载地址放到plist的文件中,链接指定plist(plist格式见下文)

2、plist的链接要求一定是https的,而且必须是公网ssl,自签名及免费的https不可用。

3、链接格式要求一定是符合苹果规范的,itms-services://?action=download-manifest&url=https://****/***.plist

plist格式

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>http://xxxxxxxxxxxxxxxxxxx/xxx.ipa</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>http://xxxxxxxxxxxxxxxxxx.png</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>http://xxxxxxxxxxxxxxxxxx.png</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.xxxx.demo</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>XXXX App download</string>
</dict>
</dict>
</array>
</dict>
</plist>