页面“树莓派基础”与“检测指定文件夹内的ipa的版本号”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
(导入1个版本)
 
docker>Evan
(创建页面,内容为“<pre> #!/bin/bash for ipas in $1/* do if [ "${ipas##*.}" = "ipa" ];then if [ ! -d "Payload" ]; then unzip -q $ipas fi ipa=$...”)
 
第1行: 第1行:
=buy=
 
有空买个4
 
树莓派 3 Model B+,其价格仍是 34.95 美元(¥238 RMB)
 
原来那家服务态度非常不好 换一家
 
 
[https://mall.jd.com/index-153636.html 树莓派jd专卖店]
 
 
 
== 要买的配件==
 
HDIM 线, 5V 3A 电源线,散热片,外壳带风扇,闪迪卡  其实OS安装完后 只要 电源 连上网 直接ssh
 
 
==版本==
 
最早代工厂UK的SONY,然后是中国E14,前几个月又开设第三代工厂日本的RS Components,理论上没区别。
 
因为博通的Soc一般人也搞不到,所以树莓派也没有假冒。
 
 
基金会和 Element14(易络盟电子)在英国伦敦全球同步发售树莓派2代B型,当然全球还有另外一个代理商RS(欧时电子)也一样有全球的销售权。
 
 
三个版本我都有,英国版价格最贵用料一般u口的质量不如中国版,英国版还有很大的糊味。
 
中国版包装最漂亮,清晰脱俗
 
日版价格低廉好像噪音大一些
 
 
DIY过程中,分别同位置切割三个版本电路板,最后日版直接不开机,英国版tf口不读卡,中国版一切正常。暴力测试仅供参考
 
 
当RS版和E络盟版放在一起之后,我们先从外包装上看,E络盟包装盒不失美观且硬度强,里面还附有一本多国语言资料,显得有档次,而RS版树莓派外包装,也美观,但是太柔软啦,经不起外力压迫,拿在手上瞬间掉档。
 
再看USB卡槽,E络盟是打了盘符的,为安普品牌的,RS则没有,根据惯例可能是山寨的。
 
再看摄像头插槽,E络盟为黑色,RS为白色,但当我们使用的时候会发现,RS的摄像头插槽比较松弛,间歇大,虽然不影响使用,但是时间久了,谁知道会不会出现问题呢,再看E络盟的摄像头插槽,不松弛间歇合理。
 
接着我们再看大家反映的最普遍的问题,这个问题丛B+版本就开始出现,那就是TF卡槽,两种版本外观上看不出来区别,但是RS版本经常出现一个问题,将TF卡插进之后,居然可以拔出来,虽然不影响使用,但让我们不得不怀疑RS的做工啊,国产山寨手机的TF卡槽貌视也没有这个问。
 
就说这几点吧,至于焊接问题,RS说他们采用的焊接技术先进,E络盟也说他们采用的技术更先进,我只能说都不影响使用,但通过以上几点可能让我对E络盟的更有信心,当今世界顶级的电子设备基本都是外国研发中国制造。RS的背面就不说了啊,像修过一样,脏。
 
 
[http://tieba.baidu.com/p/3582699166?pid=68736180608&cid=0# Element14和RS版本的区别 ]
 
 
=install=
 
 
Raspbian Jessie With PIXEL 和 Raspbian Jessie Lite,它们的区别在于前者带有 PIXEL 的图形界面易用性更高,后者是不带图形界面的版本,特点是占用空间非常小。(我自己有一个项目不需要图形界面,且
 
 
[https://www.raspberrypi.org/downloads/raspbian/ Raspbain Stretch Lite 树莓派官方系统,不带图形界面 下载]
 
 
[https://blog.csdn.net/kxwinxp/article/details/78370913 树莓派3B+ 安装系统]
 
 
[https://blog.csdn.net/weixin_39449466/article/details/80686835 树莓派3B+安装系统(Raspbian]
 
 
[https://post.smzdm.com/p/738951/ 树莓派3B+折腾记 篇一:入门折腾—系统安装]
 
[https://sspai.com/post/38542 树莓派入门指南|明明白白玩 Pi 系列]
 
 
[http://wiki.nxez.com/rpi:list-of-oses 树莓派操作系统大全]
 
 
[https://my.oschina.net/swtar/blog/867200 树莓派,我们走! - 选购]
 
 
[https://www.kali.org/tutorials/secure-kali-pi-2018/ Secure Kali Pi 2018]
 
 
=openssh=
 
 
<pre>
 
<pre>
Launch Raspberry Pi Configuration from the Preferences menu
+
#!/bin/bash
Navigate to the Interfaces tab
+
for ipas in $1/*
Select Enabled next to SSH
+
do
Click OK
+
    if [ "${ipas##*.}" = "ipa" ];then 
</pre>
+
        if [ ! -d "Payload" ]; then
 
+
          unzip -q $ipas
在 /boot/ 目录 touch a file call  ssh
+
        fi
Linux 用户打开 TF 卡中名称为 boot 且内存较小的主分区),在 TF 卡根目录放置一个名为 ssh 的空白文件(注:无后缀名
 
 
 
https://www.raspberrypi.org/documentation/remote-access/ssh/
 
 
 
=docker=
 
<pre>#一 开始基于debian 以后基于apline  docker build
 
sudo systemctl enable docker
 
sudo systemctl start docker
 
 
 
注意官方
 
Raspbian users cannot use this method!
 
 
 
For Raspbian, installing using the repository is not yet supported.
 
 
 
</pre>
 
 
 
#最方便就是直接apt哈哈
 
apt-get install docker.io -y
 
直接下载包安装
 
不是 arm64/ 不要搞错了 不然会  On Raspberry Pi, BUILD_EXCLUSIVE directive does not match this kernel/arch
 
  
err
+
        ipa=$(basename ${ipas##*/} .ipa)
docker.socket: Failed with result 'service-start-limit-hit'
+
        version=`plutil -p Payload/*.app/Info.plist | grep 'CFBundleShortVersionString'|cut -d '"' -f 4`
</pre>
 
  
https://download.docker.com/linux/debian/dists/stretch/pool/stable/armhf/
+
        echo ${ipa}" 版本="${version} >> $1/version.txt
 +
        rm -rf  Payload META-INF
 +
  fi
 +
done
  
https://mirrors.aliyun.com/docker-ce/linux/raspbian/dists/
 
  
 +
Mac-mini:chuan$ ls src/
 +
bb.ipa cc.ipa
 +
Mac-mini:chuan$  sh evan.sh  src/
 +
Mac-mini:chuan$  cat src/version.txt
 +
bb 版本=1.0.0
 +
cc 版本=1.0.0
  
 +
检测指定文件夹内的ipa的版本号
 +
http://www.jianshu.com/p/8178962aba8e
  
== 10==
 
<pre>
 
  
要等正式版本
+
if else以及大于、小于、等于逻辑表达式
  
curl -fsSL https://get.docker.com -o get-docker.sh
+
==比较容易混的知识点==
sudo bash get-docker.sh
 
  
 +
shell 字符串比较:
 +
=                          等于          if [ "$a" = "$b" ]
 +
==                        与=等价
  
 
root@mypi3b:~/tmp# journalctl -xe
 
Jul 11 11:46:43 mypi3b systemd[1]: docker.service: Start request repeated too quickly.
 
Jul 11 11:46:43 mypi3b systemd[1]: docker.service: Failed with result 'exit-code'.
 
 
 
 
 
 
 
 
 
</pre>
 
https://docs.docker.com/install/linux/docker-ce/debian/#install-using-the-convenience-script
 
 
 
https://segmentfault.com/a/1190000017109351
 
 
[https://zhuanlan.zhihu.com/p/29225234 使用 Docker 玩转树莓派]
 
 
[http://gdzrch.win/post/Get-Started-with-Docker-on-Raspberry-Pi.html 在树莓派上安装docker环境]
 
 
[https://post.smzdm.com/p/591985/ 树莓派+Docker—轻松打造自己的智能家居控制中心]
 
 
[https://juejin.im/post/5af867c3518825673e35b9bd 在树莓派上学习 Docker —— Part 1]
 
 
[https://yeasy.gitbooks.io/docker_practice/install/raspberry-pi.html 树莓派安装 Docker CE]
 
 
[https://www.jianshu.com/p/e4f4b42aa167 ubuntu主机上docker服务不能启动]
 
 
=network wifi=
 
搞半天 原来是ssh 没有启动呀
 
其实就是用 raspi-config --Network Options--Wi-fi
 
<pre>
 
#cat /etc/wpa_supplicant/wpa_supplicant.conf #is me
 
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 
update_config=1
 
country=CN
 
 
network={
 
ssid="evan"
 
psk="evan886"
 
}
 
 
</pre>
 
 
<pre>
 
则在根目录在放置一个名为 wpa_supplicant.conf 的文件,文件内容如下:
 
 
country=CN
 
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 
update_config=1
 
 
network={
 
    ssid="WiFi-A"
 
    psk="12345678"
 
    key_mgmt=WPA-PSK
 
    priority=1
 
}
 
 
network={
 
    ssid="WiFi-B"
 
    psk="12345678"
 
    key_mgmt=WPA-PSK
 
    priority=2
 
    scan_ssid=1
 
}
 
其中,
 
 
ssid:网络的ssid,即Wi-Fi名称
 
psk:Wi-Fi密码
 
priority:Wi-Fi优先级,数字越大优先级越高(不可为负)
 
scan_ssid:连接隐藏WiFi时需要指定该值为1
 
注,
 
 
如果 Wi-Fi 没有密码,网络配置部分为:
 
 
network={
 
    ssid="Wi-Fi 名称"
 
    key_mgmt=NONE
 
}
 
如果 Wi-Fi 使用 WEP 加密,网络配置部分为:
 
 
network={
 
    ssid="Wi-Fi 名称"
 
    key_mgmt=NONE
 
    wep_key0="Wi-Fi 密码"
 
}
 
如果 Wi-Fi 使用 WPA/WPA2 加密,网络配置部分为:
 
 
network={
 
    ssid="Wi-Fi 名称"
 
    key_mgmt=WPA-PSK
 
    psk="Wi-Fi 密码"
 
}
 
 
</pre>
 
</pre>
  
[https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md  SETTING WIFI UP VIA THE COMMAND LINE]
+
If else以及大于、小于、等于逻辑表达式
 
+
https://wiki.linuxchina.net/index.php?title=If_else%E4%BB%A5%E5%8F%8A%E5%A4%A7%E4%BA%8E%E3%80%81%E5%B0%8F%E4%BA%8E%E3%80%81%E7%AD%89%E4%BA%8E%E9%80%BB%E8%BE%91%E8%A1%A8%E8%BE%BE%E5%BC%8F
[https://www.jianshu.com/p/e22331d62a16 树莓派连接wifi配置]
 
 
 
[https://blog.csdn.net/huayucong/article/details/51376279 树莓派3代-命令行配置wifi无线连接]
 
 
 
[http://shumeipai.nxez.com/2017/09/13/raspberry-pi-network-configuration-before-boot.html 无屏幕和键盘配置树莓派WiFi和SSH]
 
 
 
[http://shumeipai.nxez.com/2018/03/13/raspberry-pi-double-network-cards-for-wireless-hotspot.html 树莓派加无线网卡配置WIFI热点的方法]
 
 
 
https://blog.csdn.net/Meteor_s/article/details/80875784
 
 
 
=国内源=
 
<pre> deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch  main contrib non-free rpi
 
 
 
#更新debian 10
 
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ buster  main contrib non-free rpi
 
</pre>
 
 
 
=添加风扇=
 
[https://testerhome.com/topics/8068  树莓派 根据 CPU 温度控制风扇起停]
 
[http://www.shumeipaiba.com/yingjian/peijian/9.htmlb 树莓派2B Raspberry Pi风扇安装]
 
 
 
https://jingyan.baidu.com/article/64d05a0216835fde55f73b39.html
 
 
 
==控制风扇==
 
[https://www.cnblogs.com/WeiG/p/9856194.html 修改树莓派的风扇,使风扇能够随温度变化而启停]
 
 
 
[http://yshblog.com/blog/55 树莓派用开关三极管控制散热风扇]
 
 
 
[https://wusiyu.me/%E8%AE%A9%E6%A0%91%E8%8E%93%E6%B4%BE%E6%A0%B9%E6%8D%AE%E6%B8%A9%E5%BA%A6%E8%87%AA%E5%8A%A8%E6%8E%A7%E5%88%B6%E6%95%A3%E7%83%AD%E9%A3%8E%E6%89%87%E7%9A%84%E5%90%AF%E5%81%9C/ 让树莓派根据温度自动控制散热风扇的启停]
 
 
 
 
 
[https://testerhome.com/topics/8068 树莓派 根据 CPU 温度控制风扇起停]
 
[http://shumeipai.nxez.com/2017/07/13/raspberry-pi-to-achieve-temperature-monitoring-and-control-fan-cooling.html 树莓派实现温度监控并控制风扇散热]
 
 
 
[https://blog.csdn.net/qq_15947947/article/details/79637718 修改树莓派的风扇,使风扇能够随温度变化而启停]
 
 
 
[https://blog.csdn.net/qq_15947947/article/details/79178032 树莓派风扇散热自动控制]
 
 
 
[https://blog.csdn.net/oschina_41734362/article/details/80148833 树莓派3B设置温控风扇(简略版)]
 
 
 
另外一个案
 
 
 
[https://blog.csdn.net/u010177891/article/details/80386821 树莓派根据温度自动控制风扇降温]
 
 
 
[https://blog.csdn.net/u012077354/article/details/81240950 树莓派散热风扇自动启停]
 
 
 
升级
 
 
 
自启动
 
编辑linux服务脚本并添加到/etc/init.d/,chkconfig add autofun
 
 
 
==Pi Dashboard==
 
 
 
Pi Dashboard是树莓派实验室发布的一个开源的 IoT 设备监控工具,目前主要针对树莓派平台,也尽可能兼容其他类树莓派硬件产品。你只需要在树莓派上安装好 PHP 服务器环境,即可方便的部署一个 Pi 仪表盘,通过炫酷的 WebUI 来监控树莓派的状态!
 
项目主页:http://maker.quwj.com/project/10
 
GitHub地址:https://github.com/spoonysonny/pi-dashboard
 
 
 
=wiki=
 
[[Docker 安装mediawiki]]
 
==Leanote==
 
[[Leanote]]
 
 
 
=crontab=
 
[https://www.raspberrypi.org/documentation/linux/usage/cron.md SCHEDULING TASKS WITH CRON]
 
 
 
=正确关机=
 
很多人会这样想:既然接上电源自动开机,那么拔掉电源不就关了机。这种关机相当于非正常关机(比如突然断电), 长期地非正常关机会损坏树莓派的SD卡。
 
正确的关机方法是
 
1 先执行下面的命令
 
poweroff
 
sudo shutdown -h now 或 sudo halt
 
2 当上面的命令执行后,会发现在树莓派的LED状态指示灯中,只有PWR指示灯(电源指示灯)亮着,其他的指示灯都不亮,说明系统已经关闭了。接下来拔掉电源,PWR指示灯随即熄灭。这样才是正确的关机
 
 
 
=Dashboard=
 
[http://shumeipai.nxez.com/2017/08/31/pi-dashboard-released.html Pi Dashboard:给你的派装一个仪表盘]
 
 
 
 
 
=lnmp=
 
[[Docker lnmp]]
 
这些要 docker 化 除了nginx
 
 
 
[https://sb.sb/blog/debian-install-nginx-php-mysql/ Debian 9  使用源安装 LEMP 教程]
 
 
 
[https://getgrav.org/blog/raspberrypi-nginx-php7-dev Raspberry Pi Dev Setup with Nginx + PHP7]
 
 
 
[https://janw.me/2017/installing-php7-2-rapsberry-pi/ Installing PHP7.2 on a Rapsberry Pi]
 
 
 
=vnc=
 
[https://www.raspberrypi.org/documentation/remote-access/vnc/README.md  VNC (VIRTUAL NETWORK COMPUTING)]
 
 
 
=区别=
 
对于Arduino来讲,它是一个单片机,在机器里不会运行现有的通用OS,它更多的就是一个通过setup和loop接口进行执行的特定机器,它的内存也非常的小。而Raspbeery Pi则不同,它有一个非常强的CPU,存储也很大,可以运行通用的OS,比如Linux,也有着更为强大的标准输入、输出接口。所以它们有着完全不同的用途,Arduino更多的用于简单的定式操作,而Raspbeer Pi用于在Linux这样的操作系统上运行应用的环境。
 
 
 
 
 
[https://www.zhihu.com/question/20755144  Arduino 与树莓派 Raspberry Pi 相比各自有什么优缺点]
 
 
 
=func=
 
[http://shumeipai.nxez.com/2018/06/13/build-baby-monitor-raspberry-pi.html 使用树莓派构建一个婴儿监视器]
 
 
 
[https://www.rs-online.com/designspark/content-1394 用一个回形针关闭你的树莓派]
 
 
 
=入门=
 
[https://blog.csdn.net/kelsey98/article/details/78949975 Raspberry Pi 3学习系列——基本使用]
 
 
 
[https://blog.csdn.net/meteor_s/article/category/7793987  Raspberry Pi 系列]
 
 
 
[https://segmentfault.com/a/1190000002579917 树莓派(raspberryPi)的终极玩法 1: 平台搭建]
 
 
 
 
 
[https://segmentfault.com/a/1190000002583340  树莓派的终极玩法 2 :motion +摄像头]
 
 
 
=进阶=
 
[https://segmentfault.com/a/1190000014248533  树莓派迅雷远程下载]
 
 
 
[https://github.com/kuoruan/Xware Xware迅雷]
 
 
 
[http://blog.lxx1.com/2403 使用安卓手机控制树莓派]
 
 
 
[https://www.hscbook.com/article/raspberrypi-haproxy/ 树莓派安装 HAProxy 实现高可用高负载SS服务器线路负载均衡]
 
 
 
== GPIO==
 
[http://blog.lxx1.com/2639 树莓派GPIO引脚定义详细图]
 
 
 
[http://blog.lxx1.com/%E6%A0%91%E8%8E%93%E6%B4%BEgpio%E5%BC%95%E8%84%9A%E5%AF%B9%E7%85%A7%E8%A1%A8 树莓派GPIO引脚对照表]
 
 
 
[https://segmentfault.com/a/1190000000714185 树莓派-GPIO、CPU、温度、内存]
 
 
 
 
 
[http://blog.lxx1.com/%E6%A0%91%E8%8E%93%E6%B4%BE-wiringpi-%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C 树莓派 wiringPi 用户手册]
 
 
 
[http://blog.lxx1.com/1991 树莓派使用wiringPi控制LED灯]
 
 
 
=trouble shooting=
 
 
 
解决树莓派容量使用不完全问题
 
我是 64G 的内存卡,但是看容器总共只有 7.2G.第一反应是遇到了黑心商家,但是网上搜了下,简单设置重启即可.详见: http://cedar-renjun.github.io/2015/10/11/resize-raspberry-sd-volume/
 
 
 
=参考=
 
 
 
== 教程==
 
 
 
[http://blog.lxx1.com/topics/hard/raspberry-pi/page/9 树莓派归档]
 
 
 
 
 
[https://www.jianshu.com/p/89685aa72da4 第1讲:树莓派购买指南【子豪兄的零基础树莓派教程】]
 
 
 
[https://my.oschina.net/TimeCarving 树莓派3 oschina教程]
 
 
 
[http://shumeipai.nxez.com/ 树莓派实验室]
 
 
 
[https://post.smzdm.com/p/714456/ 树莓派SBC HIFI DSD播放器 篇六:Moode4.1在树莓派3B+搭建HIFI音乐播放器]
 
 
 
 
 
[http://www.30daydo.com/article/19 树莓派2代 接通用usb摄像头 ]
 
 
 
[https://www.zhihu.com/question/20859055 树莓派是什么以及普通人怎么玩]
 
 
 
[https://www.leiphone.com/news/201511/7DAzK23RzBEJzvra.html?x=207&y=21 树莓派初学者?先做做这十个项目吧]
 
 
 
 
 
https://www.raspberrypi.org/products/#buy-now-modal
 
 
 
官方中国商城 上次买的那个态度不好,下次换个
 
 
 
https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-17579621303.18.68e52d28OXMtCt&id=558354832128&src=raspberrypi
 
 
 
https://item.taobao.com/item.htm?spm=0.7095261.0.0.2f291debgNGawr&id=565756129429&src=raspberrypi
 
 
 
https://item.taobao.com/item.htm?spm=0.7095261.0.0.29491debwhELXl&id=565703159178&src=raspberrypi
 
 
 
 
 
 
 
[https://segmentfault.com/a/1190000008664157 在树莓派上搭建LNMP环境]
 
 
 
[https://blog.csdn.net/qq_31324613/article/details/78198484 树莓派最新raspbian系统换国内源]
 
 
 
 
 
[https://post.smzdm.com/p/709152/ RaspberryPi 3B+开箱]
 
 
 
[https://post.smzdm.com/p/738574/ 树莓派 3B+ 开箱]
 
 
 
[https://www.cnbeta.com/articles/tech/760839.htm 树莓派迎来PoE网线供电选项 新HAT模块售20美元]
 
 
 
[https://post.smzdm.com/p/656839/ 原创新人#咸鱼淘二手树莓派3装KODI及Genesis Reborn插件手机遥控在线看片]
 
 
 
[https://post.smzdm.com/p/552274/ 搭建OMV:树莓派PI3的充分利用]
 
  
 +
Shell之提取文件名和目录名的一些方法
 +
https://wiki.linuxchina.net/index.php?title=Shell%E4%B9%8B%E6%8F%90%E5%8F%96%E6%96%87%E4%BB%B6%E5%90%8D%E5%92%8C%E7%9B%AE%E5%BD%95%E5%90%8D%E7%9A%84%E4%B8%80%E4%BA%9B%E6%96%B9%E6%B3%95
  
[https://segmentfault.com/a/1190000000503041 镜像站全汇总]
+
[[category:shell]]
[[category:树莓派]]  [[category:fun]]
 

2017年2月15日 (三) 03:53的版本

#!/bin/bash
for ipas in $1/*
do
    if [ "${ipas##*.}" = "ipa" ];then   
        if [ ! -d "Payload" ]; then
          unzip -q $ipas
        fi

        ipa=$(basename ${ipas##*/} .ipa)
        version=`plutil -p Payload/*.app/Info.plist | grep 'CFBundleShortVersionString'|cut -d '"' -f 4`

        echo ${ipa}" 版本="${version} >> $1/version.txt
        rm -rf  Payload META-INF
   fi
done


Mac-mini:chuan$ ls src/
bb.ipa	cc.ipa
Mac-mini:chuan$  sh evan.sh  src/
Mac-mini:chuan$  cat src/version.txt 
bb 版本=1.0.0
cc 版本=1.0.0

检测指定文件夹内的ipa的版本号
http://www.jianshu.com/p/8178962aba8e


if else以及大于、小于、等于逻辑表达式

==比较容易混的知识点==

shell 字符串比较:
=                          等于           if [ "$a" = "$b" ]
==                        与=等价

If else以及大于、小于、等于逻辑表达式 https://wiki.linuxchina.net/index.php?title=If_else%E4%BB%A5%E5%8F%8A%E5%A4%A7%E4%BA%8E%E3%80%81%E5%B0%8F%E4%BA%8E%E3%80%81%E7%AD%89%E4%BA%8E%E9%80%BB%E8%BE%91%E8%A1%A8%E8%BE%BE%E5%BC%8F

Shell之提取文件名和目录名的一些方法 https://wiki.linuxchina.net/index.php?title=Shell%E4%B9%8B%E6%8F%90%E5%8F%96%E6%96%87%E4%BB%B6%E5%90%8D%E5%92%8C%E7%9B%AE%E5%BD%95%E5%90%8D%E7%9A%84%E4%B8%80%E4%BA%9B%E6%96%B9%E6%B3%95