Skip to content
Browse files

feat: 5.10 udpate

  • Loading branch information...
alterhu2020 committed May 9, 2019
1 parent 8123fc2 commit d18778f3902450502dbebaad5375d5299b3f4d8f
Showing with 189 additions and 0 deletions.
  1. +1 −0 docs/.vuepress/sidebar.js
  2. +188 −0 docs/blog/2019/
  3. BIN docs/blog/2019/img/pi-install.png
@@ -12,6 +12,7 @@ module.exports ={
title: '2019年',
collapsable: false,
children: [
@@ -0,0 +1,188 @@
title: 5月9日整理

## 前言

> 因为树莓派的SD卡不能读文件,需要重新安装对应的树莓派,开始了今天的折腾记。。。
## 树莓派的安装

1. 下载对应的镜像,看到官方新推了一种镜像,只有基本的桌面的镜像,不像以前的安装很多推荐的软件占了不少空间。。。。

- [镜像地址Raspbian Stretch with desktop](
- [格式化SD Card Format](
- [镜像写入工具 Etcher ](

::: tip 官方安装指南

2. (**注意这一步骤**)开启SSH, 新建 一个`ssh`空文件(无后缀)放在从树莓派拿下的SD卡,连接到电脑上并打开后的Boot目录:


3. 新建一个连接wifi的文件,文件名为: `wpa_supplicant.conf`同样放在从树莓派拿下的SD卡,连接到电脑上并打开显示的Boot目录下, ,With this file in place, Raspbian will move it in `/etc/wpa_supplicant/` when the system is booted. `wpa_supplicant.conf`文件内容格式如下:
ctrl_interface=/var/run/wpa_supplicant GROUP=netdev

或者`sudo nano /etc/wpa_supplicant/wpa_supplicant.conf` 登录后修改查看

4. 初次使用树莓派系统时,默认用户是`pi` ,密码为`raspberry`

sudo systemctl enable ssh
sudo systemctl start ssh
sudo service ssh status
$ ssh root@
5. 查看系统架构 which debian architecture used

> dpkg --print-architecture
6. 更新软件源 :`sudo nano /etc/apt/source.list` 源更新

sudo nano /etc/apt/sources.list #编辑sources.list 文件
deb wheezy main non-free contrib
deb-src wheezy main non-free contrib
deb stretch main contrib non-free rpi
deb-src stretch main contrib non-free rpi

7. 配置树莓派

$ sudo raspi-config
Once prompted, you should select the first option, “1. Expand File System”, hit Enter on your keyboard, arrow down to the “” button, and then reboot your Pi:
After rebooting, your file system should have been expanded to include all available space on your micro-SD card. You can verify that the disk has been expanded by executing df -h and examining the output:

- 改变hostname名称(可选,上面的raspi-config也可以配置)
Edit the Hostname File. Next type: sudo nano /etc/hostname (and then hit enter) ...
Commit the changes. ...
Change the /boot/hostnames file. ...
Reboot the Pi.

> 这里注意还需要修改 /etc/hosts里面的配置否则会报无法解析host的错误:
$ sudo nano /etc/hosts PI

- 改变密码 pi/root(可选,上面的raspi-config也可以配置)

sudo passwd pi
sudo passwd root
sudo passwd --unlock root

8. terminal下不同用户切换

# 切换到root用户
`sudo su -`
# 从root切换到特定的用户
`sudo su - pi`

9. 树莓派mysql安装和配置

sudo apt-get install mysql-server
During the installation, you’ll be asked to set a root password (leaving the spot blank means you’ll have no password).
sudo mysql_secure_installation
In this stage, you’ll have the option to change your root password. Since you only just set it, you might as well say no. Say yes to everything else.

grep -rn "skip-networking" *

## 迁移公众号

> 在关注者与公众号产生消息交互后,公众号可获得关注者的OpenID(加密后的微信号,每个用户对每个公众号的OpenID是唯一的。对于不同公众号,同一用户的openid不同)。公众号可通过本接口来根据OpenID获取用户基本信息,包括昵称、头像、性别、所在城市、语言和关注时间。

## 在ion-content中加入背景图片

ion-content {
--background: url('/assets/img/background/background.png') no-repeat 100% 100%;
--background: #fff url('../../assets/images/cover.jpg') no-repeat center center / cover;
ion-content {
--background: none;
background-image: url('/assets/imgs/page_bg.jpg');
background-position: center top;
background-repeat: no-repeat;
background-size: cover;

## PS 去水印方法

> 暂无
## ionic居中元素

margin: 0 auto;

## `type=number`没有弹出数字键盘

type="tel" pattern="[0-9]*"


## ionic的键盘会将内容弹到顶部,布局混乱

it's bug in ionic, once you focus on any input the keyboard will show up and will add padding-bottom for the scroll-content class to lift the for above the keyboard and it doesn't remove the padding-bottom after you close the keyboard. I tried to check if I have any JS event on the mobile keyboard but we don't so my work around is to set a fixed padding-bottom for the scroll-content class to prevent changing it on the runtime.
.scroll-content {
padding-bottom: 0 !important;
Binary file not shown.

0 comments on commit d18778f

Please sign in to comment.
You can’t perform that action at this time.