Sunday, July 31, 2022

Opppppsss you did it again

shellfirm

Opppppsss you did it again? 😱 😱 😰

How do I save myself from myself?

  • rm -rf *
  • git reset --hard Before hitting the enter key?
  • kubectl delete ns Stop! you are going to delete a lot of resources
  • And many more!

Do you want to learn from other people's mistakes?

shellfirm will intercept any risky patterns (predefined or user's custom additions) and will immediately prompt a small challenge that will double verify your action, think of it as a captcha for your terminal.

$ rm -rf /
#######################
# RISKY COMMAND FOUND #
#######################
* You are going to delete everything in the path.

Solve the challenge: 8 + 0 = ? (^C to cancel)

How does it work?

shellfirm will evaluate all the shell commands behind the scenes. If a risky pattern is detected, you will immediately get a prompt with the relevant warning to verify your command.

Example

Installation

1. Install via brew

brew tap kaplanelad/tap && brew install shellfirm

Or download the binary file from releases page, unzip the file and move to /usr/local/bin folder.

2. select shell type:

If you use Oh My Zsh

curl https://raw.githubusercontent.com/kaplanelad/shellfirm/main/shell-plugins/shellfirm.plugin.zsh --create-dirs -o ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/shellfirm/shellfirm.plugin.zsh
  • Add shellfirm to the list of Oh My Zsh plugins when Zsh is loaded(inside ~/.zshrc):
  • ℹ️ Open a new shell session

More supported shells

Verify installation

$ mkdir /tmp/shellfirm
$ cd /tmp/shellfirm
$ git reset --hard

You should get a shellfirm prompt challenge.

If you didn't get the prompt challenge:

  1. Make sure the shellfirm --version returns a valid response.
  2. Make sure that you downloaded the Zsh plugin and added it to the Oh My Zsh plugins in .zshrc.

Risky commands

We have predefined a baseline of risky groups command that will be enabled by default, these are risky commands that might be destructive.

Group Enabled By Default
base true
git true
fs true
fs-strict false
shellfirm config update --check-group fs-strict
kubernetes false
shellfirm config update --check-group kubernetes
kubernetes-strict false
shellfirm config update --check-group kubernetes-strict
heroku false
shellfirm config update --check-group heroku

Custom checks definition examples

shellfirm creates by default a configuration file at ~/.shellfirm/config.yaml. Make sure that you only edit enable field (in case you want to disable a specific check), all the rest fields are managed by shellfirm command (shellfirm config --help).

challenge: Math # Math, Enter, Yes

includes: 
  - base
  - fs
  - git

checks:
  - test: git reset
    method: Contains
    enable: true
    description: "This command going to reset all your local changes."
    from: git
    challenge: Default
  - test: "rm.+(-r|-f|-rf|-fr)*"
    method: Regex
    enable: true
    description: "You are going to delete everything in the path."
    from: fs
    challenge: Default
  - test: ">.+/dev/sda"
    method: Regex
    enable: true
    description: "Writing the data directly to the hard disk drive and damaging your file system."
    from: fs
    challenge: Default
  - test: "mv+.*/dev/null"
    method: Regex
    enable: true
    description: "The files will be discarded and destroyed."
    from: fs
    challenge: Default

ℹ️ To define custom checks that are not part of shillfirm baseline, add new checks to the config.yaml with the following field: from: custom.

  - test: "command to check"
    method: Regex
    enable: true
    description: "Example of custom check."
    from: custom
    challenge: Default

ℹ️ To define different challenge for a checks you can change the field challenge: Default with a different check.

Add new group checks

$ shellfirm config update --check-group {risky-command-group-a} {risky-command-group-b}

Remove new group checks

$ shellfirm config update --check-group {group} {group} --remove

Disable specific checks

Edit the configuration file in ~/.shellfirm/config.yaml and change the check to enable:false.

Change challenge:

Currently we support 3 different challenges when a risky command is intercepted:

  • Math - Default challenge which requires you to solve a math question.
  • Enter - Required only to press Enter to continue.
  • Yes - Required typing yes to continue.

You can change the default challenge by running the command:

$ shellfirm config challenge --challenge Math

At any time you can cancel a risky command by hitting ^C

To Upgrade shellfirm

Contributing

Thank you for your interest in contributing! Please refer to contribution guidelines for guidance.



from Hacker News https://ift.tt/wCFS9jK

I've been making JavaScript sandbox alone for 6 years



from Hacker News https://playcode.io/

Saturday, July 30, 2022

What Is EXIF Data in Digital Photos?

In the digital age, there’s a lot more to a photograph than the image itself. When most digital cameras capture an image, they record certain parameters and write them in the image’s file for later use. These parameters are called metadata and are stored as Exchangeable Image File data, or EXIF for short.

EXIF is useful, but can also have negative impacts in certain cases. This guide will teach you about EXIF, its advantages and disadvantages, and how to use it in photography.

Note: Although metadata is stored as EXIF, the two terms are often used interchangeably.

Table of Contents

EXIF Parameters

It’s important to understand that EXIF is much more than just the shutter speed, aperture, and ISO of your image. While you might use those the most when looking at EXIF data, EXIF encompasses much more. Here is a list of common parameters that EXIF encompasses.

  • Shutter speed
  • Aperture
  • ISO
  • Camera model, manufacturer, and serial number
  • Lens model, manufacturer, and serial number
  • Focal length when the photo was taken
  • White balance
  • Metering settings
  • Flash settings (if one was used)
  • Image resolution
  • Color space
  • Date and time that the photo was taken
  • Post-processing adjustments
  • GPS coordinates of the photo’s location (if your camera has GPS and it is turned on)

How to View EXIF Data

There are many ways to access and view EXIF, from websites to built-in tools that come with your computer. This may come in handy when trying to view your own EXIF, and could also be useful if you are trying to find EXIF in an image that is not yours.

Using a Website to View EXIF Data

Perhaps one of the easiest ways to view EXIF data is to upload your image(s) to a website. This has its advantages in being easy to find and operate. It can also take much longer and require more effort because you will need to upload your image(s) with an internet connection. This method is difficult to use with a batch of images, so it’s best if you’re only looking for the EXIF of
a small number of images. Some websites may give you more data than built-in tools in your computer, such as adjustments in post-production.

One potential risk of using online EXIF viewers is that you are uploading your images to a website that could use your images for other purposes. Before using an online EXIF viewer, be sure to research potential risks and read reviews.

Here are a few websites that you may find useful in viewing EXIF data:

Screenshots of EXIF viewing web tools.

Adobe Lightroom’s Metadata Panel

Perhaps one of the most organized and useful ways to view metadata is via Adobe Lightroom’s metadata tool. To access it, click the Library module > Library Filter: Metadata.

This will allow you to search your catalog by metadata, and you can add or remove parameters as you choose. This will give you a quick glance at different parameters and their images, and it will help you search your entire catalog if you’re looking for something specific regarding metadata.

Built-in EXIF Viewer on a Mac

To view an image’s metadata on Mac, simply open it in Preview, which is usually the default application to display images. From here, click Tools > Show Inspector (or Command + I) and click the “EXIF” tab at the top of the Inspector.

This won’t give you as much data as some of the websites listed above, but it will give you the most commonly used EXIF parameters.

If you’re looking to just quickly glance at a few parameters such as shutter speed, focal length, aperture, and resolution, you can right-click on an image in its folder and press “Get Info.”

This will give you a quick glance at parameters you may be looking for, and can easily be done with a batch of images if they are all selected.

Built-in EXIF Viewer in Windows

To view an image’s metadata on Windows, right click the image in its folder and select “Properties.”

Click the “Details” tab and EXIF data will be listed. You’ll also see an option to edit and remove EXIF, which is discussed later in this article.

Advantages and Disadvantages of EXIF Data

In a world where EXIF is often shared over social media, there has been discussion about certain ethics and practices of publicizing the settings you used in a photo, your location, and other parameters. Here are a few pros and cons of sharing and using EXIF data.

Pros

1. Teaching and Learning. EXIF is a great teaching and learning tool. If you want to learn the right balance between shutter speed, aperture, and ISO in certain scenarios, find photographers who share their EXIF data and try to replicate their tactics. Of course, it would be even better to learn how to adjust your settings in an adaptive way, so see the corresponding con below.

Tip: Study EXIF by going through data and asking yourself if you can figure out why a certain parameter is the way it is. This will help you understand the “why” behind certain metadata, and allow you to better understand why you might change a parameter in the field.

2. Organizing Post-Production. EXIF can help you stay organized in post-production. Maybe you have a bunch of shots at high ISO and you want to run a batch denoise algorithm on those images. Knowing how to read their metadata is important for knowing which images you might want to process. Use Adobe Lightroom’s metadata search feature to search through your entire catalog for certain parameters.

3. Consistency Between Photos. If you need to stay consistent, (i.e. you are doing headshots for a company that hires new people throughout the year and wants similar photos for all of them), you can refer to your own EXIF to try to stay as consistent as possible. If you’re outdoors, environmental factors can influence your consistency, but the image should be somewhat similar if you are in the ballpark.

4. Crime Evidence. EXIF has been extremely useful in crime investigation, especially with the advancement of GPS technology. Photos shared and sent with location metadata stored in EXIF files have helped determine the whereabouts of people involved in criminal activity. Even simpler than GPS are the date and time of when images were taken, which are recorded in EXIF and can also be used as evidence.

Cons

1. Straight Copying Isn’t Useful. Simply copying someone’s settings won’t be useful on a shoot where you need to adapt, such as a portrait shoot, adventure shoot, and most types of commercial photography. Using jazz musicians as an analogy, they are generally respected for their ability to improvise and use what they know about music to make new, equally good, or better ideas. Sure, they would sound great if they played a complex solo exactly the same as someone else, but that isn’t useful in many scenarios and leaves no room for creative interpretation. Instead of copying someone’s EXIF, learn how EXIF combines to make a great image, and use that to your advantage.

2. Lack of Originality. With the point above, originality can be compromised if other photographers are using your exact metadata to produce an image like yours.

3. Privacy Issues. Certain parameters, especially those involving location, can have privacy-related impacts on people and the environment. Hard-to-reach locations that have been recorded in EXIF have been “discovered” and ruined by erosion, littering, and other detrimental human impacts. On social media apps especially, there are security concerns regarding sharing images with a specific location, since many smartphones record GPS coordinates in their EXIF and apps will provide an option to share that.

4. Inconsistent Standards. EXIF standards are not necessarily maintained and kept up to date. This can make for confusing, unnecessary, and counterintuitive data.

How to Remove EXIF Data From Your Photos

EXIF can be an invasion of privacy in a couple of different ways. Luckily, there are lots of methods to remove EXIF from your photos, selectively and entirely.

Removing EXIF from Photos on Mac

Mac OS doesn’t have a built-in EXIF remover, but it will allow you to remove the location from an image easily. Simply open your image in Preview, open the Inspector (Command + I), click the “GPS” tab and select “Remove Location Info” at the bottom.

If you want to remove all of the metadata, ImageOptim is a free, easy-to-use program that will strip an image of all of its metadata in seconds. Be aware that this is irreversible, so if you want a copy of the metadata somewhere, it’s best to make two copies of the image and only strip one.

At this time, it doesn’t appear that ImageOptim supports Apple .HEIC compression, so you will have to convert photos to .JPG or .PNG. There are various settings that you can change, but make sure to do it before dragging and dropping images into the software.

Removing EXIF from Photos on Windows

Windows has a built-in EXIF remover and will let you selectively remove EXIF from an image. Right click the image, select “Properties” and then click the “Details” tab. You’ll see a button that says “Remove Properties and Personal Information,” which will allow you to selectively remove parameters from the image’s EXIF. You can also simply create a copy with all possible properties removed.

Removing EXIF from Photos on iOS and Android

First of all, it’s possible to disable geotagging (saving GPS data to your photo) in Settings or your Camera app. If you’d still like geotagging but want to remove the location from a specific photo on iOS, simply go into the Photos app, swipe up, and select “Adjust” under the map.

From here, you are able to change or remove the location.

Both iOS and Android have apps to completely remove metadata from photos. Check out Exif Metadata for iOS and Photo Metadata Remover for Android as two free options.

Conclusion

EXIF is the file that stores certain parameters of an image called metadata. You can use it to your advantage as a photographer by learning from your own and other metadata, and it can also be harmful in terms of security and privacy.

Understanding EXIF is important in becoming a better photographer so that you can take advantage of its pros and be aware of its cons.



from Hacker News https://ift.tt/4cDhBaV

Taking a look at the Rogers outage CRTC letter

Last week, the CRTC made public a redacted version of the response Rogers filed with answers to the regulators questions. I started my career in wireless telecommunications for a competitor to Rogers here in Canada, and wanted to dig through the outage. I've been out of the industry for a few years now, but my outdated perspective may be of some use here.

Unfortunately, the redacted version removes almost all the useful information for other carriers or other industries to learn from this outage. But I still dug through the report to try and find what useful information I could.

Resources

Regulator Filings

If you're instead interested in a media level analysis, here are some of the media reports i've found.

CRTC Letter

The letter itself basically outlines that the Canadian Radio-television and Telecommunications Commission (CRTC) wants to inquire into the outage that began on July 8th, 2022. And adds the basis for this outreach, including disruptions to business, emergency services, and more.

You can read the full letter above, but effectively it's an outline of questions that Rogers has been asked to respond to. I'll go through what I see as the important questions and perspective as we go through the response.

Rogers Response

At a high level, Rogers starts by confirming that they had identified the cause of the outage.

We have identified the cause of the outage to a network system failure following an update in our core IP network during the early morning of Friday July 8th. This caused our IP routing network to malfunction. To mitigate this, we re-established management connectivity with the routing network, disconnected the routers that were the source of the outage, resolved the errors caused by the update and redirected traffic, which allowed our network and services to progressively come back online later that day. While the network issue that caused the full-service outage had largely been resolved by the end of Friday, some minor instability issues persisted over the weekend.

What I find interesting about this is the reference to minor instability issues that persisted over the weekend.

When I worked on a similar outage, where the underlying core network went down for 20 or 30 minutes, my team spent the next 10 or so hours finding and fixing the glitches in the cellular network. This was mainly in broken states within different equipment. Nothing exposes those bugs as good as taking out the underlying network at all layers at the same time.

For example think of an HTTP proxy. A client comes to the proxy, makes a request, the proxy holds some request state, and sends the request to a server. You probably know exactly what happens and it's well tested if the upstream server goes down. Just return an error to the client. If the client loses connection, well understood as well, complete the upstream request, and discard it. But what happens if both the upstream and client networks fail at the same time. You start exercising a code path that combines failures that usually aren't as well tested. Combine this with some missing internal state, and you start having failures.

Especially in cellular networks, there are all sorts of state that's distributed around the network and needs to be kept in sync for different call procedures. This can result in things like being able to send but not receive an SMS message.

Our engineers and technical experts have been and are continuing to work alongside our global equipment vendors to fully explore the root cause and its effects. 

This is another interesting point that might be missed on many that don't know the industry. Telecommunication companies primarily operate as integrators of vendors equipment. While this isn't always the case, most equipment to build and create the network will be purchased from vendors. So if you want a cellular radio for LTE, you may buy the particular piece of equipment from Nokia, Ericcson, Huawei, or others.

In this model of buying equipment from vendors, it often creates an incentive to blame the vendor for outages. But even harder at times, can be to convince another company to work on a feature or design change to make configuration errors less likely. Or like any complex situation, there is probably plenty of blame to share between both the operator and the vendor.

Additionally, Rogers will work with governmental agencies and our industry peers to further strengthen the resiliency of our network and improve communication and co-operation during events like this. Most importantly, we will explore additional measures to maintain or transfer to other networks 9-1-1 and other essential services during events like these.

I'll dig into this deeper later on. But the failure of 911 services, especially for cell phones seems like an incredibly bad design oversight. Cell phones when not attached to a network, can already do an emergency call on any network the phone can find. So by continuing to advertise the Rogers network throughout the outage, caused phone to stick to the broken network. Or probably caused an unattached phone to scan for an available network, and not find a working 911 network.

Questions and Answers

About the outage

Provide a complete and detailed report on the service outage that began on 8 July 2022

Unfortunately it looks like Rogers preferred to keep the full details confidential, and the full timeline was attached as confidential. But included are some high level details.

The network outage experienced by Rogers on July 8th was the result of a network update that was implemented in the early morning. The business requirements and design for this network change started many months ago. Rogers went through a comprehensive planning process including scoping, budget approval, project approval, kickoff, design document, method of procedure, risk assessment, and testing, finally culminating in the engineering and implementation phases. Updates to Rogers’ core network are made very carefully.

For those outside of telecom, method of procedure may be unfamiliar. While different companies may operate differently, the method of procedure is basically a document that outlines how a change in the network should be executed. It can be as detailed as every command someone in operations should run to make the change, step by step. It may also contain pre-checks that should be executed.

The philosophy is a sort of separation of inputs, where one engineer will write the procedure for the change to be executed, and then someone tasked with operations will be responsible for execution. I don't know if this is how Rogers is using MOPs however.

Maintenance and update windows always take place in the very early morning hours when network traffic is at its quietest.

I can't comment as to Rogers, however I know at other big telecoms in Canada that this isn't true for every change. There are plenty of changes that are deemed non-risky, and will be executed when convenient. I've also seen different managers and agenda come into play that try to push against change windows to be more efficient, and often a back and forth on the balance of stability vs getting things done.

The configuration change deleted a routing filter and allowed for all possible routes to the Internet to pass through the routers. As a result, the routers immediately began propagating abnormally high volumes of routes throughout the core network. Certain network routing equipment became flooded, exceeded their capacity levels and were then unable to route traffic, causing the common core network to stop processing traffic. 

This twitter thread likely covers this side of the impact better than I can: https://twitter.com/atoonk/status/1550896347691134977

The Rogers outage on July 8, 2022, was unprecedented. As discussed in the previous response, it resulted during a routing configuration change to three Distribution Routers in our common core network. Unfortunately, the configuration change deleted a routing filter and allowed for all possible routes to the Internet to be distributed; the routers then propagated abnormally high volumes of routes throughout the core network. Certain network routing equipment became flooded, exceeded their memory and processing capacity and were then unable to route and process traffic, causing the common core network to shut down. As a result, the Rogers network lost connectivity internally and to the Internet for all incoming and outgoing traffic for both the wireless and wireline networks for our consumer and business customers.

I'm going to nitpick calling this an unprecedented outage. Based on what I can get out of the report and not being able to see the full internal analysis, this seems fairly predictable. The outage explanation is basically some automation removed a piece of configuration that was essential for the routers to function. Without the configuration, routers within the network went into CPU overload processing routing updates.

Someone knew about this and placed that configuration on the router.

This is a known failure mode for most routing equipment. Most of these big routers seem like big powerful machines, but they tend to be more of a fast path for pushing many millions of packets. And a separate compute for sending and receiving signalling about where those packets should go. The control plane side that does the signalling there are often many ways to overload, which will cause peers to think the router has died.

How did Rogers prioritize reinstating services and what repairs were required?

The prioritization of service restoration was always dependent on which service was most relied upon by Canadians for emergency services. As wireless devices have become the dominant form of communicating for a vast majority of Canadians, the wireless network was the first focus of our recovery efforts. Subsequently, we focused on landline service, which remains another important method to access emergency care. We then the worked to restore data services, particularly for critical care services and infrastructure.

I suspect reality is a bit more nuanced that multiple teams were probably looking at the equipment they were responsible for in parallel. If there was a glitch for some subscribers in the LTE network for example, people who focus on the LTE network were likely addressing that. But from a total outage perspective, I'm sure teams were focussing more or less in this order.

Having working big outages like this, once the underlying IP network is restored and the upper layer network comes back up, there will be a plethora of impacts, alarms, metrics that need to be sorted through.

When I worked a similar outage for a competitor, the team would find something like call failure rates are 5x normal, but also trending back towards normal. And then it's a tough thing to figure out, will it return to normal on its own? Maybe customers are rebooting their phones, so it looks like it's returning to normal but only because customers are taking their own actions. What options do we have to clean up the call states that are leading to those failures? Maybe the only tool available doesn't know who is and isn't working, so the only option is to reset every device. Is resetting every device worth it to move from a 2% failure rate to a normal 0.4% failure rate?

What measures or steps were put in place in the aftermath of the earlier-mentioned April 2021 outage, and why they failed in preventing this new outage?

Everything substantive in the response to this question was redacted. It's unfortunate, because as an industry, including non-telecom like SRE can learn substantially from how Telecoms operate networks as reliable as they are.

Basically Rogers did lots of vague things to prevent similar failures.

How did the outage impact Rogers’ own staff and their ability to determine the cause of the outage and restore services?

At the early stage of the outage, many Rogers’ network employees were impacted and could not connect to our IT and network systems.  This impeded initial triage and restoration efforts as teams needed to travel to centralized locations where management network access was established. To complicate matters further, the loss of access to our VPN system to our core network nodes affected our timely ability to begin identifying the trouble and, hence, delayed the restoral efforts.  

This is the inherent difficulty in managing network systems. While in my experience the network architectures tend to be layered, when you're also the ISP I can imagine the difficulty in this separation. And problems are rare enough that it gets difficult to predict exactly what outages will knock out employee access.

Alot of the carriers also lease infrastructure from eachother, so one big telco can cause impacts in another.

I almost wonder if there is room for something like Starlink here, as the satellite infrastructure would almost be guaranteed to provide diverse network access to a location, without running additional wires in the ground.

Having experienced a similar failure, when I noticed my home internet and cell phone were all offline, I started driving to the office to get a stable connection to production. That was a long day.

Extent to which Rogers sought or received assistance from other TSPs in addressing the outage or situation arising from the service interruption?

In order to allow our customers to use Bell or TELUS’ networks, we would have needed access to our own Home Location Register (“HLR”), Home Subscriber Server (“HSS”) and Centralized User Database (“CUDB”). This was not possible during the incident. 

Basically what Rogers is describing here are the databases used to track and authenticate mobile devices were also unavailable. In cellular mobility, the network can be thought of as two networks for two different purposes. There is a visited network, more or less the radio towers you connect to. And the home network, which is what actually gives you internet, cellular, SMS, etc services. When you're on your own carrier, you're using your own carriers visited and home networks.

But when you go somewhere else, say the United States, you change your visited network and keep your home network. What Rogers is basically saying, is there home network was broken, so the other carriers weren't able to help, because they wouldn't be able to authenticate devices, or connect them back to this home network.

There is some tech that allows for internet connections to only use the visited network, but when I was in the industry this was not commonly deployed.

Furthermore, given the national nature of this event, no competitor’s network would have been able to handle the extra and sudden volume of wireless customers (over 10.2M) and the related voice/data traffic surge. If not done carefully, such an attempt could have impeded the operations of the other carriers’ networks. 

This is a key point. I don't know that any of the other major carriers would be able to predict how the sudden influx would affect their networks. While telecom is trying to move in a model alot more like SaaS providers that can autoscale equipment, I don't know how successful this would be.

Let's pick something simple. The number of IP addresses available to be assigned to a phone. The other operators likely only provision enough to cover their own needs. Taking over another carrier in Canada isn't an expected failover pattern, so there isn't provisioning to handle this need. And IP addresses are likely only 1 of 10,000 different capacity constraints that go into a mobile network.

My 2 cents is the most likely path to even considering allowing something like this would be more akin to multi-sim support. Where you would have credentials on your Sim card for both Rogers and a competitor network and the device could switch, if warranted. And then the possibility of this failover goes into the capacity planning for the networks and is only for customers that need it.

Impact on Emergency Services

The impact to emergency services is really why I wanted to dig into this report, and try to understand specifically why Rogers cell phones were unable to make emergency calls. Having done some small work on 911 services for cell phones, normally any device is able to attach to any network, unauthenticated, to make emergency calls. Which means while the Rogers core network was down, something was causing the Rogers radio network to continue to advertise that it was able to take emergency calls. Otherwise the cell phones should have scanned for any available wireless network, and done an emergency attach to get emergency services.

You don't need a SIM card in your phone, a valid account, etc to make a 911 call.

Provide a complete and detailed report on the impact on emergency services of the outage that began on 8 July 2022, including but not limited to:

With respect to wireless public alerting service (WPAS”), the Rogers Broadcast Message Center (“BMC”) platform was operable to receive alerts from Pelmorex, the WPAS administrator.  However, broadcast-immediate (“BI”) public alerts could not be delivered to any wireless devices across Rogers’ coverage areas due to the outage. Based on a review of the alerts received into the WPAS BMC platform, the only impact occurred in the Province of Saskatchewan. There were four alerts, and associated updates, received but not delivered to wireless devices in Rogers’ coverage area. There were no other alerts issued, as seen on our WPAS BMC platform.

I interpret this and other areas of the report to basically indicate that the IP core outage caused the cell sites to be unreachable. So to send an alert out to all devices in an area, you need to reach the cell site to send the message to phones.

With respect to broadcasting (cable TV/Radio) alerts, our alert hardware is connected to our IP network. Since we had no connection to the Internet on July 8th, we were unable to send out any alerts on that day in the regions that we were serving.

And also alerts on services that weren't cell sites all use the IP network.

Whether the outage specifically impacted the 9-1-1 networks or only the originating networks, and if the former, how was this possible in light of resiliency and redundancy obligations imposed by the Commission

The outage solely impacted Rogers’ originating network. The 9-1-1 networks that receive calls from originating networks are not operated by Rogers. Rather, they are operated by the three large Canadian Incumbent Local Exchange Carriers (“ILECs”). They were unaffected by the outage.

This is basically saying that Rogers is not operating the 911 networks themselves, as those are operated by Telus, Bell, and Sasktell across Canada. So the impact was isolated to Rogers network being able to deliver emergency calls to the 911 networks.

Number of public alerts sent that did not reach Rogers’ customers, broken down by province;

Only four (4) alerts were received on Rogers WPAS BMC platform on July 8th. All alerts were in the Province of Saskatchewan. No other alert was issued in Canada on that day:

1. WPAS ID 957:  7:40AM CST: Saskatchewan RCMP – Civil Emergency (Dangerous Person)
2. WPAS ID 960:  4:05PM CST: Environment Canada – Tornado (Warning)
3. WPAS ID 964:  4:19PM CST: Environment Canada – Tornado (Warning)
4. WPAS ID 982:  5:31PM CST: Environment Canada – Tornado (Warning)

I'm just including this as it adds perspective on the number of alerts Rogers wasn't able to deliver across the country that day.

How were 9-1-1 calls processed during the outage and whether they were able to be processed by other wireless networks within the same coverage area

As seen in Rogers(CRTC)11July2022-2.i above, Rogers was able to route thousands of 9-1-1 calls on July 8th.  Rogers’ wireless network worked intermittently during that day as we were trying to restore our IP core network, varying region by region.

...

The connection state of the UE to Rogers wireless network, and the stability of our network, determined the ability of Rogers wireless customers to have their 9-1-1 calls processed by other wireless networks within the same coverage area.

Bell and TELUS confirmed to us that some of our customers were able to connect to their wireless networks in order to place 9-1-1 calls.

The UE is the User Equipment, basically the cell phone.

I think what Rogers is trying to say, is if the cell phone was in a state where it didn't see the Rogers network, like "No Service" on the display, an emergency call would do a network scan and attach to another network with service.

Whether other measures could have been taken to re-establish 9-1-1 services sooner

No other measures would have helped restore 9-1-1 service on July 8th. One possible option that was explored by Rogers was to shut down our RAN. Normally, if a customer’s device cannot connect to their own carrier’s RAN, they will automatically connect to the strongest signal available, even from another carrier, for the purpose of making a 9-1-1 call. However, since Rogers’ RAN remained in service on July 8th, many Rogers customers phones did not attempt to connect to another network.

If this is the case, what the report doesn't talk about at all is that non-Rogers customers could be impacted by this outage as well. If a competitor had very weak coverage, it might scan and find the Rogers network and try to use it for the emergency call, instead of finding a network to use. Or a device that is roaming and in airplane mode and then needs to make an emergency call, will try to attach to the first network it finds.

So if this was the case, the Rogers network behaving like this could have prevented emergency calls from reaching a working network. This certainly would be the minority of devices, but I find this to be infuriating that the network sat there advertising 911 services, for hours, that it could not be delivered.

What alternatives are available to Rogers’ customers to access 9-1-1 services during such outages

The GSM standard for the routing of 9-1-1 calls implies that a wireless customer always has the option to remove the SIM card from their device and then to place the 9-1-1 call. The handset will register to another wireless network (the one with the strongest signal, even if there are not roaming arrangements).

I think the problem is most people wouldn't know even what their sim card is, let alone that it can be removed to make a 911 call. But as with above, the problem here appears to be Rogers continued to advertise a 911 network, so the device might still connect.

I'm also not sure that the strongest signal is correct. With so many frequencies now in use for cellular networks, it can take quite some time to do a full network scan. So I'm not sure devices in this state will scan all possible networks and then choose the strongest signal. I think but am not sure that the devices would connect to the first network found.

Further, some newer smart devices have the capability to reconnect automatically to other wireless network for 9-1-1 calls when the home network is down. 

If this is the case that's great. It would probably be a great idea to put this into the standard.

Summary

I really wanted to dig into this report, as I've worked these sorts of outages. And they are really difficult, as there are infinite ways to make the problems worse, lots of contradictory information, theories of the root cause, and missing information. It is really difficult to operate these networks.

But what I found most frustrating, was the 911 services. The core network is down, but the radio network is continuing to indicate 911 services. While I only suspect this is the case, there isn't a good reason that other networks couldn't be used, other than a desire to do so. I really hope this doesn't get lost on all the major carriers after this outage.



from Hacker News https://ift.tt/xBV0G1a

2022 Amish Population Profile

Population. The estimated population of the Amish of North America (adults and children) as of June 2022 is 373,620. This is an increase of approximately 12,150 since 2021.

States and Provinces. North American Amish communities are located in 32 states and four Canadian provinces. Approximately 62 percent of the North American population lives in Ohio, Pennsylvania, and Indiana.

South America. In the fall of 2015, horse-and-buggy-driving New Order Amish from the Midwest organized two settlements in South America—one in Bolivia and one in Argentina. Each settlement has one congregation. Most of the members come from Old Colony Mennonite background. Today, these settlements relate to New Order Amish communities in Ohio, Indiana, and North Carolina.

Settlements. During the past year, 19 new settlements (geographical communities) were established and five existing settlements dissolved. New settlements are typically small, with only a few families in a single church district (congregation).

Forty-nine percent of all Amish settlements in North America contain only a single church district. Older settlements such as those in the Holmes County, Ohio, and Lancaster, Pennsylvania, areas contain more than 200 districts. (See Twelve Largest Settlements.) Larger settlements may have several different subgroups whereas smaller ones typically have just one subgroup.

Districts. In North America, the number of districts (congregations), each of which generally consists of 20 to 40 families, grew from 2,718 in 2021 to 2,827 in 2022, an increase of 109 in the twelve-month period.

Growth Trends, 2000-2022. The North American Amish population grew by an estimated 195,710 since 2000, increasing from approximately 177,910 in 2000 to 373,620 in 2022, an increase of 110 percent. The Amish population doubles about every 20 years. Since 2000, the number of districts has grown from 1,335 to 2,827, an increase of 1,492 districts. The same period saw a net gain of 303 settlements, including settlements in six new states (Colorado, Nebraska, New Mexico, South Dakota, Vermont, and Wyoming) and three new provinces (Manitoba, New Brunswick, and Prince Edward Island).

Reasons for Population Growth. The primary forces driving the growth are sizable nuclear families (five or more children on average) and an average retention rate (Amish children who join the church as young adults) of 85 percent or more. A few outsiders have joined the Amish, but the growth is almost entirely from within the Amish community.

Reasons for Creating New Settlements. The Amish establish new settlements for a variety of reasons, including a desire for: (1) fertile farmland at reasonable prices, (2) nonfarm work in specialized occupations, (3) rural isolation that supports their traditional, family-based lifestyle, (4) social and physical environments (climate, governments, services, economy) conducive to their way of life, (5) proximity to family or other similar Amish church groups, and (6) a way to resolve church or leadership conflicts.

Note: Population estimates for 2022 were calculated using a variety of sources including Raber’s New American Almanac, reports by correspondents in Die Botschaft, The Budget, and The Diary, settlement directories, regional newsletters, and settlement informants. The data includes all Amish groups that use horse-and-buggy transportation, but excludes car-driving groups such as the Beachy Amish and Amish Mennonites.

To cite this page: “Amish Population Profile, 2022.” Young Center for Anabaptist and Pietist Studies, Elizabethtown College. https://ift.tt/9rSAsDm.



from Hacker News https://ift.tt/HdACe64

Analogue releases video game from 1962 on the Pocket

The world’s first video game is coming to an Analogue Pocket near you. Today, Analogue announced that it’s launching Spacewar!, a game originally designed for the PDP-1 minicomputer that predates Pong by a full decade, on the Pocket as a part of its larger strategy to bring pioneering video games into the modern era.

The original Spacewar! was created in 1962 by a cadre of engineers led by Steve Russell at the Massachusetts Institute of Technology. Using a PDP-1 minicomputer and a 1024 x 1024 pixel CRT display, Russell and his colleagues programmed a game in which two spacecraft duke it out in the gravitational well of a star. Two controllers were created for the game featuring switches for maneuvering and buttons that were designed to be quiet when pressed so your opponent couldn’t hear when you were firing missiles.

To bring Spacewar! to the Analogue Pocket, Spacemen3, a third-party developer, used the source code from the PDP-1 computer and Spacewar! itself, both of which are in the public domain, alongside OpenFPGA software. Emulating 60-year-old software came with some interesting challenges.

“The PDP-1 had some unique characteristics about it, having a 1024x1024 vector display with a unique way of generating the image,” said Analogue CEO Chris Taber in an email to The Verge. “It was a bit tricky to accommodate this.”

Alex Cranz of The Verge had the opportunity to play Spacewar!

Spacewar! looks a little different on the Analogue Pocket. Lines are crisp and clean with none of the ethereal glow the original green CRT provided. The AI for your opponent is nonexistent, but there’s still something really fun about accelerating toward a star and then using its gravity to whip around it and take out another ship. Decades later, you still really feel like you’re fighting some war in space.

Spacewar! is emblematic of Analogue’s larger mission to preserve and play not only video games of the recent past as with their retro console offerings but also of the distant past, too. Games that were never released commercially like Spacewar! represent some of the lost video game history Analogue is trying to resurrect.

“The purpose of openFPGA is to open up Analogue’s hardware to developers to help preserve video game history ... We’ve kicked off the program highlighting the beginning of video games with a recreation of the PDP-1’s Spacewar!” Taber said.

Spacewar! is launching on the Pocket along with a new software update that adds save states and more.



from Hacker News https://ift.tt/zA9rems

Seeking mathematical truth in counterfeit coin puzzles

Insights puzzle

Seeking Mathematical Truth in Counterfeit Coin Puzzles

By Pradeep Mutalik

July 29, 2022

Readers balanced logical reasoning and mathematical insights to find phony coins with a double-pan balance scale.

James Round for Quanta Magazine

Our recent suite of puzzles featured the humble double-pan balance scale, historically a symbol of commerce and government, art and science. Balance scales are also popular in recreational mathematics. Balance puzzles require clear, logical reasoning and lend themselves well to mathematical generalization. Let’s see how Quanta readers balanced these qualities in the puzzles below.

Puzzle 1

You have eight identical-looking coins. One is counterfeit and lighter than the others, which have identical weights. Find the bad coin in two weighings. Find the general formula for the maximum number of coins for which you can find the counterfeit one in x weighings.

Tackling a simple version of a problem often reveals the key to the solution. In this case, imagine that you have just three coins, with one lighter than the other two. If you weigh any one of them against one of the other two, either they will balance or they won’t. If they don’t, you know which is lighter. If they do balance, then the third one is the light one. You only need a single weighing.

So in this puzzle, if you can isolate a group of three (or fewer) containing the light coin in the first weighing, you will just need one more weighing. You can do this by balancing any three against any other three. If the two groups are unbalanced, you’ve found the group containing the light one and can proceed as above for the second weighing. If they balance, just weigh the remaining two coins against each other, and you’ll find the light one.

Notice that this also works if there are three in the unweighed group, so we could have started with nine coins. Following this logic, and starting with three coins, for each additional weighing we can find the light coin in three times the number of coins we previously had. The formula giving us the maximum number of coins n in w weighings is therefore n = 3w.

Puzzle 2

You have 12 identical-looking coins. One is either heavier or lighter than the others, which have identical weights.

  1. Find the bad coin in three weighings.

  2. What is the maximum number of coins for which you can find the bad one in four weighings? Describe how you would find the fake coin.

The solution to this puzzle was well described by Ted, who also showed that you can actually detect the bad coin among 13 coins in three weighings. Here’s Ted’s solution (with indentations to separate the three weighings in each case):

Start by weighing 4 coins vs 4 coins.

Case 1: If unbalanced, for the second weighing put 2 each of the heavier side on both sides of the scale along with 1 each of the lighter side.

1a: If unbalanced, the bad coin is either the 2 coins still on the heavy side or the single coin still on the light side.

Weigh the 2 possible heavy coins, the bad one is either the heavier of the two, or the single light one if they are balanced.

1b: If second weighing is balanced, the bad coin is one of the 2 unused from the lighter side of the first weighing.

Weigh them against each other, the lighter one is bad.

Case 2: If balanced, the bad coin is one of the 5 remaining. Weigh 3 of those against any 3 already weighed (which are known [to be] good).

Case 2a: If unbalanced, you know the bad coin is one of those 3 and whether it’s light or heavy.

The third weighing is any 2 of those against each other — if unbalanced, that identifies the bad coin, if balanced it’s the last of the three.

Case 2b: If the second weighing is balanced, the bad coin is one of the remaining 2.

Weigh either of them against a known good coin. If this result is unbalanced, this new coin is bad and you know whether it is heavy or light. If this result is balanced, the 13th coin is bad, but it is unknown whether it’s heavy or light (which we don’t need to know, so we’re done).

Ted also went on to show that the maximum number of coins for four weighings is 40. The formula for this puzzle is: n = (3w − 1)/2.

For the remaining puzzles, the generalized formulas are still under investigation by professional mathematicians and are the subject of published papers, some of which have been cited by Rainer aus dem Spring. I will confine myself to solutions for the small numbers of coins we consider in the puzzles and will only mention generalizations that follow naturally from the methods used in these cases.

Puzzle 3

This is a variation of puzzle 1. You again have eight identical-looking coins, one of which is lighter than the others. However, now you have three scales. Two of the scales work, but the third is broken and gives random results (it is sometimes right and sometimes wrong). You do not know which scale is broken. How many weighings will it take to find the light coin?

As we saw in problem 1, this takes just two weighings with a good balance. We also know that the two good balances will always agree, so if we just repeat each weighing on all three balances, we will have the answer in six weighings as a reader suggested. If we try to do it in a smaller number of weighings, it gets a little tricky. We cannot identify a good scale just by weighing the same coins on two scales, because even if they agree, either of the two might still be a bad scale. (This also shows how easily misinformation or random information can obfuscate the truth.)

In fact, this problem can be solved, very cleverly, in just four weighings! Rainer aus dem Spring posted the solution using a newfangled notation that seems to have been created for this puzzle. But before you go there, I want you to imagine a scenario that I hope will make things more intuitive.

Imagine you’re a detective investigating a hit-and-run in a tiny country whose cars have two-digit license plates using only the digits 0, 1 and 2. Three people, A, B and C, have observed the incident. Two of them always answer a three-choice question correctly, and one gives completely random answers. You do not know who the random answerer is. You have to ask each of them a single three-choice question and then pick the one who is definitely telling the truth to get more information.

Here’s how you do it. Ask A if the first digit is 0, 1 or 2. Let’s say A says 2. Ask B if the second digit is 0, 1 or 2. Let’s say B says 1. Then ask C to make a choice between these three statements:

  • Only A is telling the truth.
  • Only B is telling the truth.
  • Both are telling the truth.

You can believe the one that C tells you to and question that person about the other digit. To see why, consider that if A is lying, then C is reliable and will say that B is telling the truth. The second digit will in fact be 1 and you can then question B about the first digit. Similarly, if B is lying, then C is again reliable and will say that A is telling the truth. Then the first digit is in fact 2 and you can question A about the second digit. Finally, if C is lying, then both A and B are reliable, so you can still believe and pick whomever C says to. (And if C says both A and B are telling the truth, then they both must be.) The key here is that your choice of questions does not allow C to lie in such a way as to cast doubt on both A and B. Since at least one of A and B must be reliable, you can always pick the one that C agrees with, even if it is just a random answer. If all three of them agree, then you already have both digits of the license plate.

Here’s how to translate this tale back to our puzzle. The scales are A, B and C. You can translate the two digits of the license plate to the coins as follows: 01 is coin 1, 02 is coin 2, 10 is coin 3, 11 is coin 4, 12 is coin 5, 20 is coin 6, 21 is coin 7 and 22 is coin 8. Astute readers will recognize that this is the base 3 (or ternary) number system. Also note that there is an additional possible number 00, which you can use for a ninth coin for which this technique will also work, as in puzzle 1.

For the first weighing, you divide the coins by their first (base 3) digit, so your three groups will be coins [1, 2], [3, 4, 5] and [6, 7, 8]. Weigh [3, 4, 5] against [6, 7, 8] on scale A. If A is working well, you will have the correct first digit group as in puzzle 1. Similarly, for the second weighing on scale B your groups will be those with the same second digit: [1, 4, 7], [2, 5, 8] and [3, 6]. If B is working well, you’ll have the correct second digit. For the third weighing, on scale C, you weigh the group that A identified against the group that B did. Following our example, for 21, the groups will be [6, 7, 8] and [1, 4, 7]. Coin 7 cannot be put on both sides at the same time, so we leave it out and weigh [6, 8] and [1, 4] against each other. Note that if A and B are both reliable, then 7 is in fact the correct answer, and it doesn’t matter which side comes out lighter on C. If by chance the weighing on C is balanced, then all three scales agree, and you have your answer (coin 7) in just three weighings. If A is reliable and B is not, the lighter coin is in [6, 8], which scale C will confirm, and if B is reliable and A is not, the lighter coin is in [1, 4], which scale C will also confirm.

So in three weighings we have either identified the light coin or narrowed it down to a group of two, and we have also identified a working scale. The fourth weighing on either scale A or scale B (whichever one scale C agreed with) will do the rest.

This solution strikes me as amazingly beautiful!

This method can be generalized to find the light coin among 32x coins in 3x + 1 weighings with the given set of balance scales. Thus, you need seven weighings for 81 coins. For larger numbers of coins (>~1,000), an even stronger solution exists.

Puzzle 4

You have 16 coins, eight of which are heavy and of the same weight. The other eight are light and of the same weight. You do not know which coins are heavy or light. The coins look identical except for one that has special markings. With one good scale, can you figure out if the special coin is light or heavy in three weighings? What’s the maximum number of coins you can start with and successfully solve this problem in four weighings?

At first sight, this puzzle seems almost impossible to do in three weighings, as one of our readers concluded. Nevertheless, with some cleverness it can be done, and both Ted and Rainer aus dem Spring provided correct solutions. Ted provided some invaluable general principles which are worth paying attention to.

First, until you get an unbalanced result from a weighing, you won’t have enough information to determine if the special coin is heavy or light. So you have to try and force an unbalanced result.

Second, if you get a balanced result (say the special coin A balances coin B), you can combine the coins that are balanced and weigh them against two more coins, C and D. If they are unbalanced, you have the answer; otherwise, you have now doubled the number of coins that are similar, which might help you get an unbalanced answer in the next weighing. You can also carry out this process in reverse with numbers of coins that are powers of two (4, 8, etc.) if you have an initial unbalanced result as seen in the following solution.

Below is the entire procedure that can identify the type of the special coin A in all cases in three weighings. (B, C and D are three coins placed on the same side as A in weighing 1 (W1); X and Y are the two coins not used in W1.)

This puzzle was invented by the Russian mathematician Konstantin Knop, a world authority on coin-weighing puzzles. Many of his papers are in Russian, but you can find several coin puzzles (among other interesting puzzles) on the blog of his collaborator Tanya Khovanova.

As for generalization, I’ll leave it to you to see if this same method works for finding the type of a special coin among 32 coins, of which 16 are heavy and 16 are light.

Puzzle 5

You have n identical-looking coins, some of which are counterfeit and lighter than the others. All you know is that there is at least one counterfeit coin and that there are more normal coins than counterfeit ones. Your job is to detect all the counterfeit coins.

The fact that there is at least one light coin and that there are more normal coins than light ones makes this puzzle less complex than it first appears, at least for small numbers. Let’s look at the numbers of weighings for one to eight coins.

For one and two coins, there can be no light coins per the second condition, so no weighings are required.

Three coins: Only one light coin. One weighing required per puzzle 1.

Four coins: Only one light coin. One additional weighing required, so w = 2.

Five coins: One to two light coins. This is the first interesting case. The question is: Should we weigh one coin against one, or two coins against two?

If we weigh one against one, then we can have:

  1. Two unbalanced weighings: Two coins discovered; we are done.
  2. One balanced weighing out of two: The balanced coins have to be normal, so the last coin needs another weighing, w = 3.
  3. Two balanced weighings: In the third weighing, weigh one coin from each prior weighing against another. If they are balanced, all four are normal, and coin 5 is the light one. We are done; w = 3 again. If they are unbalanced, we’ve found the two light coins, and we are done in three weighings.

If instead we weigh two against two, we still require three weighings, because we have to distinguish between the possibilities that the coins may be dissimilar or similar on either side. Weighings using small numbers of coins grouped together do not appear to have any advantage over weighings with single coins.

This is borne out for:

Six coins: One to two light coins; w = 4.

Seven coins: One to three light coins; w = 5.

Eight coins: One to three light coins; w = 6. This solution has a simple structure:

  • First do four weighings of one coin against the next. All coins are used.
  • Worst case: All four weighings are balanced (there are two light coins that balance each other).
  • Next two weighings: Weigh a coin from weighing 1 against a coin from weighing 2; similarly, weigh a coin from weighing 3 against a coin from weighing 4.
  • One of these weighings will be unbalanced, identifying the two light coins. We are done in six weighings.

Sorry, our sequence of 0, 0, 1, 2, 3, 4, 5, 6 is certainly not interesting enough to submit to the On-Line Encyclopedia of Integer Sequences!

As Jonas Tøgersen Kjellstadli pointed out, the solution seems to be w = n − 2 for small numbers, but we haven’t proved that this will not change for larger numbers. At some n, using multiple coin weighings might start doing better, or more weighings than n − 2 may be required. We can simply generalize the solution for eight coins to all powers of 2, giving n − 2 as the upper bound for the number of weighings for all powers of 2.

Mark Pearson discussed the similarity of this problem to error-correcting codes and suggested using an information theory approach based on the number of possible outcomes. Using such an approach, Mike Roberts posted a lower bound for the more general case, which Rainer aus dem Spring derived an approximation for. Rainer also posted an upper bound from a published paper but noted that the bounds are not sharp for low n and therefore not helpful for the small numbers we have considered above. Thus, for seven coins, the bounds cited give a range of 4 to 16, which our answer, 5, falls between. J. Payette gives additional mathematical references and bounds for all the puzzles.

Thank you to all who participated. The Insights prize for this month goes jointly to Ted and Rainer aus dem Spring. Congratulations!

See you next time for new Insights.



from Hacker News https://ift.tt/y82CPnU