mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-03 23:40:14 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
63c846730d
@ -0,0 +1,131 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (this-is-name-right)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12448-1.html)
|
||||
[#]: subject: (How to build a WiFi picture frame with a Raspberry Pi)
|
||||
[#]: via: (https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi)
|
||||
[#]: author: (Manuel Dewald https://opensource.com/users/ntlx)
|
||||
|
||||
如何用树莓派制作 WiFi 相框
|
||||
======
|
||||
|
||||
> DIY一个数码相框,图片流来自云端。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202007/24/212836agkae2776gude1cb.jpg)
|
||||
|
||||
数码相框真的很好,因为它可以让你查看你自己的相片而不必打印出来。更棒的是,当你想要展示一张新的相片的时候,增加和删除数字图片要比打开传统的相框然后替换里面的相框更简单。不过,这还是需要一点手动的操作,比如从数字相框取出 SD 卡、U 盘或者其他的存储介质,然后把存储介质接入电脑,接着再复制图片进入存储介质。
|
||||
|
||||
一个更简单的选项是数字相框通过 WiFi 获得图片,例如从云端服务器获得。下面就是如何制作这样的一个数字相框。
|
||||
|
||||
### 需要使用的材料
|
||||
|
||||
* 老式 [TFT][1] 的 LCD 显示屏
|
||||
* HDMI 到 DVI 的转接线(因为 TFT 屏幕支持 DVI)
|
||||
* 树莓派 3
|
||||
* Micro SD 卡
|
||||
* 树莓派的电源
|
||||
* 键盘
|
||||
* 鼠标(可选)
|
||||
|
||||
使用线缆连接树莓派到显示器,并连接电源。
|
||||
|
||||
### 安装 Raspbian
|
||||
|
||||
按照以下[指示][2]下载并将 Raspbian 烧录到 Micro SD 卡中。将 Micro SD 卡插入树莓派,启动它,并配置你的 WiFi。在安装完 Raspbian 后,我的第一个操作通常是运行 `sudo raspi-config`。在那里,我在网络选项中更改主机名(例如,改为 `picframe`),并在接口选项中启用 SSH 以远程连接到树莓派。使用(例如)`ssh pi@picframe` 连接到树莓派。
|
||||
|
||||
### 建立并安装云客户端
|
||||
|
||||
我使用 [Nextcloud][3] 来同步我的图片,但是你可以使用 NFS、[Dropbox][4],或者其他的适合你的需求的方式上传图片到相框。
|
||||
|
||||
如果你使用 Nextcloud,请按照[以下说明][5]在 Raspbian 上安装客户端。这可以很方便的放图片到你的相框,并且你可能很熟悉安装在台式机的这个客户端应用。当连接客户端到 Nextcloud 服务器上的时候,请确保只选择存储你要在相框上显示的图片的文件夹。
|
||||
|
||||
### 设置幻灯片放映
|
||||
|
||||
我发现设置幻灯片放映最简单的方式是使用一个专门为这个目的建立的[轻量级的幻灯片项目][6]。还有一些备用方案,像是配置屏保,这个应用似乎是最最简单设置幻灯片放映的方式了。
|
||||
|
||||
在你的树莓派上下载最新的二进制程序,解包并移动到一个可执行的文件夹里:
|
||||
|
||||
```
|
||||
wget https://github.com/NautiluX/slide/releases/download/v0.9.0/slide_pi_stretch_0.9.0.tar.gz
|
||||
tar xf slide_pi_stretch_0.9.0.tar.gz
|
||||
mv slide_0.9.0/slide /usr/local/bin/
|
||||
```
|
||||
|
||||
安装依赖关系:
|
||||
|
||||
```
|
||||
sudo apt install libexif12 qt5-default
|
||||
```
|
||||
|
||||
通过执行下面的命令播放幻灯片(不要忘记修改图片的路径)。如果你通过 SSH 访问你树莓派,设置 `DISPLAY` 变量来在连接到树莓派显示屏上开始播放幻灯片。
|
||||
|
||||
```
|
||||
DISPLAY=:0.0 slide -p /home/pi/nextcloud/picframe
|
||||
```
|
||||
|
||||
### 自动播放幻灯片
|
||||
|
||||
为了在 Raspbian Stretch 上自动播放幻灯片,建立如下的文件夹并且添加一个 `autostart` 文件到里面:
|
||||
|
||||
```
|
||||
mkdir -p /home/pi/.config/lxsession/LXDE/
|
||||
vi /home/pi/.config/lxsession/LXDE/autostart
|
||||
```
|
||||
|
||||
在文件中输入如下的命令来自动开启幻灯片。`slide` 命令可以调整到你需要的地方:
|
||||
|
||||
```
|
||||
@xset s noblank
|
||||
@xset s off
|
||||
@xset -dpms
|
||||
@slide -p -t 60 -o 200 -p /home/pi/nextcloud/picframe
|
||||
```
|
||||
|
||||
禁止屏幕空白,树莓派通常会在 10 分钟后这样做,通过编辑下面的文件修改:
|
||||
|
||||
```
|
||||
vi /etc/lightdm/lightdm.conf
|
||||
```
|
||||
|
||||
添加这两行到文件末尾:
|
||||
|
||||
```
|
||||
[SeatDefaults]
|
||||
xserver-command=X -s 0 -dpms
|
||||
```
|
||||
|
||||
### 配置上电时间
|
||||
|
||||
你可以安排你的相框什么时候打开和关闭通过使用两个简单的定时任务。例如,你想在上午 7 点自动打开,在晚上 11 点自动关闭。运行 `crontab -e` 并且输入下面的两行:
|
||||
|
||||
```
|
||||
0 23 * * * /opt/vc/bin/tvservice -o
|
||||
0 7 * * * /opt/vc/bin/tvservice -p && sudo systemctl restart display-manager
|
||||
```
|
||||
|
||||
注意这不会打开或关闭树莓派的电源;这只会关闭 HDMI,它会关闭屏幕。第一行命令将在晚上 11 点关闭 HDMI。第二行将在早上 7 点打开显示屏并重启显示器管理器。
|
||||
|
||||
### 附言
|
||||
|
||||
通过这些简单的步骤,你创建了你自己 WiFi 相框。如果你想要让它更好看,为显示屏做一个木质相框吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi
|
||||
|
||||
作者:[Manuel Dewald][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[this-is-name-right](https://github.com/this-is-name-right)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ntlx
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/Thin-film-transistor_liquid-crystal_display
|
||||
[2]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
|
||||
[3]: https://nextcloud.com/
|
||||
[4]: http://dropbox.com/
|
||||
[5]: https://github.com/nextcloud/client_theming#building-on-debian
|
||||
[6]: https://github.com/NautiluX/slide/releases/tag/v0.9.0
|
@ -0,0 +1,96 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (windgeek)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12449-1.html)
|
||||
[#]: subject: (What's the difference between DevSecOps and agile software development)
|
||||
[#]: via: (https://opensource.com/article/20/7/devsecops-vs-agile)
|
||||
[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta)
|
||||
|
||||
DevSecOps 和敏捷软件开发有什么不同?
|
||||
======
|
||||
|
||||
> 你更专注于安全性还是软件交付,还是可以两者兼得?
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202007/24/225337mb44xoe2byvz4x4o.jpg)
|
||||
|
||||
技术社区中存在一种趋势,经常互换地使用 DevSecOps 和敏捷软件开发这两个术语。尽管它们有一些相似性,例如都旨在更早地检测风险,但在改变团队的[工作方式层面有很大不同][2]。
|
||||
|
||||
DevSecOps 建立在敏捷开发建立的一些原则上。但是,DevSecOps 特别专注于[集成安全功能][3],而敏捷开发则专注于交付软件。
|
||||
|
||||
知道如何保护你们的网站或应用程序免受勒索程序和其他威胁的侵害,实际上取决于你使用的软件和系统开发。这可能会影响你选择使用 DevSecOps、敏捷软件开发还是两者兼而有之。
|
||||
|
||||
### DevSecOps 和敏捷软件开发的不同之处
|
||||
|
||||
两者的主要区别可以归结为一个简单的概念:安全性。这取决于你的软件开发实践,你们公司的安全措施 —— 以及何时、何地以及由谁实施,都可能会有很大不同。
|
||||
|
||||
每个企业都[需要 IT 安全][4]来保护其重要数据。如果企业真正重视 IT 安全,一般都会采取虚拟专用网(VPN)、数字证书、防火墙保护、多因子身份验证、安全的云存储,包括向员工介绍基本的网络安全措施。
|
||||
|
||||
当你信任 DevSecOps 时,你就会把公司的安全问题,本质上使其等同于持续集成和交付。 DevSecOps 方法论在开发之初就强调安全性,并使其成为整体软件质量不可或缺的组成部分。
|
||||
|
||||
基于 DevSecOps 安全性的三大原则:
|
||||
|
||||
* 平衡用户访问难易程度及数据安全性
|
||||
* 使用 VPN 和 SSL [加密数据][5]可防止数据在传输过程中受到入侵者的攻击
|
||||
* 使用可以扫描新代码的安全漏洞并能通知开发人员该漏洞的工具来预测防范未来的风险
|
||||
|
||||
尽管 DevOps 一直打算包含安全性,但并非每个实践 DevOps 的组织都牢记这一点。DevSecOps 在 DevOps 的演进形式中,可以提供更加清晰的信息。尽管它们的名称相似,但这两个[不应混淆] [6]。在 DevSecOps 模型中,安全性是团队的主要驱动力。
|
||||
|
||||
同时,敏捷开发更专注于迭代开发周期,这意味着反馈意见会不断融入到持续的软件开发中。[敏捷的关键原则][7]是拥抱不断变化的环境,为客户和使用者提供竞争优势,让开发人员和利益相关者紧密合作,并在整个过程中始终保持关注技术卓越,以提升效率。换句话说,除非敏捷团队在其定义中包括安全性,否则安全性在敏捷软件开发中算是事后思考。
|
||||
|
||||
### 国防机构面临的挑战
|
||||
|
||||
如果要说专门致力于最大程度地提高安全性的组织,美国国防部(DoD)就是其中之一。在 2018 年,美国国防部发布了针对软件开发中的“假敏捷”或“以敏捷为名”的[指南][8]。该指南旨在警告美国国防部高管注意不良编程的问题,并说明如何发现它以避免风险。
|
||||
|
||||
使用这些方法不仅可以使美国国防部受益。医疗保健和金融部门也[保存着][9]必须保证安全的大量敏感数据。
|
||||
|
||||
美国国防部通过其现代化战略(包括采用 DevSecOps)来改变防范形式至关重要。尤其在这个连美国国防部容易受到黑客攻击和数据泄露的时代,这一点在 2020 年 2 月的[大规模数据泄露][10]中已经得到了证明。
|
||||
|
||||
将网络安全最佳实践转化为现实生活中的开发仍然还存在固有的风险。事情不可能 100% 完美地进行。最好的状况是稍微有点不舒服,最坏的情况下,它们可能会带来全新的风险。
|
||||
|
||||
开发人员,尤其是那些为军用软件编写代码的开发人员,可能对[所有应该采用 DevSecOps 的情境][11]没有透彻的了解。学习曲线会很陡峭,但是为了获得更大的安全性,必须承受这些必不可少的痛苦。
|
||||
|
||||
### 自动化时代的新模式
|
||||
|
||||
为了解决对先前安全措施日益增长的担忧,美国国防部承包商已开始评估 DevSecOps 模型。关键是将该方法论部署到持续的服务交付环境中。
|
||||
|
||||
应对这个问题,出现了三个方向。第一种涉及到自动化,自动化已在大多数隐私和安全工具中[广泛使用][12],包括 VPN 和增强隐私的移动操作系统。大型云基础架构中的自动化无需依赖于人为的检查和平衡,可以自动处理持续的维护和进行安全评估。
|
||||
|
||||
第二种专注于对于过渡到 DevSecOps 很重要的安全检查点。而传统上,系统设计初期对于数据在各个组件之间移动时依旧可以访问是不做期望的。
|
||||
|
||||
第三种也是最后一种涉及将企业方式用于军用软件开发。国防部的许多承包商和雇员来自商业领域,而不是军事领域。他们的背景为他们提供了为大型企业[提供网络安全][13]的知识和经验,他们可以将其带入政府部门职位中。
|
||||
|
||||
### 值得克服的挑战
|
||||
|
||||
转向基于 DevSecOps 的方法论也提出了一些挑战。在过去的十年中,许多组织已经完全重新设计了其开发生命周期,以适应敏捷开发实践,在不久之后进行再次转换看起来令人生畏。
|
||||
|
||||
企业应该安下心来,因为即使美国国防部也遇到了这种过渡带来的麻烦,他们在应对推出新流程使得商业技术和工具广泛可用的挑战上并不孤独。
|
||||
|
||||
展望一下未来,其实切换到 DevSecOps 不会比切换到敏捷软件开发更痛苦。而且通过将[创建安全性的价值][4]添加到开发工作流程中,以及利用现有敏捷开发的优势,企业可以获得很多收益。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/7/devsecops-vs-agile
|
||||
|
||||
作者:[Sam Bocetta][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[windgeek](https://github.com/windgeek)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sambocetta
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager)
|
||||
[2]: https://tech.gsa.gov/guides/understanding_differences_agile_devsecops/
|
||||
[3]: https://www.redhat.com/en/topics/devops/what-is-devsecops
|
||||
[4]: https://www.redhat.com/en/topics/security
|
||||
[5]: https://surfshark.com/blog/does-vpn-protect-you-from-hackers
|
||||
[6]: https://www.infoq.com/articles/evolve-devops-devsecops/
|
||||
[7]: https://enterprisersproject.com/article/2019/9/agile-project-management-explained
|
||||
[8]: https://www.governmentciomedia.com/defense-innovation-board-issues-guide-detecting-agile-bs
|
||||
[9]: https://www.redhat.com/en/solutions/financial-services
|
||||
[10]: https://www.military.com/daily-news/2020/02/25/dod-agency-suffers-data-breach-potentially-compromising-ssns.html
|
||||
[11]: https://fcw.com/articles/2020/01/23/dod-devsecops-guidance-williams.aspx
|
||||
[12]: https://privacyaustralia.net/privacy-tools/
|
||||
[13]: https://www.securitymagazine.com/articles/88301-cybersecurity-is-standard-business-practice-for-large-companies
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: ( jiangyaomin)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -56,7 +56,7 @@ via: https://opensource.com/article/19/2/open-science-git
|
||||
|
||||
作者:[Jon Tennant][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[译者ID](https://github.com/jiangyaomin)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,69 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (4 Python tools for getting started with astronomy)
|
||||
[#]: via: (https://opensource.com/article/19/10/python-astronomy-open-data)
|
||||
[#]: author: (Gina Helfrich, Ph.D. https://opensource.com/users/ginahelfrich)
|
||||
|
||||
4 Python tools for getting started with astronomy
|
||||
======
|
||||
Explore the universe with NumPy, SciPy, Scikit-Image, and Astropy.
|
||||
![Person looking up at the stars][1]
|
||||
|
||||
NumFOCUS is a nonprofit charity that supports amazing open source toolkits for scientific computing and data science. As part of the effort to connect Opensource.com readers with the NumFOCUS community, we are republishing some of the most popular articles from [our blog][2]. To learn more about our mission and programs, please visit [numfocus.org][3]. If you're interested in participating in the NumFOCUS community in person, check out a local [PyData event][4] happening near you.
|
||||
|
||||
* * *
|
||||
|
||||
### Astronomy with Python
|
||||
|
||||
Python is a great language for science, and specifically for astronomy. The various packages such as [NumPy][5], [SciPy][6], [Scikit-Image][7] and [Astropy][8] (to name but a few) are all a great testament to the suitability of Python for astronomy, and there are plenty of use cases. [NumPy, Astropy, and SciPy are NumFOCUS fiscally sponsored projects; Scikit-Image is an affiliated project.] Since leaving the field of astronomical research behind more than 10 years ago to start a second career as software developer, I have always been interested in the evolution of these packages. Many of my former colleagues in astronomy used most if not all of these packages for their research work. I have since worked on implementing professional astronomy software packages for instruments for the Very Large Telescope (VLT) in Chile, for example.
|
||||
|
||||
It struck me recently that the Python packages have evolved to such an extent that it is now fairly easy for anyone to build [data reduction][9] scripts that can provide high-quality data products. Astronomical data is ubiquitous, and what is more, it is almost all publicly available—you just need to look for it.
|
||||
|
||||
For example, ESO, which runs the VLT, offers the data for download on their site. Head over to [www.eso.org/UserPortal][10] and create a user name for their portal. If you look for data from the instrument SPHERE you can download a full dataset for any of the nearby stars that have exoplanet or proto-stellar discs. It is a fantastic and exciting project for any Pythonista to reduce that data and make the planets or discs that are deeply hidden in the noise visible.
|
||||
|
||||
I encourage you to download the ESO or any other astronomy imaging dataset and go on that adventure. Here are a few tips:
|
||||
|
||||
1. Start off with a good dataset. Have a look at papers about nearby stars with discs or exoplanets and then search, for example: <http://archive.eso.org/wdb/wdb/eso/sphere/query>. Notice that some data on this site is marked as red and some as green. The red data is not publicly available yet — it will say under “release date” when it will be available.
|
||||
2. Read something about the instrument you are using the data from. Try and get a basic understanding of how the data is obtained and what the standard data reduction should look like. All telescopes and instruments have publicly available documents about this.
|
||||
3. You will need to consider the standard problems with astronomical data and correct for them:
|
||||
1. Data comes in FITS files. You will need **pyfits** or **astropy** (which contains pyfits) to read them into **NumPy** arrays. In some cases the data comes in a cube and you should to use **numpy.median **along the z-axis to turn them into 2-D arrays. For some SPHERE data you get two copies of the same piece of sky on the same image (each has a different filter) which you will need to extract using **indexing and slicing.**
|
||||
2. The master dark and bad pixel map. All instruments will have specific images taken as “dark frames” that contain images with the shutter closed (no light at all). Use these to extract a mask of bad pixels using **NumPy masked arrays** for this. This mask of bad pixels will be very important — you need to keep track of it as you process the data to get a clean combined image in the end. In some cases it also helps to subtract this master dark from all scientific raw images.
|
||||
3. Instruments will typically also have a master flat frame. This is an image or series of images taken with a flat uniform light source. You will need to divide all scientific raw images by this (again, using numpy masked array makes this an easy division operation).
|
||||
4. For planet imaging, the fundamental technique to make planets visible against a bright star rely on using a coronagraph and a technique known as angular differential imaging. To that end, you need to identify the optical centre on the images. This is one of the most tricky steps and requires finding some artificial helper images embedded in the images using **skimage.feature.blob_dog**.
|
||||
4. Be patient. It can take a while to understand the data format and how to handle it. Making some plots and histograms of the pixel data can help you to understand it. It is well worth it to be persistent! You will learn a lot about imaging data and processing.
|
||||
|
||||
|
||||
|
||||
Using the tools offered by NumPy, SciPy, Astropy, scikit-image and more in combination, with some patience and persistence, it is possible to analyse the vast amount of available astronomical data to produce some stunning results. And who knows, maybe you will be the first one to find a planet that was previously overlooked! Good luck!
|
||||
|
||||
_This article was originally published on the NumFOCUS blog and is republished with permission. It is based on [a talk][11] by [Ole Moeller-Nilsson][12], CTO at Pivigo. If you want to support NumFOCUS, you can donate [here][13] or find your local [PyData event][4] happening around the world._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/10/python-astronomy-open-data
|
||||
|
||||
作者:[Gina Helfrich, Ph.D.][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ginahelfrich
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/space_stars_cosmos_person.jpg?itok=XUtz_LyY (Person looking up at the stars)
|
||||
[2]: https://numfocus.org/blog
|
||||
[3]: https://numfocus.org
|
||||
[4]: https://pydata.org/
|
||||
[5]: http://numpy.scipy.org/
|
||||
[6]: http://www.scipy.org/
|
||||
[7]: http://scikit-image.org/
|
||||
[8]: http://www.astropy.org/
|
||||
[9]: https://en.wikipedia.org/wiki/Data_reduction
|
||||
[10]: http://www.eso.org/UserPortal
|
||||
[11]: https://www.slideshare.net/OleMoellerNilsson/pydata-lonon-finding-planets-with-python
|
||||
[12]: https://twitter.com/olly_mn
|
||||
[13]: https://numfocus.org/donate
|
@ -1,164 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (this-is-name-right)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to build a WiFi picture frame with a Raspberry Pi)
|
||||
[#]: via: (https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi)
|
||||
[#]: author: (Manuel Dewald https://opensource.com/users/ntlx)
|
||||
|
||||
如何用树莓派制作wifi相册
|
||||
======
|
||||
DIY一个数字相册,图片流来自云端。
|
||||
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-
|
||||
|
||||
images/raspberrypi_board_vector_red.png?itok=yaqYjYqI)
|
||||
|
||||
数字相册真的很好,因为它可以让你查看你自己的相片而不用去打印。更棒的是增加和删除数字图片要比打开传
|
||||
|
||||
统的相册然后替换里面的相册更简单,当你想要展示一张新的相片的时候。 即使是这样,这还是需要一点手动的
|
||||
|
||||
操作,比如从数字相册取出SD卡U盘或者其他的存储介质,然后把存储介质接入电脑,接着再复制图片进入存储
|
||||
|
||||
介质。
|
||||
|
||||
一个更简单的选项是数字相册通过wifi获得图片,例如从云端服务器获得。下面就是如何制作这样的一个数字相
|
||||
|
||||
册。
|
||||
|
||||
### 需要使用的材料
|
||||
|
||||
* 老式[TFT][1]的LCD显示屏
|
||||
* HDMI到DVI的转接线(因为TFT屏幕支持DVI)
|
||||
* 树莓派3
|
||||
* Micro SD card
|
||||
* 树莓派的电源
|
||||
* 键盘
|
||||
* 鼠标(可选)
|
||||
|
||||
|
||||
|
||||
使用线缆连接树莓派到显示器并连接电源。
|
||||
|
||||
### 安装Raspbian
|
||||
|
||||
**sudo raspi-config**.在网络选项中改变主机名并且在接口选项中允许SSH为了在树莓派上远程工作。连接树莓派
|
||||
|
||||
(例如)。
|
||||
|
||||
### 建立并安装云客户端
|
||||
|
||||
按照这些[步骤][2]下载并将Raspbian复制到SD卡。将SD卡插入树莓派并启动它,然后配置你的wifi。我第一步完成
|
||||
|
||||
后Raspian安装程序一般正在运行。 至此我在网络选项中改变主机名并且在接口选项中允许SSH为了远程工作在树
|
||||
|
||||
莓派上。连接树莓派(例如)。
|
||||
|
||||
我使用[Nextcloud][3]来同步我的图片,但是你可以使用NFS,[Dropbox][4],或者其他的什么适合你上传图片到相
|
||||
|
||||
册的。
|
||||
|
||||
如果你使用Nextcloud按照[介绍][5]安装一个客户端。 这可以很方便的放一张图片到你的相册并且你可能很熟悉安
|
||||
|
||||
装在台式机的客户端应用。当连接客户端到Nextcloud服务器上的时候,确保你只选择一个文件夹,这个文件夹里
|
||||
|
||||
面存储了你想要显示在数字相册的图片。
|
||||
|
||||
### 设置幻灯片放映
|
||||
|
||||
我发现设置幻灯片放映最简单的方式是使用[轻量级幻灯片项目][6],这个项目专门为这个目的。还有一些备用方
|
||||
|
||||
案像是配置屏保,这个方式是最最简单设置幻灯片放映的方式了。
|
||||
|
||||
在你的树莓派上下载最新的binaries,解包并移动到一个可执行的文件夹里:
|
||||
|
||||
```
|
||||
wget https://github.com/NautiluX/slide/releases/download/v0.9.0/slide_pi_stretch_0.9.0.tar.gz
|
||||
tar xf slide_pi_stretch_0.9.0.tar.gz
|
||||
mv slide_0.9.0/slide /usr/local/bin/
|
||||
```
|
||||
|
||||
安装依赖:
|
||||
|
||||
```
|
||||
sudo apt install libexif12 qt5-default
|
||||
```
|
||||
|
||||
通过执行下面的命令播放幻灯片(不要忘记修改图片的路径)。如果你通过SSH访问你树莓派,设置**DISPLAY**
|
||||
|
||||
变量来开启连接到树莓派显示屏上的幻灯片。
|
||||
|
||||
```
|
||||
DISPLAY=:0.0 slide -p /home/pi/nextcloud/picframe
|
||||
```
|
||||
|
||||
### 自动播放幻灯片
|
||||
|
||||
为了在Raspbian Stretch上自动播放幻灯片,建立如下的文件夹并且添加一个**autostart**文件到里面:
|
||||
|
||||
```
|
||||
mkdir -p /home/pi/.config/lxsession/LXDE/
|
||||
vi /home/pi/.config/lxsession/LXDE/autostart
|
||||
```
|
||||
|
||||
输入如下的命令来自动开启幻灯片。**slide**命令可以调整到你需要的地方:
|
||||
|
||||
```
|
||||
@xset s noblank
|
||||
@xset s off
|
||||
@xset -dpms
|
||||
@slide -p -t 60 -o 200 -p /home/pi/nextcloud/picframe
|
||||
```
|
||||
|
||||
禁止屏幕空白,树莓派通常会在10分钟后这样做,通过编辑下面的文件修改:
|
||||
|
||||
```
|
||||
vi /etc/lightdm/lightdm.conf
|
||||
```
|
||||
|
||||
添加这两行到文件末尾:
|
||||
|
||||
```
|
||||
[SeatDefaults]
|
||||
xserver-command=X -s 0 -dpms
|
||||
```
|
||||
|
||||
### 配置上电时间
|
||||
|
||||
你可以安排你的相册什么时候打开和关闭通过使用两个简单的定时任务。例如,你想在7am自动打开在11pm自动
|
||||
|
||||
关闭。运行**crontab -e**并且输入下面的两行。
|
||||
|
||||
```
|
||||
0 23 * * * /opt/vc/bin/tvservice -o
|
||||
0 7 * * * /opt/vc/bin/tvservice -p && sudo systemctl restart display-manager
|
||||
```
|
||||
|
||||
注意这不会打开或侧关闭树莓派的电源;这只会关闭HDMI,当你想要关闭屏幕的时候。 第一行命令将关闭HDMI
|
||||
|
||||
在11pm。第二行将打开显示屏并重启显示器管理软件在7am。
|
||||
|
||||
### 添加一点最后的感触
|
||||
|
||||
通过这些简单的步骤,你可以你自己wifi相册。如果你想要让他更好看,为显示屏做一个木质相框。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi
|
||||
|
||||
作者:[Manuel Dewald][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[this-is-name-right](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ntlx
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/Thin-film-transistor_liquid-crystal_display
|
||||
[2]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
|
||||
[3]: https://nextcloud.com/
|
||||
[4]: http://dropbox.com/
|
||||
[5]: https://github.com/nextcloud/client_theming#building-on-debian
|
||||
[6]: https://github.com/NautiluX/slide/releases/tag/v0.9.0
|
@ -0,0 +1,69 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (silentdawn-zz )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (4 Python tools for getting started with astronomy)
|
||||
[#]: via: (https://opensource.com/article/19/10/python-astronomy-open-data)
|
||||
[#]: author: (Gina Helfrich, Ph.D. https://opensource.com/users/ginahelfrich)
|
||||
|
||||
开启天文之路的 4 个 Python 工具
|
||||
======
|
||||
使用 NumPy、SciPy、Scikit-Image 和 Astropy 探索宇宙
|
||||
![Person looking up at the stars][1]
|
||||
|
||||
NumFOCUS 是个非盈利组织,维护着一套科学计算与数据科学方面的杰出开源工具集。作为联系 Opensource.com 读者和 NumFOCUS 社区工作的一部分,我们对我们的 [博客][2] 中一些大家喜闻乐见的文章正在进行再版。如果想了解我们的任务及代码,可以访问 [numfocus.org][3]。如果你有兴趣以个人身份加入 NumFOCUS 社区,可以关注你所在地区的 [PyData 活动][4]。
|
||||
|
||||
* * *
|
||||
|
||||
### 天文学与 Python
|
||||
|
||||
对科学界而言,尤其是对天文学界来说,Python 是一种伟大的语言工具。包括但不限于 [NumPy][5]、[SciPy][6]、[Scikit-Image][7] 和 [Astropy][8] 的很多工具包,都是 Python 非常适用天文学界的有力工具,而且有大量的成功案例( NumPy、Astropy 和 SciPy 是 NumFOCUS 提供资金支持的项目;Scikit-Image 是个隶属项目)。 我在十几年前脱离天文研究领域,成为了软件开发者之后,对前述工具包的演进一直很感兴趣。我的很多前天文界同事在他们的研究中,使用着前面提到的大部分甚至是全部工具包。以我为例,我也曾为位于智利的超大口径望远镜( VLT )上的仪器编写过专业天文软件工具包。
|
||||
|
||||
最近令我吃惊的是,Python 工具包竟然演进到如此好用,任何人都可以轻松编写 [数据缩减][9] 脚本,并产生高质量的数据产品。天文数据易于获取,而且大部分是可以公开使用的,你要做的只是去寻找相关数据。
|
||||
|
||||
比如,负责 VLT 运行的 ESO,直接在他们的网站上提供数据下载服务,只要访问 [www.eso.org/UserPortal][10] 并在首页创建用户就可以享有数据下载服务。如果你需要 SPHERE 数据,可以下载附近任意包含系外行星或者原恒星盘的恒星的全部数据集。对任何 Python 高手而言,通过缩减数据发现深藏于噪声中的行星或者原恒星盘,实在是件令人兴奋的事。
|
||||
|
||||
我很乐于看到你下载 ESO 或其它天文影像数据,开启你的探索历程。这里提供几条建议:
|
||||
|
||||
1. 起步于高质量的数据。看一些有关包含系外行星或者原恒星盘的较近恒星的论文,然后在 <http://archive.eso.org/wdb/wdb/eso/sphere/query> 之类的网站检索数据。需要注意的是,前述网站上的数据有的标注为红色,有的标注为绿色,标注为红色的数据是尚未公开的,在相应的"发布日期"处会注明数据将来公开的时间。
|
||||
2. 了解一些用于获取你所用数据的仪器的信息。尽量对数据的获取有一个基本的理解,对标准的数据缩减之后应该是什么样子做到心中有数。所有的望远镜和仪器都有这方面的文档供公开获取。
|
||||
3. 必须考虑天文数据的标准问题,并予以校正:
|
||||
( 1 )数据以 FITS 格式文件保存。需要使用 **pyfits** 或者 **astropy** (包含 pyfits )读取数据为 **NumPy** 数组。有些情况下,数据是三维的,需要沿 z 轴使用 **numpy.median** 将数据转换为二维数组。有些 SPHERE 数据在同一幅影像中包含了同一片天空的两份拷贝(各自使用了不同的滤波器),这时候需要使用 **索引** 和 **切片** 将它们分离出来。
|
||||
( 2 )全黑图和坏点图。所有仪器都有快门全关(完全无光)状态拍摄的特殊图片,使用 **NumPy 掩膜数组** 从中分离出坏点图。坏点图非常重要,你在合成最终的清晰图像过程中,需要持续跟踪坏点。有些情况下,这还有助于你从原始科学数据中扣除暗背景的操作。
|
||||
( 3 )一般情况下,天文仪器还要拍标准响应图。这是对均匀的单色标准光源拍摄的一张或者一组图片。你需要将所有的原始数据除以标准响应之后再做后续处理(同样,使用 Numpy 掩膜数组实现的话,这仅仅是一个简单的除法运算)。
|
||||
( 4 )对行星影像,为了使行星在明亮恒星背景下变得可见,需要仰仗日冕仪和角差分成像技术。这一步需要识别影像的光学中心,这是比较棘手的环节之一,过程中要使用 **skimage.feature.blob_dog** 从原始影像中寻找一些人工辅助影像作为帮助。
|
||||
4. 要有耐心。理解数据格式并弄清如何操作需要一些时间,绘出像素数据曲线图或者统计图有助于你的理解。贵在坚持,必有收获!你会从中学到很多关于图像数据及其处理的知识。
|
||||
|
||||
|
||||
|
||||
综合应用 NumPy、SciPy、Astropy、scikit-image 及其它工具,结合耐心和恒心,通过分析大量可用天文数据分析实现重大的发现是非常有可能的。说不定,你会成为某个系外行星的第一发现者呢。祝你好运!
|
||||
|
||||
_本文基于 Pivigo CTO [Ole Moeller-Nilsson][12] 的一次 [谈话][11],最初发布于 NumFOCUS 的博客,蒙允再次发布。如果你有意支持 NumFOCUS,可以 [捐赠][13],也可以参与遍布全球的 [PyData 活动][4] 中你身边的那些。_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/10/python-astronomy-open-data
|
||||
|
||||
作者:[Gina Helfrich, Ph.D.][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[silentdawn-zz](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ginahelfrich
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/space_stars_cosmos_person.jpg?itok=XUtz_LyY (Person looking up at the stars)
|
||||
[2]: https://numfocus.org/blog
|
||||
[3]: https://numfocus.org
|
||||
[4]: https://pydata.org/
|
||||
[5]: http://numpy.scipy.org/
|
||||
[6]: http://www.scipy.org/
|
||||
[7]: http://scikit-image.org/
|
||||
[8]: http://www.astropy.org/
|
||||
[9]: https://en.wikipedia.org/wiki/Data_reduction
|
||||
[10]: http://www.eso.org/UserPortal
|
||||
[11]: https://www.slideshare.net/OleMoellerNilsson/pydata-lonon-finding-planets-with-python
|
||||
[12]: https://twitter.com/olly_mn
|
||||
[13]: https://numfocus.org/donate
|
@ -1,99 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (windgeek)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What's the difference between DevSecOps and agile software development)
|
||||
[#]: via: (https://opensource.com/article/20/7/devsecops-vs-agile)
|
||||
[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta)
|
||||
|
||||
DevSecOps和敏捷软件开发有什么不同
|
||||
======
|
||||
你更专注于安全性还是软件发行,或者说你两者都很关注?
|
||||
|
||||
![Brick wall between two people, a developer and an operations manager][1]
|
||||
|
||||
技术社区中存在一种趋势,经常互换地使用DevSecOps和敏捷软件开发这两个术语。尽管它们有一些相似性,例如都旨在更容易地检测风险,但在改变团队的工作方式层面有很大不同。
|
||||
|
||||
DevSecOps建立在敏捷开发建立的一些原则上。但是,DevSecOps特别专注于[集成安全功能][3],而敏捷开发则专注于交付软件。
|
||||
|
||||
知道如何保护你们的网站或应用程序免受勒索程序和其他威胁的侵害,实际上取决于你使用的软件和系统开发。这可能会影响您选择使用DevSecOps,敏捷开发还是两者兼而有之。
|
||||
|
||||
|
||||
|
||||
### DevSecOps和敏捷软件开发的不同之处
|
||||
|
||||
两者的主要区别可以归结为一个简单的概念:安全性。这取决于你的软件开发实践,你们公司的安全措施-以及何时,何地以及由谁实施,都可能会有很大不同。
|
||||
|
||||
每个企业都[需要IT安全] [4]来保护其重要数据。如果企业真正重视IT安全,一般都会采取虚拟专用网(VPN)、数字证书、防火墙保护、多因子身份验证、安全的云存储,包括向员工介绍基本的网络安全措施。
|
||||
|
||||
当你完全相信DevSecOps时,意味着可你正在保护公司的安全,并从本质上使其等同于持续集成和交付。 DevSecOps方法论在开发之初就强调安全性,并使其成为整体软件质量不可或缺的组成部分。
|
||||
|
||||
基于DevSecOps安全性的三大原则:
|
||||
* 平衡用户访问难易程度及数据安全性
|
||||
* 使用[VPN]和SSL的[加密数据] [5]可防止数据在传输过程中受到入侵者的攻击
|
||||
* 使用可以扫描新代码的安全漏洞并能通知开发人员该漏洞的工具来预测防范未来的风险
|
||||
|
||||
尽管DevOps一直打算包含安全性,但并非每个实践DevOps的组织都牢记这一点。DevSecOps在DevOps的演进形式中,可以提供更加清晰的信息。尽管它们的名称相似,但这两个[不应混淆] [6]。在DevSecOps模型中,安全性是团队的主要驱动力。
|
||||
|
||||
同时,敏捷开发更专注于迭代开发周期,这意味着反馈不断集成到持续的软件开发中。 [敏捷的关键原则] [7]是拥抱不断变化的环境,为客户和使用者提供竞争优势,让开发人员和利益相关者紧密合作,并在整个过程中始终保持技术卓越作为重点,用以提升效率。换句话说,除非敏捷团队在其定义中包括安全性,否则安全性在敏捷敏捷中算是事后思考。
|
||||
|
||||
### 国防机构面临的挑战
|
||||
|
||||
如果要说专门致力于最大程度地提高安全性的组织,美国国防部就是其中之一。在2018年,美国国防部发布了软件开发中的[伪造敏捷指南] [8]或“仅以名称命名的敏捷”指南。该指南旨在警告国防部高管有关编程不正确的问题,并说明如何发现它以避免风险。
|
||||
|
||||
使用这些方法不仅可以使国防部受益。医疗保健和金融部门还[持有大量] [9]必须保证安全的敏感数据。
|
||||
|
||||
国防部通过其现代化战略(包括采用DevSecOps)来改变防范形式至关重要。尤其在这个国防部容易受到黑客攻击和数据泄露的时代,这一点在2020年2月的[大规模数据泄露] [10]中已经得到了证明。
|
||||
|
||||
将网络安全最佳实践转化为现实发展仍然还存在固有的风险。事情不可能100%完美地进行。最好的状况是稍微有点不舒服,最坏的情况下,它们可能会带来全新的风险。
|
||||
|
||||
开发人员,尤其是那些为军事软件编写代码的开发人员,可能没有对DevSecOps的[所有上下文的理解] [11]都能有透彻的理解。学习曲线会很陡峭,但是为了获得更大的安全性,必须承受这些必不可少的痛苦。
|
||||
|
||||
|
||||
### 自动化时代的新模式
|
||||
|
||||
为了解决对先前安全措施日益增长的担忧,国防部承包商已开始评估DevSecOps模型。关键是将方法论部署到持续的服务交付环境中。
|
||||
|
||||
应对这个问题,出现了三个方向。第一种涉及到自动化,自动化已在大多数隐私和安全工具中[广泛使用][12],包括VPN和增强隐私的移动操作系统。大型云基础架构中的自动化无需依赖于人为的检查和平衡,可以自动处持续维护和进行安全评估。
|
||||
|
||||
第二种专注于对于过渡到DevSecOps很重要的安全检查点。而传统上,系统设计初期对于数据在各个组件之间移动时依旧可以访问是不做期望的。
|
||||
|
||||
第三种也是最后一种涉及将公司方法用于军事软件开发。国防部的许多承包商和雇员来自商业领域,而不是军事领域。他们的背景为他们提供了为大型企业[提供网络安全] [13]的知识和经验,他们可以将其带入政府部门职位中。
|
||||
|
||||
|
||||
### 值得克服的挑战
|
||||
|
||||
切换到基于DevSecOps的方法论也提出了一些挑战。在过去的十年中,许多组织已经完全重新设计了其开发的生命周期,以适应敏捷的开发实践,在不久之后进行再次切换看起来令人生畏。
|
||||
|
||||
企业应该安下心来,因为即使国防部也遇到了这种过渡带来的麻烦,他们在应对推出新流程使得商业技术和工具广泛可用的挑战上并不孤独。
|
||||
|
||||
展望一下未来,其实切换到DevSecOps不会比切换到敏捷开发更痛苦。而且通过将[创建安全性的价值] [4]添加到开发工作流程中,以及利用现有敏捷开发的优势,企业可以获得很多收益。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/7/devsecops-vs-agile
|
||||
|
||||
作者:[Sam Bocetta][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[windgeek](https://github.com/windgeek)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sambocetta
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager)
|
||||
[2]: https://tech.gsa.gov/guides/understanding_differences_agile_devsecops/
|
||||
[3]: https://www.redhat.com/en/topics/devops/what-is-devsecops
|
||||
[4]: https://www.redhat.com/en/topics/security
|
||||
[5]: https://surfshark.com/blog/does-vpn-protect-you-from-hackers
|
||||
[6]: https://www.infoq.com/articles/evolve-devops-devsecops/
|
||||
[7]: https://enterprisersproject.com/article/2019/9/agile-project-management-explained
|
||||
[8]: https://www.governmentciomedia.com/defense-innovation-board-issues-guide-detecting-agile-bs
|
||||
[9]: https://www.redhat.com/en/solutions/financial-services
|
||||
[10]: https://www.military.com/daily-news/2020/02/25/dod-agency-suffers-data-breach-potentially-compromising-ssns.html
|
||||
[11]: https://fcw.com/articles/2020/01/23/dod-devsecops-guidance-williams.aspx
|
||||
[12]: https://privacyaustralia.net/privacy-tools/
|
||||
[13]: https://www.securitymagazine.com/articles/88301-cybersecurity-is-standard-business-practice-for-large-companies
|
Loading…
Reference in New Issue
Block a user