Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-03-16 10:06:00 +08:00
commit ecc0c1c8a2
7 changed files with 664 additions and 105 deletions

View File

@ -0,0 +1,93 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (OpenStreetMap: A Community-Driven Google Maps Alternative)
[#]: via: (https://itsfoss.com/openstreetmap/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
OpenStreetMap: A Community-Driven Google Maps Alternative
======
_**Brief: OpenStreetMap is a community-driven map which is a potential alternative to Google Maps. Learn more about this open source project.**_
[OpenStreetMap][1] (OSM) is a free editable map of the world. Anyone can contribute, edit, and make changes to the OpenStreetMap to improve it.
![][2]
You need to sign up for an account first in order to be able to edit or add information to the OpenStreetMap. To view the map, you wouldnt need an account.
Even though its a free-to-use map under an [open data license][3], you cannot use the map API to build another service on top of it for commercial purpose.
So, you can download the map data to use it and host it yourself while mentioning the credits to OSM. You can learn more about its [API usage policy][4] and [copyright][5] information on its official website to learn more.
In this article, we shall take a brief look at how it works and what kind of projects use OpenStreetMaps as the source of their map data.
### OpenStreetMap: Overview
![][6]
OpenStreetMap is a good alternative to Google Maps. You might not get the same level of information as Google Maps- but for basic navigation and traveling, OpenStreetMap is sufficient.
Just like any other map, you will be able to switch between multiple layers in the map, get to know your location, and easily search for places.
You may not find all the latest information for the businesses, shops, and restaurants nearby. But, for basic navigation, its more than enough.
OpenStreetMap can be usually accessed through a web browser on both desktop and mobile by visiting the [OpenStreetMap site][7]. It does not have an official Android/iOS app yet.
However, there are a variety of applications available that utilize OpenStreetMap at its core. So, if you want to utilize OpenStreetMap on a smartphone, you can take a look at some of the popular open-source Google Maps alternatives:
* [OsmAnd][8]
* [MAPS.ME][9]
**MAPS.ME** and **OsmAnd** are two open-source applications for Android and iOS that utilize OpenStreetMap data to provide a rich user experience with a bunch of useful information and features added to it.
You can also opt for other proprietary options if you wish, like [Magic Earth][10].
In either case, you can take a look at the extensive list of applications on their official wiki page for [Android][11] and [iOS][12].
### Using OpenStreetMap On Linux
![][13]
The easiest way to use OpenStreetMap on Linux is to use it in a web browser. If you use GNOME desktop environment, you can install GNOME Maps which is built on top of OpenStreetMap.
There are also several software (that are mostly obsolete) that utilize OpenStreetMap on Linux for specific purposes. You can check out the list of available packages in their [official wiki list][14].
### Wrapping Up
OpenStreetMap may not be the best source for navigation for end users but its open source model allows it to be used freely. This means that many services can be built using OpenStreetMap. For example, [ÖPNVKarte][15] uses OpenStreetMap to display worldwide public transport facilities on a uniform map so that you dont have to browse individual operators websites.
What do you think about OpenStreetMap? Can you use it as a Google Maps alternative? Feel free to share your thoughts in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/openstreetmap/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.openstreetmap.org/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openstreetmap.jpg?ssl=1
[3]: https://opendatacommons.org/licenses/odbl/
[4]: https://operations.osmfoundation.org/policies/api/
[5]: https://www.openstreetmap.org/copyright
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/open-street-map-2.jpg?ssl=1
[7]: https://www.openstreetmap.org
[8]: https://play.google.com/store/apps/details?id=net.osmand
[9]: https://play.google.com/store/apps/details?id=com.mapswithme.maps.pro
[10]: https://www.magicearth.com/
[11]: https://wiki.openstreetmap.org/wiki/Android#OpenStreetMap_applications
[12]: https://wiki.openstreetmap.org/wiki/Apple_iOS
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/open-street-map-1.jpg?ssl=1
[14]: https://wiki.openstreetmap.org/wiki/Linux
[15]: http://xn--pnvkarte-m4a.de/

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,103 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Basilisk: A Firefox Fork For The Classic Looks and Classic Extensions)
[#]: via: (https://itsfoss.com/basilisk-browser/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Basilisk: A Firefox Fork For The Classic Looks and Classic Extensions
======
_**Brief: Basilisk is a Firefox fork that supports legacy extensions and much more. Here, we take a look at its features and try it out.**_
### Basilisk: Open Source XUL-Based Web Browser
Even though it is better to stick with the regular web browsers like Firefox or Chromium available for Linux it doesnt hurt to know about other browsers. Recently, I stumbled upon a Firefox fork, [Basilisk][1] web browser that features the classic Firefox user interface along with legacy add-ons support (just like [Waterfox][2]).
![itsfoss.com homepage on Basilisk][3]
If you are in the dire need of using a legacy extensions or miss the classic look and feel of Firefox, the Basilisk web browser can save your day. The web browser is being maintained by the team behind [Pale Moon][4] browser (which is another Firefox fork I will be looking at next).
If youre looking for open-source [Chrome alternatives][5], you may have a quick look at what Basilisk offers.
**Note:** _Basilisk is a development software. Even though I didnt have any major usability issues for the time I used, you should not rely on it as the only browser to use._
### Features of Basilisk web browser
![][6]
Basilisk works out of the box. However, here are some features you might want to take a look before considering to use it:
* [XUL][7]-based web browser
* It features the Australis Firefox interface, which was quite popular back in the time of v29 v56 Firefox version.
* [NPAPI][8] plugins supported (Flash, Unity, Java, etc.)
* Support for XUL/Overlay Mozilla-style extensions.
* Uses [Goanna][9] open-source browser engine which is a fork of Mozillas [Gecko][10]
* Does not use Rust or the Photon user interface
* Supports 64-bit systems only
### Installing Basilisk on Linux
You may not find it listed in your Software Center. So, you will have to head to its official [download page][11] to get the tarball (tar.xz) file.
Once you download it, simply extract it and head inside the folders. Next, you will find a “**Basilisk**” executable file in it. You need to simply run it by double-clicking on it or performing a right-click and selecting “**Run**“.
You may check out its [GitHub page][12] for more information.
![][13]
You can also use the terminal and run the file by following the steps below while navigating to the directory you downloaded it to:
```
cd basilisk-latest.linux64
cd basilisk
./basilisk
```
[Download Basilisk][1]
### Using Basilisk browser
![][14]
Basilisk is a decent Firefox fork if you want the legacy extensions support. It is being actively developed by the team behind Pale Moon and is potentially a great option for users who want the classic look and feel of Mozillas Firefox (before the Quantum update) without comprising on the modern web support.
I didnt have any issues with browsing webpages. However, I did notice that “**YouTube**” detects this as an obsolete browser and warns that it will stop supporting it soon enough.
_**So, Im not sure if Basilisk will be a fit for every web service out there but if you really need the archived legacy extensions that you used on Firefoxs older releases, this could be a solution for your problem.**_
**Wrapping Up**
Do you think a Firefox fork is worth trying out? What do you prefer? Share your thoughts in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/basilisk-browser/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.basilisk-browser.org/
[2]: https://itsfoss.com/waterfox-browser/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-itsfoss.jpg?ssl=1
[4]: https://www.palemoon.org
[5]: https://itsfoss.com/open-source-browsers-linux/
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-options-1.jpg?ssl=1
[7]: https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XUL
[8]: https://wiki.mozilla.org/NPAPI
[9]: https://en.wikipedia.org/wiki/Goanna_(software)
[10]: https://developer.mozilla.org/en-US/docs/Mozilla/Gecko
[11]: https://www.basilisk-browser.org/download.shtml
[12]: https://github.com/MoonchildProductions/Basilisk
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-folder-1.jpg?ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-browser-1.jpg?ssl=1

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,281 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Adding a display to a travel-ready Raspberry Pi Zero)
[#]: via: (https://opensource.com/article/20/3/pi-zero-display)
[#]: author: (Peter Garner https://opensource.com/users/petergarner)
Adding a display to a travel-ready Raspberry Pi Zero
======
A small eInk display turns a Raspberry Pi into a self-contained,
pocket-sized travel computer.
![Pi Zero][1]
In my earlier article, I explained how I [transformed a Raspberry Pi Zero][2] into a minimal, portable, go-anywhere computer system that, although small, can actually achieve useful things. I've since made iterations that have proved interesting and made the little Pi even more useful. Read on to learn what I've done.
### After the road trip
My initial Pi Zero setup [proved its worth][3] on a road trip to Whitby, but afterward, it was largely consigned to the "pending" shelf, waiting for another assignment. It was powered up weekly to apply updates, but other than that, it was idle. Then one day, as I was flicking through emails from various Pi suppliers, I came across a (slightly) reduced e-Ink display offer: hmmm… and there was a version for the Pi Zero as well. What could I do with one?
ModMyPi was selling a rather neat [display and driver board combination][4] and a [small case][5] with a transparent window on top. I read the usual reviews, and apart from one comment about the _boards being a very tight fit_, it sounded positive. I ordered it, and it turned up a few days later. I had noted from the product description that the display board didn't have GPIO headers installed, so I ordered a Pi Zero WH (wireless + headers pre-installed) to save me the bother of soldering one on.
### Some assembly required
As with most of these things, some self-assembly was required, so I carefully opened the boxes and laid out the parts on the desk. The case was nicely made apart from ridiculous slots for a watch strap (?!) and some strange holes in the side to allow tiny fingers to press the five I/O buttons on the display. "_Could I get a top without holes?"_ I inquired on the review page. "_No."_ Okay then.
With the case unpacked, it was time to open the display box. A nicely designed board was first out, and there were clear instructions on the Pi-Supply website. The display was so thin (0.95mm) that I nearly threw it out with the bubble wrap.
The first job was to mount the display board on the Pi Zero. I checked to make sure I could attach the display cable to the driver board when it was joined to the Pi and decided that, with my sausage fingers, I'd attach the display first and leave it flapping in the breeze while I attached the driver board to the Pi. I carefully got the boards lined up on the GPIO pins, and, with those in place, I folded over the display "screen" to sit on top of the board. With the piggy-backed boards in place, I then _verrrry_ carefully shoe-horned the assembly into place in the case. Tight fit? Yeah, you're not kidding, but I got it all safely in place and snapped the top on, and nothing appeared to be broken. Phew!
### How to set up your display
I'm going to skip a chunk of messing about here and refer you to the maker's [instructions][6] instead. Suffice to say that after a few installs, reboots, and coffees, I managed to get a working e-Ink display! Now all I had to do was figure out what to do with it.
One of the main challenges of working with a small device like [my "TravelPi"][2] is that you don't have access to as much screen real estate as you would on a larger machine. I like the size and power of the device though, so it's really a compromise as to what you get out of it. For example, there's a single screen accessible via the HDMI port, and I've used tmux to split that into four separate, usable panes. If I really need to view something else urgently, I could always **Ctrl+Z** into another prompt and do the necessary configs, but that's messy.
I wanted to see various settings and maybe look at some system settings, and the e-Ink display enabled me to do all that! As you can see from the image below, I ended up with a very usable info panel that is updated by a simple(-ish) Python script (**qv**) either manually or by a crontab entry every 10 minutes. The manufacturer states that the update frequency should be "no more than 1Hz if you want your display to last for a long time." Ten minutes is fine, thank you.
Here's what I wanted to be able to see at a glance:
Hostname | And device serial number
---|---
IP address | Current internal IP address
VPN status | Inactive/country/IP address
Tor status | Inactive/IP address
"Usage" | Percentage disk space and memory used
Uptime | So satisfying to see those long uptimes
And here it is: a display that's the same size as the Pi Zero and 1" deep.
![PiZero Display][7]
### How to populate the display
Now I needed to populate the display. As seems to be the norm these days, the e-Ink support software is in Python, which, of course, is installed as standard with most Linux distros. _Disclaimer:_ Python is not my first (dev) language, but the code below works for me. It'll probably work for you, too.
```
#!/usr/bin/env python
import os
import sys
import time
import datetime
import socket
import netifaces as ni
import psutil
import subprocess
from netifaces import AF_INET, AF_INET6, AF_LINK, AF_PACKET
from papirus import PapirusText, PapirusTextPos, Papirus
from subprocess import check_output
from datetime import timedelta
rot     = 0
screen  = Papirus(rotation = rot)
fbold   = '/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf'
fnorm   = '/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf'
text    = PapirusTextPos(rotation = rot)
def GetBootTime():
        return datetime.datetime.fromtimestamp(psutil.boot_time())
def GetUptime():
     with open('/proc/uptime','r') as f:
       uptime_seconds = float(f.readline().split()[0])
     u = str(timedelta(seconds = uptime_seconds))
     duration,junk = u.split(".")
     hr,mi,sc = duration.split(":")
     return "%sh %sm %ss" % ( hr,mi,sc )
def getHostname():
        hostname = socket.gethostname()
        return hostname
def getWiFiIPaddress():
        try:
                ni.interfaces()
                [ 'wlan0', ]
                return ni.ifaddresses('wlan0')[AF_INET][0]['addr']
        except:
                return 'inactive'
def getVPNIPaddress():
        try:
                ni.interfaces()
                [ 'tun0', ]
                return ni.ifaddresses('tun0')[AF_INET][0]['addr']
        except:
                return 'inactive'
def GetTmuxEnv():
        if 'TMUX_PANE' in os.environ:
                return ' (t)'
        return ' '
def GetCPUserial():
        cpuinfo = subprocess.check_output(["/bin/cat", "/proc/cpuinfo"])
        cpuinfo = cpuinfo.replace("\t","")
        cpuinfo = cpuinfo.split("\n")
        [ legend, cpuserial ] = cpuinfo[12].split(' ')
        cpuserial = cpuserial.lstrip("0")
        return cpuserial
def GetMemUsed():
        memUsed = psutil.virtual_memory()[2]
        return memUsed
def GetDiskUsed():
        diskUsed = psutil.disk_usage('/')[3]
        return diskUsed
def CheckTor():
        try:
                TS = "active: pid %s" %check_output(['pidof','tor'])   
        except:
                TS = 'inactive'
        return TS      
def CheckVPN():
        return VPNlo
# ---------------------------------------------------------------------------
def main():
        pass
if __name__ == '__main__':
        main()
VPNlo = 'inactive'
if (len(sys.argv) == 2):
        try:
                VPNlo = sys.argv[1]
        except:
                VPNlo = 'inactive'
text = PapirusTextPos(False,rotation=rot)
text.AddText("%s %s %s"% (getHostname(),GetCPUserial(),GetTmuxEnv()),x=1,y=0,size=12,invert=True,fontPath=fbold)
text.AddText("IP  %s" % getWiFiIPaddress(),x=1,y=16,size=12,fontPath=fnorm)
if ( getVPNIPaddress() == 'inactive' ):
        text.AddText("VPN %s" % CheckVPN(),x=1,y=30,size=12,fontPath=fnorm)
else:
        text.AddText("VPN %s" % getVPNIPaddress(),x=1,y=30,size=12,fontPath=fnorm)
text.AddText("TOR %s" % CheckTor(),x=1,y=44,size=12,fontPath=fnorm)
text.AddText("MEM %s% DISK %s% used" % (GetMemUsed(),GetDiskUsed()),x=1,y=58,size=12,fontPath=fnorm,maxLines=1)
text.AddText("UPTIME %s" % GetUptime(),x=1,y=72,size=12,fontPath=fnorm)
text.WriteAll()
sys.exit(0)
```
Normally, the script runs without any arguments and is called by a series of Bash scripts that I've written to start up various subsystems; these are, in turn, called from a menu system written in Whiptail, which is pretty versatile. In the case of the VPN system, I have a list of access points to choose from and that update the location on the display. Initially, I call the display updater with the location name (e.g., Honolulu), but at that point, I can't display the VPN IP address because I don't know it:
```
   dispupdate.py ${accesspoint}
   openvpn --config $PATH/Privacy-${accesspoint}.conf --auth-user-pass credfile
```
When the display updater runs again (outside the VPN startup script), the IP address is readable from the **tun0** interface and the display is updated with the IP address. I may change this later, but it works fine now. I use the **PapirusTextPos** function (rather than **PapirusText**), as this allows multiple lines to be written before the display is updated, leading to a much faster write. The **text.WriteAll()** function does the actual update.
### Adding more software
I was very pleased with my initial choice of applications, but since I'd managed to slim the whole installation down to 1.7GB, I had plenty of available space. So, I decided to see if there was anything else that could be useful. Here's what I added:
Irssi | IRC client
---|---
FreeBSD games | There are still many text-mode games to enjoy
nmon | A _very_ comprehensive top-alike utility for all aspects of the system
Newsbeuter | Text-mode Atom/RSS feed reader
And I still have about 300MB free space to take me up to 2GB, so I may add more.
### We keed to talk about ~~Kevin~~ Bluetooth
Observant readers will remember my hatred for Bluetooth and trying to pair terminal-based software with a Bluetooth device. When I bought a new Pi, I realized that I had to pair the damn thing up with the keyboards again. Oh, woe is me! But a search-engine session and a calming coffee enabled me to actually do it! It goes something like this:
```
sudo su
bluetoothctl {enter}
[bluetooth]#
[bluetooth]# scan on
Discovery started
[CHG] Controller B8:27:EB:XX:XX:XX Discovering: yes
[bluetooth]# agent on
Agent registered
[NEW] Device B2:2B:XX:XX:XX:XX Bluetooth Keyboard
Attempting to pair with B2:2B:XX:XX:XX:XX
[CHG] Device B2:2B:XX:XX:XX:XX Connected: yes
[agent] PIN code: 834652
[CHG] Device B2:2B:XX:XX:XX:XX Modalias: usb:v05ACp0220d0001
[CHG] Device B2:2B:XX:XX:XX:XX UUIDs: zzzzz
[CHG] Device B2:2B:XX:XX:XX:XX UUIDs: yyyyy
[CHG] Device B2:2B:XX:XX:XX:XX ServicesResolved: yes
[CHG] Device B2:2B:XX:XX:XX:XX Paired: yes
Pairing successful
[CHG] Device B2:2B:XX:XX:XX:XX ServicesResolved: no
[CHG] Device B2:2B:XX:XX:XX:XX Connected: no
[bluetooth]# trust B2:2B:XX:XX:XX:XX
[CHG] Device B2:2B:XX:XX:XX:XX Trusted: yes
Changing B2:2B:XX:XX:XX:XX trust succeeded
[CHG] Device B2:2B:XX:XX:XX:XX RSSI: -53
[bluetooth]# scan off
[CHG] Device B2:2B:XX:XX:XX:XX RSSI is nil
Discovery stopped
[CHG] Controller B8:27:EB:XX:XX:XX Discovering: no
[bluetooth]# exit
Agent unregistered
$
```
I was gobsmacked! No, really. I paired my other keyboard and am now considering pairing a speaker, but we'll see. I had a beer that night to celebrate my new-found "l33t" tech skills! Here is an [excellent guide][8] on how to do it.
### One more hardware mod
Until recently, I've been using as large a good-quality microSDHC card as I could afford, and in case of problems, I created a backup copy using the rsync-based rpi-clone. However, after reading various articles on the 'net where people complain about corrupted cards due to power problems, unclean shutdowns, and other mishaps, I decided to invest in a higher-quality card that hopefully will survive all this and more. This is important if you're traveling long distances and _really_ need your software to work at the destination.
After a long search, I found the [ATP Industrial-Grade MicroSD/MicroSDHC][9] cards, which are rated military-spec for demanding applications. That sounded perfect. However, with quality comes a cost, as well as (in this case) limited capacity. In order to keep my wallet happy, I limited myself to an 8GB card, which may not sound like a lot for a working computer, but bearing in mind I have a genuine 5.3GB of that 8GB free, it works just fine. I also have a level of reassurance that bigger but lower-quality cards can't give me, and I can create an ISO of that card that's small enough to email if need be. Result!
### What's next?
The Zero goes from strength to strength, only needing to go out more. I've gone technically about as far as I can for now, and any other changes will be small and incremental.
* * *
_This was originally published on [Peter Garner's blog][10] under a CC BY-NC-ND 4.0 and is reused here with the author's permission._
The new issue of the official Raspberry Pi magazine, The MagPi, comes with a free computer stuck to...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/pi-zero-display
作者:[Peter Garner][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/petergarner
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/zero-osdc-lead.png?itok=bK70ON2W (Pi Zero)
[2]: https://opensource.com/article/20/3/raspberry-pi-zero-w-road
[3]: https://petergarner.net/notes/index.php?thisnote=20180511-Travels+with+a+Pi+%282%29
[4]: https://www.modmypi.com/raspberry-pi/screens-and-displays/epaper/papirus-zero-epaper--eink-screen-phat-for-pi-zero-medium
[5]: https://www.modmypi.com/raspberry-pi/cases-183/accessories-1125/watch-straps/pi-supply-papirus-zero-case
[6]: https://github.com/PiSupply/PaPiRus
[7]: https://opensource.com/sites/default/files/uploads/pizerodisplay.jpg (PiZero Display)
[8]: https://www.sigmdel.ca/michel/ha/rpi/bluetooth_01_en.html
[9]: https://www.digikey.com/en/product-highlight/a/atp/industrial-grade-microsd-microsdhc-cards
[10]: https://petergarner.net/notes/index.php?thisnote=20190205-Travels+with+a+Pi+%283%29

View File

@ -0,0 +1,184 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How I migrated from a Mac Mini to a Raspberry Pi)
[#]: via: (https://opensource.com/article/20/3/mac-raspberry-pi)
[#]: author: (Peter Garner https://opensource.com/users/petergarner)
How I migrated from a Mac Mini to a Raspberry Pi
======
Learn more about Linux by turning a Raspberry Pi Model 2 into a workable
desktop computer.
![Vector, generic Raspberry Pi board][1]
Some time ago, I decided to move my computing environment from a Mac Mini PowerPC to a Raspberry Pi Model 2. This article describes my reasons for doing so and how I did it. While it is quite technical in places, if you're considering switching from an existing system to something decidedly lean and mean, there are things that you need to know before making that leap. There are lots of links to click as well, which will lead you to the software and apps that I mention.
Enjoy!
## Saying goodbye to the Mac
I have to admit, I've never really been an Apple fanboi, especially following a short (and ultimately unsatisfactory) fling with a plastic polycarbonate MacBook back in 2006. Although it was beautifully designed, and the software "Just Worked," I was understandably upset when it decided to expire shortly after the warranty period expired (design faults, apparently). Ah well.
I swore never to "invest" in an Apple machine again—until I discovered a used Mac Mini PowerPC on eBay that could be had for around $100 in 2012. It was new back in 2005 but had apparently been refurbished. "What have I got to lose, especially at that price?" I asked myself. Nobody answered, so I placed a last-minute bid, won it, and invested about the same sum of money again in bumping the memory up to 1GB and buying the OS on DVD. The OS X version was 10.4.7 Tiger, and the architecture was Power PC. It was sedate but reliable, and I was happy. It didn't take a lot of power either; some 60 watts at full load, so that was a bonus. I spent many happy hours tinkering with it and trying to find software that was supported on a device that old.
Predictably though, as my computing requirements grew and the Mac got older, it started to get noticeably slower, and I was aware that even simple tasks—such as asking it to run a web browser and display an HTTPS page—were causing it problems. When I finally managed to find antivirus software for it, I became aware of just how noisy the Mini's cooling fan was as the CPU struggled with the extra load.
A quick check of the performance monitors revealed thousands of memory-paging faults, and I realized that my old friend was soon destined for the knackers yard. Of course, that meant searching for a replacement, and that's when the fun started.
## A(nother) small computer
My main problem was that I didn't have a big budget. I looked at eBay again and found a number of Mac Minis for sale, all around the $500 mark, and many of those were early basic-spec Intel units that, like my old Mac, people had simply grown out of. Essentially, I wanted something like the old Mini, ideally with similar power consumption. A new one was out of the question, obviously.
Let me state that my computer requirements are pretty undemanding, and for photo/graphics work, I have another computer that consumes power like there's no tomorrow and gives off enough heat to keep me warm in winter. And then I got to thinking about the [Raspberry Pi Model 2][2]. Now before you laugh, I have around six of the things running various servers, and they do just fine. One runs a small web server, another runs a mail server, and so on. Each one costs around $30, and most use a cheap microSDHC card, so if one fails, I can easily swap it out for another, and I can usually buy a suitable card at a local supermarket—try doing that when your laptop drive fails! I also have a Netgear ReadyNAS 102 with a couple of 2TB hard drives to act as my bulk storage.
Suddenly, my plan looked as though it might be viable after all!
## Spec'ing it out
The specification was a bit of a no-brainer: The Model 2 Pi comes with 1GB of memory standard, the Ethernet runs at 100Mbps maximum, the clock speed is 900MHz, there are four USB ports, and that's yer lot, mate. You can overclock it, but I've never wanted to try this for various reasons.
I had a Pi in my spares drawer, so no problem there. I ordered a posh aluminum case made by [Flirc][3] that was on offer for $20 and duly slotted in the Pi. The power supply unit (PSU) had to be a genuine two-amp device, and again, I had a spare lying around. If you take your Pi ownership seriously, I recommend the [Anker 40W][4] five-port desktop charger: it has intelligent power management, and I'm running five Pis from one unit. Incidentally, if you inadvertently use a PSU that can't deliver the required current, you'll keep seeing a square, multi-colored icon in the top-right corner of your screen, so be warned.
The microSDHC "disk" was more of an issue, though. I always use SanDisk, and this time I wanted something fast, especially as this was to be a "desktop" machine. In the end, I went for a [SanDisk 8GB Extreme Pro UHS-1][5] card that promised up to 90 to 95 Mbps write/read performance. "8GB? That's not a lot of space," I hear you Windows users cry, and because this is Linux, there doesn't need to be.
The way I envisioned it, I'd set up the Pi normally and use it primarily as a boot disk. I'd host all my documents and media files on the network-attached storage (NAS) box, and all would be well. The NAS shares would be accessed via network filesystem (NFS), and I'd just mount them as directories on the Pi.
Quite early on, I elected to move my entire home directory onto the NAS, and this has worked well, with some quirks. The problem I faced was a Pi quirk, and although I was sure there was a fix, I wanted to get it up and running before the Mac finally crapped out. When the Pi boots, it seems to enable the networking part quite late in the sequence, and I found that I couldn't do my NFS mounts because the networking interface hadn't come up yet. Rather than hack around with tricky scripts, I decided to simply mount the NFS shares by hand after I'd logged in after a successful boot. This seemed to work, and it's the solution I'm using now. Now that I had a basic strategy, it was time to implement it on the "live" machine.
That's the beauty of working with the Raspberry Pi—you can quickly hack together a testbed and have a system up and running in under 30 minutes.
Regarding video, I bought an HDMI-to-DVI cable to use with my Dell monitor, and in GUI desktop mode, this comes up as 1280x1024—plenty good enough for my use. If you have a monster flat-screen TV, you can always use that instead.
## My software environment
### Operating system
I ultimately decided on [Arch Linux for ARM][6] 7H as the operating system. I'm a [Raspbian][7] veteran, but I didn't need the educational software that comes with it (I have other Pis for that). Arch provides a minimal environment but is full-featured, well-supported, and powerful; it also has bucket-loads of software available. After its initial installation, I'd used just over 1.2GB of space, and even now, with all my software on the microSDHC, I'm only using 2.8GB of my 8GB card. Please note that the Pi 2 is officially Arch Linux ARM 7, not 6.
### Desktop
I wanted a graphical desktop environment (even though I'm a command-line sorta guy), but it needed to be in keeping with the lean and mean ethos. I'd used [LXDE][8] before and was happy with it, so I installed it; GNOME and KDE were just too big.
### Web browser
The web browser was a bit of a problem, but after trying the default Midori, Epiphany, and a couple of others, I decided on [Firefox][9]. It's a bit flabby, but it follows standards well, and if you're going to digitally sign LibreOffice ODT documents, you'll need it anyway. One problem on a machine of this power is the tremendous toll that web-based ads place on the overall memory usage. In fact, a badly ad'ed page can make the browser stop completely, so I had to make those ads disappear. One way would be to install an ad-blocker plugin, but that's another hit on available memory, so a simpler method was called for.
As this is a Linux box, I simply downloaded an [ad-blocking hosts file][10]. This is an amazing piece of community work that consists of over 15,000 hostnames for basically any server that spits out ads. All the entries point to an IP address of 0.0.0.0, so there's no time wasted and your bandwidth's your own again. It's a free download and can be added to the end of an existing hosts file. Of course, the major value, as far as I'm concerned, is that page load times are much quicker.
The screen capture below shows an ad-free Firefox overlaid with the same page in [ELinks][11].
![Firefox and eLinks browsers on Raspberry Pi][12]
No ads in either, but if you don't need all the eye candy rendered by Firefox, ELinks will provide a super-clean experience. (Normally, all that whitespace in the Firefox image is filled with ads.) The ELinks browser is an interesting hybrid browser that is primarily text-based and is similar to the classic pure-text Lynx browser.
### Messaging
It would be overkill, and undesirable from a security point of view, to have Microsoft Skype on the Pi, so I decided on a Jabber/XMPP client, [Psi][13]. Psi has the advantage of not having a multitude of dependencies, and it also works really well. It's easy to take part in multi-user chats, and I have another Pi hosting a Jabber server to test it on. There's no character-mode version, unfortunately, and most of the text-based clients I tried had problems, so it's a GUI-only situation at the moment. No matter; it works well and doesn't use a lot of resources.
### Email
I also tried a number of email applications: this was easily the most important application. Eventually, I chose [Claws Mail][14]. Sadly, it doesn't do HTML mail, but it's rock-solid reliable. I have to say that I can't get the GNU Privacy Guard (GPG) plugin working properly yet due to some unresolved version issues, but I can always encrypt messages in a terminal, if need be.
### Audio
Music is important to me, and I chose [SMPlayer][15] as my media player. It supports many options, including playlists for local and networked files and internet radio streaming. It does the job well.
### Video
I'll not go into the video player in any great detail. Bearing in mind the hardware specs of the Pi, reliably playing back a video stream, even on the same network, was problematic. I decided that if I wanted to watch videos, I had other devices more suited to it. I did try and experiment with the **gpu_mem** setting in the **[/boot/config.txt][16]**, switching it from the default 64MB to 96MB. I was prepared to borrow a bit of application memory for the video player, but even that didn't seem to make it work well. In the end, I kept that setting so that the desktop environment would run more smoothly, and so far, I haven't had problems. The irony of this is that I have another Pi that has a [DLNA][17] server installed, and this can stream video exceedingly well—not just to one client, but several. In its defense, though, it doesn't have a desktop environment to contend with. So, for now, I don't bother trying to play video.
### Image processing
I need to do simple, lightweight photo and image editing, and I knew from prior experience that GIMP and similar packages would bring the Pi to its knees. I found an app called [Pinta][18], which resembles an enhanced Microsoft Paint, but with more cojones. As someone with a large image collection, I also needed a slideshow application. After much evaluation, I decided on [feh][19]. Normally run from a terminal within the GUI desktop, it has an incredible array of options that can help you produce an image slideshow, and again, it has low memory requirements.
### Office suite
And then there was an office suite. On the old Mac Mini, I was happily (and legally) running a copy of Microsoft Mac Office 2004, and I was truly sorry to lose that. I just needed a Microsoft Word and Excel equivalent, but I had to bear in mind the Pi's limitations. Sure, there are standalone versions of word-processor and spreadsheet applications, but there was nothing that really gave me confidence that I could edit a full-featured document.
I already knew of [LibreOffice][20], but I had my doubts about it because of its Java Runtime Environment (JRE) requirement, or so I thought. Thankfully, JRE was optional, and as long as I didn't want to use (database) connection pooling of macros, there was no need to enable it. I also used as many built-in options as possible, rejecting skins and themes; this brought the overall memory footprint down to a reasonable level, and hey, I'm writing this on LibreOffice Writer now! I adopted the attitude that if it has a built-in theme, use it!
Here's the current [memory overview][21] (in MB) from within the GUI desktop:
![Raspberry Pi GUI memory usage][22]
### Miscellaneous
Other desktop software I've installed (not much as I wanted in order to keep this a minimal installation) is:
* [FileZilla][23]: SFTP/FTP client
* [PuTTY][24]: SSH/telnet terminal frontend
* [Mousepad][25]: A versatile plain-text editor, similar to Wordpad or Notepad, but much more powerful **[Note: this link was broken. Is this ok?]**
Overall, the entire setup works as intended. I've found that it performs well, if a little slow sometimes, but this is to be expected, as it's running on a Raspberry Pi with a 900MHz clock speed and 1GB of memory. As long you're aware of and prepared to accept the limitations, you can have a cheap, very functional system that doesn't take up all your desk space.
## Lacking in characters
Life with a Pi desktop is not all about the GUI; it's a very competent command-line environment too, should you need one. As a Linux developer and geek, I am very comfortable in a character-mode environment, and this is where the Pi really comes into its own. The performance you can expect in the command-line environment, at least in my configuration, is dependent on a number of factors. I'm limited to a certain extent by the Pi's network-interface speed and the overall performance of my Netgear ReadyNAS 102, another slightly underpowered, consumer-grade ARM box. The one thing that did please me, though, was the noticeable increase in speed over the Mac Mini!
Running in a native terminal environment, this is the typical memory usage (in MB) you might expect:
![Raspberry Pi terminal memory usage][26]
One thing to note is the lack of a swap partition. It's generally accepted that any type of swap system on a Raspberry Pi is a Very Bad Thing™ and will wear out your SD card in no time. I considered setting up a swap partition on the NAS box, but I ruled this out early on, as it would very negatively impact the network as a whole, and as with the NFS mount issue, the swap partition would need to be mounted before the network came up. So no go.
Having lived with Raspberry Pis for some time now, let's just say that one has to learn to set things up carefully in the first place to avoid the need, and ultimately, it can teach you to manage computers better.
As part of my efforts to make the Pi as useful as possible, I had to envision a scenario where whatever I was working on was either so resource-hungry that I couldn't run a GUI desktop or the GUI was just not required. That meant reproducing as many of the desktop-only apps in a character-mode environment. In fact, this was easier than finding the equivalent desktop apps.
Here is my current lineup:
* **File manager:** [Midnight Commander][27]; if you're old enough to remember Norton Commander, you'll know what it looks like.
* **File transfer:** SSH/SFTP; normally handled by PuTTY and FileZilla on the desktop, you just use these two commands as provided.
* **Web browser:** Lynx or Links are classic character-mode browsers that significantly speed up the internet experience.
* **Music player:** Yes, you can play music in a character-mode terminal! [Mpg123][28] is the name of the app, and when it's run as **mpg123 -C**, it allows full keyboard control of all playback functions. If you want to be really cool, you can alter the way Midnight Commander handles MP3 files by editing **/etc/mc/mc.ext** and adding the code snippet below. This allows you to browse and play your music collection with ease. [code] shell/i/.mp3
      Open=/usr/bin/mpg123 -C %f
      View=%view{ascii} /usr/lib/mc/ext.d/sound.sh view mp3
```
* **Office:** Don't be silly! Oh wait, though; I installed the character-mode spreadsheet app called **sc** (Supercalc?), and there's always Vi if you want to edit a text document, but don't expect to able to edit any Microsoft files. If your need is truly great, you can install a supplementary application called Antiword, which will let you view a .doc file.
* **Email:** A bit of a problem, as the Claws Mail mailbox format is not directly compatible with my character-mode app of choice, Mutt. There's a workaround, but I'm only going to do it if I get some spare time. For sending quick emails, I installed ssmtp, which is described as "a send-only sendmail emulator for machines which normally pick their mail up from a centralized mail hub." The setup is minimal, and overhead is practically nil, as normally it's invoked only when mail is being sent. So, you can do things like typing **echo "The donuts are on my desk" | mail -s"Important News" [everybody@myoffice.com][29]** from the command line without firing up a GUI mail app.
For everything else, it's just a question of flipping back to the GUI desktop. Speaking of which…
![Raspberry Pi GUI desktop environment][30]
Quite a busy screen, but the Raspberry Pi handles it well. Here, I'm using LibreOffice to write this article, there's a network status box, Firefox is on the mpg123 website, and there's a terminal running top showing how much memory (isn't) being used. The drop-down menu on the left shows the office suite apps.
## Other scenarios and thoughts
### What's where
With any hybrid system like this, it's important to remember what is located where so that, in the event of any problems, recovery will be easier. In my current configuration, the microSDHC card contains only the operating system, and as much as possible, any system-configuration files are also on there. Your own userland data will be on the NAS in your home directory. Ideally, you should be to replace or update the software on the microSDHC without having any adverse effects on your computing environment as a whole, but in IT, it's never that straightforward.
In the X11 GUI desktop system, although there is a default config file in **/etc/X11**, you will invariably have a customized version containing your own preferences. (This is by design.) Your own file on the NAS, however, will reference files on the microSDHC:
![Location of files][31]
The overall effect is that if you change one environment for another, you will invariably experience a change (or loss) in functionality. Hopefully, the changes will be minor, but you do need to be aware of the sometimes ambiguous links.
Please remember that the **root** user will _always_ be on the microSDHC, and if your NAS box fails for any reason, you'll still be able to boot your system and at least do some recovery work.
### NAS alternatives
While I'm in my home office, I have full access to my NAS box, which represents what (in today's terminology) would be a personal cloud. I much prefer this solution to a commercial cloud that is invariably managed by a company of unknown origin, location, security, and motives. For those reasons, I will always host my data where I can see it and physically get to it as required. Having said that, you may not be as paranoid as I am and will want to hook up your Pi desktop to an external cloud share.
In that case, using an NFS mount as a basis for your home directory should mean that it's simply a matter of editing your **/etc/fstab** to point the NFS client at a different location. In my setup, the NAS box is called, er, NASBOX, and the local NFS share mountpoint is called **/NASmount**. When you create your non-root user, you'll simply move their home directory to an existing directory called **/NASmount**:
```
NASBOX:/data/yourshare /NASmount nfs
nfsvers=3,rsize=8192,wsize=8192,timeo=60,intr,auto 0 0
mount -t nfs -v NASBOX:/data/yourshare /NASmount
```
and then your directory tree could look like this:
```
`/NASmount/home/user`
```
So, by simply changing the **/etc/fstab** entry, you could quickly be hooked up to someone else's cloud. This, as they say, is left as an exercise for the re

View File

@ -0,0 +1,104 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Basilisk: A Firefox Fork For The Classic Looks and Classic Extensions)
[#]: via: (https://itsfoss.com/basilisk-browser/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Basilisk一个有着经典外观和经典扩展的 Firefox 分支
======
_ **简介Basilisk 是一个 Firefox 分支,它支持旧版扩展等更多功能。在这里,我们看一下它的功能并尝试一下。**_
### Basilisk基于 XUL 的开源 Web 浏览器
尽管最好使用 Linux上的常规浏览器如 Firefox 或 Chromium但了解其他浏览器也没坏处。最近我偶然发现了一个 Firefox 分支,[Basilisk][1] 浏览器,它有经典的 Firefox 用户界面以及旧版扩展支持(就像 [Waterfox][2] 一样)。
![itsfoss.com homepage on Basilisk][3]
如果你迫切需要使用旧版扩展程序或怀念 Firefox 的经典外观Basilisk 浏览器可以帮到你。这个浏览器是由 [Pale Moon][4] 浏览器背后的团队维护(这是我接下来要介绍的另一个 Firefox 分支)。
如果你正在寻找开源 [Chrome 替代品][5],那么你可以快速了解一下 Basilisk 提供的功能。
**注意:**_Basilisk 是开发中软件。即使我在使用时没有遇到重大的可用性问题但你也不应依赖它作为唯一使用的浏览器。_
### Basilisk 浏览器的特性
![][6]
Basilisk 开箱即用。但是,在考虑使用之前,可能需要先看一下以下这些特性:
* 基于 [XUL][7] 的 Web 浏览器
  * 它具有 “Australis” Firefox 界面,着在 v29v56 的 Firefox 版本中非常流行。
  * 支持 [NPAPI][8] 插件Flash、Unity、Java 等)
  * 支持 XUL/Overlay Mozilla 形式的扩展。
  * 使用 [Goanna][9] 开源浏览器引擎,它是 Mozilla [Gecko][10] 的分支
  * 不使用 Rust 或 Photon 用户界面
  * 仅支持 64 位系统
### 在 Linux 上安装 Basilisk
你可能没有在软件中心中找到它。因此,你必须前往其官方[下载页面][11]获得 tarballtar.xz文件。
下载后,只需将其解压缩并进入文件夹。接下来,你将在其中找到一个 “**Basilisk**” 可执行文件。你只需双击或右键单击并选择“**运行**”即可运行它。
你可以查看它的 [GitHub 页面] [12]获取更多信息。
![][13]
你也可以按照下面的步骤使用终端进入下载的文件夹,并运行文件:
```
cd basilisk-latest.linux64
cd basilisk
./basilisk
```
[Download Basilisk][1]
### 使用 Basilisk 浏览器
![][14]
如果你想要旧版扩展支持Basilisk 是不错的 Firefox 分支。它是由 Pale Moon 背后的团队积极开发的,对于希望获得 Mozilla Firefox在 Quantum 更新之前)经典外观,且不包括现代 Web 支持的用户而言,它可能是一个不错的选择。
浏览网页没有任何问题。但是,我注意到 “**YouTube**” 将其检测为过时的浏览器,并警告说它将很快停止支持它。
_**因此,我不确定 Basilisk 是否适合所有现有的 Web 服务-但是,如果你确实需要使用在 Firefox 较早版本中的扩展,那这是一个解决方案。**_
**总结**
你认为 Firefox 分支值得尝试吗?你喜欢哪个?在下面的评论中分享你的想法。
--------------------------------------------------------------------------------
via: https://itsfoss.com/basilisk-browser/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.basilisk-browser.org/
[2]: https://itsfoss.com/waterfox-browser/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-itsfoss.jpg?ssl=1
[4]: https://www.palemoon.org
[5]: https://itsfoss.com/open-source-browsers-linux/
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-options-1.jpg?ssl=1
[7]: https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XUL
[8]: https://wiki.mozilla.org/NPAPI
[9]: https://en.wikipedia.org/wiki/Goanna_(software)
[10]: https://developer.mozilla.org/en-US/docs/Mozilla/Gecko
[11]: https://www.basilisk-browser.org/download.shtml
[12]: https://github.com/MoonchildProductions/Basilisk
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-folder-1.jpg?ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-browser-1.jpg?ssl=1