코로나 이후(The After Time) – 마이클 셔머 (2/2)

코로나 이후(The After Time) – 마이클 셔머 (2/2)

https://meson.in/31Z3ZnK

(Michael Shermer, American Scholar)

원문 보기

결혼, 연애, 성, 그리고 재택 근무

재택 근무는 중세의 장인들이 자신의 집에서 신발과 편자를 만들 때부터 있었지만, 그리 널리 퍼지지는 않았다. 하지만 하루 몇 시간을 영혼이 빠져나가는 교통 체증을 버티며 가만히 앉아 길에서 보내기를 원하는 사람은 아무도 없으며, 길이 아니라 집에서 더 많은 시간을 보내는 것은 신체의 건강에도, 인간관계와 가족관계에도 좋을 것이다.

더 많은 남편이 집에서 일함으로써 아이들과 더 많은 시간을 보내게 될 것이며, 부부는 다양한 양육 방식을 선택할 수 있으므로 양성평등에도 도움이 될 것이다.

연애의 형태는 이미 크게 변하고 있으며, 온라인 앱을 이용하면서 더 조심스럽게 적절한 상대방을 찾는 추세는 아마 계속될 것이다.

밀레니얼들은 X세대나 베이비부머 세대보다 성관계를 덜 가진다. 따라서 Z 세대, 혹은 96년 이후 태어난 이들을 말하는 i세대 역시 더 큰 성적 재량권을 추구하면서도 또한 이런 흐름이 계속 될 것이라 예측하는 것은 어렵지 않다. 실제로 그들은 안전한 성과 피임을 더 중요하게 생각한다는 조사 결과가 있다.

독서, 일기, 명상, 요가, 산책, 등산, 자전거, 수영 등은 혼자 하는 활동인 동시에 신체적으로, 정신적으로 유익한 것으로 이 시기의 일시적인 증가가 향후 습관으로 정착될 수 있다.

집에서 더 많은 시간을 보낸다는 것은 집을 수리하고 리모델링 하는데 시간을 더 쓰게 된다는 것이며, 따라서 DIY 운동은 계속 될 것이고 홈디포나 Lowe’s 와 같은 대형 자재 마트의 매출 또한 올라갈 것이다.

집에서 보내는 시간이 늘어난다는 것은 또한 음식의 배달과 픽업이 늘어날 것이며 힘든 시기를 겪고 있는 식당들의 매출이 이를 통해 최소한은 유지될 수 있다는 것을 의미한다. 또 이 영역은 사람들이 음식을 준비하는데 보내야할 시간을 줄여줄 것이다.

오락, 여행, 휴가

술집과 음식점, 클럽, 경기장, 극장 등의 밀집도 높은 놀이시설은 사람들을 괴롭게 하지 않으면서도 충분한 수준의 방역이 가능한 방식을 찾아야할 것이다. 이 기간 동안에도 문화심리학자 미쉘 겔판드가 보인 것처럼, 독일이나 일본과 같은 “빡빡한 문화”는 시민들이 규칙을 덜 따르는 이탈리아나 미국과 같은 “느슨한 문화”보다 덜 힘들 것이다.

에어비앤비를 이용한 가정집 대여는 늘어날 것이고 집에서 휴가를 보내는 스테이케이션 역시 증가할 것이다. 사람들은 자신이 사는 지역의 주변에 더 관심을 가질 것이며 이는 다수가 이용할 수 있는 지역 사회의 공원과 유원지 등을 발전시킬 것이다. 코로나 시기에 RV 차량의 대여는 650% 증가했으며, 관련 산업이 모두 수익을 올리고 있다.

극장은 70년대 각 가정에 TV가 구비되면서 인기를 잃은 자동차 극장을 다시 고려할 수 있다. 사실 오늘날 훨씬 더 저렴한 스트리밍 서비스들과 고화질의 TV를 거실에 가진 이들이 다른 이가 기침과 재채기를 할지 모르는 극장에 굳이 갈 필요가 있을까? 전자레인지로 데우는 팝콘도 극장 만큼이나 다양하고 맛있으며, 훨씬 더 싸기까지 하다. 실제로, 최근 집 밖으로는 나가고 싶지만 차 안에서 안전하게 있고자 하는 이들을 위해 자동차 극장이 하나 둘 생기고 있다.

교육

교육기관들은 그들을 지지하는 학생 및 학부모와 함께 지식을 다수에게 전달할 수 있는 온라인 기술을 활용하기 위해 노력하게 될 것이다. 지난 3월의 셧다운 이후, 나는 채프맨 대학의 과학적 사고 강의를 녹화했으며 누구나 이를 볼 수 있게 인터넷에 올렸다. 스티븐 핑커의 합리성에 대한 강의를 공짜로 들을 수 있는데 수만 달러의 학비를 하버드에 내야할 이유가 있을까? 지난 10년간 수천 개의 무료 온라인 대학 강의가 개설되었고 (예를 들어 MOOCs) 더 그레이트 코스와 같은 유료 교육 서비스가 생겼으며, 골라 들을 수 있는 수많은 팟캐스트가 만들어졌다. 지금은 그 어느 때보다도 저렴하게, 그리고 쉽게 혼자서 공부할 수 있는 시대이다.

물론 모든 교육이 온라인에서 이루어질 수는 없다. 실험 교육은 현장에서 이루어져야 하며, 비언어적 신호가 함께 하는 교실에서의 수업을 화상 수업이 대체할 수도 없다. 즉, 온라인과 오프라인의 하이브리드 교실이 개발될 것이다.

과도한 학비를 요구하는 고등 교육기관들은 불만에 찬 학생과 부모들이 보다 경제적인 대안을 찾아가면서 타격을 입게될 것이다. 지난 50년 동안 대학 학비만큼 많이 오른 것은 없다. 그 이유 중에는 수요의 급격한 증가가 있지만, 인구구조상 이 이유는 사라지고 있다. 정부가 공공 대학에 대한 지원을 줄인 것이 하나의 이유이며, 행정 및 서비스 직원의 급격한 증가 또한 그 이유이다. 코로나 전 부터 대학은 이를 해결해야 한다는 압력을 받았으며, 앞으로는 복부의 지방을 줄이라는 압력이 더 커질 것이다.

정치와 사회

미국의 상하원이 원격으로 의회 업무를 수행한다면, 이는 그들이 지역 사회에 더 관심을 가지게할 뿐 아니라 지금의 시스템에서 낭비되는 여행과 주거 비용을 절약하게 해줄 것이다. 정부가 이러한 변화를 시행하지 못하는 이유는 아직 이들이 18세기에 만들어진 시스템을 고집하기 때문이다. 정치인을 워싱턴에서 쉽게 만나기 힘들어진다면 로비로 인한 부작용 또한 줄어들 수 있다.

전자 투표를 도입해야 한다. 매년 온라인으로 오가는 돈이 수조달러에 이르며, 비록 온라인 금융 사기가 존재하긴 하지만 그렇다고 은행이 다시 종이돈으로 돌아가게 만들지는 않는다. 투표용지? 아무런 문제가 없다. 빚을 지고, 집을 사고, 돈을 보내고, 주식을 사고 파는 것을 인터넷으로 할 수 있는데 안전한 투표가 보안 전문가에게 어려울리 없다. 러시아와 중국의 해커들이 미국의 경제를 공격하지 못하는 상황에서, 선거 시스템이 금융 시스템만큼만 튼튼하게 만들어 진다면 전자 투표를 하지 못할 이유가 없다.

정치적 양극화는 코로나 첫 몇 달 동안 줄어드는 듯 보였지만, 11월 대통령 선거가 가까워지면서 양극화가 가장 심했던 2019년 말로 돌아갔다. 영국이 나치에 대항해 하나로 힘을 모은 것처럼, 사람들은 공동의 적을 만나면 서로 힙을 합친다. 코비드-19가 우리를 하나로 만들지, 아니면 더 분열하게 만들지는 두고 보아야 하지만, 지금까지의 결과로 보면 비관적이다. 시간이, 그리고 선거가 이를 알려줄 것이다.

개인의 자유와 집단 사이의 바람직한 균형을 찾게될 것이다. 많은 미국인들이 고속도로에서 경찰이 사이렌을 울렸을때 차를 갓길에 대는 것이나 정장을 요구하는 식당을 갈 때 이를 따르는 것에 비해 마스크를 착용하게 하는 것이 자신의 자유를 더 침해하는 것이라 느낀다. 주먹을 휘두를 자유는 다른 사람의 코 앞 까지이다. 누구나 담배를 피울 자유는 있지만, 다른 사람의 얼굴에 대고는 아니다. 자신이 코비드-19에 걸릴 위험에 노출될 자유는 있지만, 다른 사람을 그런 위험에 노출시킬 자유는 없다. 토마스 홉스, 존 로크, 그리고 다른 사회 계약설의 선구자들은 수백년 전 이미 시민 사회란 자유와 안전의 균형 사이에 존재한다는 것을 설명했다.

코로나 시기에 총기 판매가 급증했다. 미국인들은 지난 3월에만 190만 개의 화기를 구입했으며, 이는 역대 두 번째로 높은 수치이다. 이는 전염병이 사회 불안을 야기할지 모른다는 두려움 때문이다. 하지만 공포가 사라지면서 불안감 또한 줄어들고 있다. 그러나 총기 사고는 미국 사회의 문제이며, 가까운 시일에 사라지지도 않을 것이다. 어쩌면 총기 관련 살인 사건은 더 늘어날 수도 있다.

개인 위생과 공중 보건

이제 악수는 끝났다. 주먹 인사, 팔꿈치 인사, 아니면 아예 접촉을 하지 않는 일본식 인사나 요기의 “나마스떼”가 이를 대신할 것이다. 이는 공짜로 쉽게 바꿀 수 있지만 감기, 독감 등 모든 전염병을 줄일 수 있는 방법이다. 그리고 지난 몇 백년 동안 계속 낮아진 체온을 더 낮게 만들 것이다. 잠깐, 뭐라고?

2020년 1월, 스탠포드 의대는 독일의 내과의사 칼 라인홀트 어거스트 분데를리히가 정했던 화씨 98.6 도의 체온 기준 대신 새로운 97.9도를 제시했다. 그들은 이러한 변화가 측정의 오류 때문이 아니라, 실제로 사람들의 생활 습관이 지난 157년 동안 바뀌었기 때문이라 말한다. 우리가 덜 아프기 때문에, 우리 몸이 더 차가워지고 있다는 것이다.

경제 발전과 생활 수준 및 위생의 향상은 만성 감염과 전쟁에서 당할 수 있는 부상을 줄이며, 치아의 상태를 낫게 만들고, 결핵과 말라리아를 없앴으며, 19세기 이래 항생제의 사용과 함께 만성 감염을 줄였다.

역설적으로, 코비드-19는 우리를 더 건강하게, 곧 역사상 가장 낮은 체온을 가지도록 만들 수도 있다.

코비드-19가 계속 사람들을 불안에 떨게 하며, 병상과 시체보관소를 채우는 상황에서 위와 같은 전망은 너무 긍정적인 것일지 모른다. 그러나 역사를 지침으로 삼고, 합리적 초예측을 기법으로 삼은 이 전망들은 실제 미래와 완전히 다르지는 않을 것이다. 나는 신중한 낙관주의를 택하며, 오늘의 불행을 통해 배운 것으로 우리가 더 밝은 미래를 만들 것이라 믿는다.

1부로

General.opinion

via NewsPeppermint https://meson.in/2F5yYpi

September 4, 2020 at 07:56AM

Why DNS Is Critical for Modern Application Deployments

Why DNS Is Critical for Modern Application Deployments

https://meson.in/2FaS0KE


In a previous blog, I explained how application outages can impact customer confidence and bring your business to a standstill. In today’s marketplace, failing to adapt and deliver new services to the market quickly can be just as harmful.

With the rise of DevOps and improvements to the tooling that supports continuous integration and continuous delivery (CI/CD), companies can improve their ability to deploy and ship code with excellent results. But in rolling out new updates, they still want to mitigate their risk of a bad deployment, minimizing the chance of downtime for their customers.

This blog post explores different deployment strategies DevOps and NetOps teams can use to seamlessly and safely deploy updates to production, and explains how DNS can work with specific deployment models.

Blue-Green Deployments

Blue-green deployments are a strategy in which you maintain two identical environments, referred to as blue and green. As depicted in the following graphic, NGINX Plus is forwarding user requests to the blue environment where the production version of your app is running. The new version of the app is running in the green environment, and you can test it there. Once all the tests check out, you update the NGINX Plus configuration to point traffic to the green environment.

The main benefit of this deployment strategy is that switching traffic between environments is simple with the right tooling in place – with NGINX Plus, for example, you can use the NGINX Plus API to change the set of backend servers, without the need for a restart. Risk is mitigated because if something goes wrong in the green environment, rolling back to the blue environment requires only a single call to the NGINX Plus API.

Rolling Blue-Green Deployments

A rolling blue‑green deployment is the same idea, but here we slowly divert traffic from the blue environment to the green environment until the latter is receiving 100%. A weighted load‑balancing algorithm allows you to specify the appropriate balance between the environments.

The main benefit is that you can slowly ramp up traffic to the green environment as you gain confidence in the stability of the release. Any unexpected issues only impact a small number of users.

Canary Deployments

Canary releases are used to deliver a new deployment to a percentage of your application users or environments, similar to a rolling blue‑green deployment. The critical difference is that software monitors your app’s key performance metrics to ensure that the new deployment is operating as well as the current version in production.

As the canary software observes no significant changes to your performance metrics, it slowly directs more traffic to the new environment until it reaches 100%.

To implement canary releases well, you need tooling capable of performing the precise traffic shifting required. Rollout time can take longer, depending on the level of traffic your application sees.

Using DNS as a Part of Your Deployment Strategy

How can DNS play a role in implementing these deployment strategies?

DNS is the first touchpoint between your application and its users. Why not use it to direct clients to a new version of your application?

F5 DNS Load Balancer Cloud Service is a modern managed‑DNS solution that is easily integrated into your CI/CD pipelines. It also enables you to take into account a user’s location as a criterion for traffic steering while implementing these deployment strategies via DNS. Ratio‑based load‑balancing algorithms used with F5 DNS Load Balancer can help teams implement a blue‑green deployment across data centers, availability zones, or cloud providers.

A capable API‑driven DNS solution can also help you implement a rolling blue‑green strategy to facilitate migrating to a new cluster, like our partner Red Hat accomplished in helping OpenShift customers migrate to OCP v4. By leveraging F5 DNS Load Balancer’s declarative API, OpenShift operators can safely test a new cluster and reduce risk with a small portion of its users. An Ansible playbook is used to adjust the ratio of traffic being directed to the new cluster.

Summary

We’ve discussed several strategies for successfully rolling out updates to your live applications and how F5 DNS Load Balancer, as a modern global traffic management solution, can assist in those rollouts.

Please take advantage of our DNS Load Balancer free‑tier offering to see how NGINX software and F5 Cloud Service solutions can boost your applications’s performance and manageability.

You can also request access to our upcoming NGINX Plus Integration Early Access Preview for DNS Load Balancer. This integration enables you to configure your NGINX Plus instances to share their configurations and performance information with DNS Load Balancer to optimize global application traffic management.

Product.platform

via NGINX https://meson.in/2It0R7u

September 2, 2020 at 09:13AM

Using symptoms search trends to inform COVID-19 research

Using symptoms search trends to inform COVID-19 research

https://meson.in/2QUo1cD

Search is often where people come to get answers on health and wellbeing, whether it’s to find a doctor or treatment center, or understand a symptom better just before a doctor’s visit. In the past, researchers have used Google Search data to gauge the health impact of heatwaves, improve prediction models for influenza-like illnesses, and monitor Lyme disease incidence. Today we’re making available a dataset of search trends for researchers to study the link between symptom-related searches and the spread of COVID-19. We hope this data could lead to a better understanding of the pandemic’s impact.

fever-2x.gif

Using the dataset, researchers can develop models and create visualizations based on the popularity of symptom-related searches. This sample visualization is based on search volume for fever across the U.S. This visualization does not reflect the dataset’s user interface but shows what can be generated. 

How search trends can support COVID-19 research 

The COVID-19 Search Trends symptoms dataset includes aggregated, anonymized search trends for more than 400 symptoms, signs and health conditions, such as cough, fever and difficulty breathing. The dataset includes trends at the U.S. county-level from the past three years in order to make the insights more helpful to public health, and so researchers can account for changes in searches due to seasonality.

Public health currently uses a range of datasets to track and forecast the spread of COVID-19. Researchers could use this dataset to study if search trends can provide an earlier and more accurate indication of the reemergence of the virus in different parts of the country. And since measures such as shelter-in-place have reduced the accessibility of care and affected people’s wellbeing more generally, this dataset—which covers a broad range of symptoms and conditions, from diabetes to stress—could also be useful in studying the secondary health effects of the pandemic.

The dataset is available in Google Cloud’s COVID-19 Free Public Dataset Program and is downloadable in CSV format from Google Research at Open COVID-19 Data GitHub repository

Advancing health research with privacy protections

The COVID-19 Search Trends symptoms dataset is powered by the same anonymization technology that we use in the Community Mobility Reports and other Google products every day. No personal information or individual search queries are included. The dataset was produced using differential privacy, a state-of-the-art technique that adds random noise to the data to provide privacy guarantees while preserving the overall quality of the data.

Similar to Google Trends, the data is normalized based on a symptom’s relative popularity, allowing researchers to study spikes in search interest over different time periods, without exposing any individual query or even the number of queries in any given area. 

More information about the privacy methods used to generate the dataset can be found in this report.

What’s next

This early release is limited to the United States and covers searches made in English and Spanish. It covers all states and many counties, where the available data meets quality and privacy thresholds. It was developed to specifically aid research on COVID-19, so we intend to make the dataset available for the duration of the pandemic. 

As we receive feedback from public health researchers, civil society groups and the community at large, we’ll evaluate and expand this dataset by including additional countries and regions. 

Researchers and public health experts are doing incredible work to respond to the pandemic. We hope this dataset will be useful in their work towards stopping the spread of COVID-19.

Product.google

via The Official Google Blog https://meson.in/2QUFf9V

September 3, 2020 at 12:12AM

How to Avoid Common Mistakes With Mining Stocks (Part 3: Jurisdiction)

How to Avoid Common Mistakes With Mining Stocks (Part 3: Jurisdiction)

https://meson.in/31IlFni

“Location, location, location…”

This famous real estate adage also matters in mining. After all, it’s an industry that is all about the geology—but beyond the physical aspects and the location of a mineral deposit, there are also social and environmental factors that create a mining jurisdiction.

Common Mistakes With Jurisdiction

We’ve partnered with Eclipse Gold Mining on an infographic series to show you how to avoid common mistakes when evaluating and investing in mining exploration stocks.

Part 3 of the series focuses on six signals investors can use to gauge a company’s preparedness for the jurisdictions they operate in.

jurisdictions

View the two other parts of this series so far, covering mistakes made in choosing the team as well as those made with a company’s business plan.

#1: Geological Potential: Methodical Prospecting or Wild Goose Chase?

It all starts with a great drill result, but even these can be “one-off” anomalies.

Mineral exploration is a methodical process of drawing a subsurface picture with the tip of a drill bit. A mineral discovery is the cumulative effort of years of research and drilling.

The key to reducing this geological risk is to find a setting that has shown previous potential and committing to it. Typically, a region is known to have hosted other great discoveries or shares a geology similar to other mining districts.

Signs of Methodical Prospecting:

  • Lots of geological indicators
  • Potential for further discovery
  • Sound science

#2: Legal Environment: Well-Paved Path or Minotaur’s Maze?

Now that you have identified a region with the prospective geology you think could host a discovery, a company will have to secure the permits to explore and operate any further.

However, a management team that cannot navigate a country’s bureaucracy will face delays and obstacles, costing investors both time and money.

Without clear laws and competent management, a mining company’s best laid plans become lost in a maze with legal monsters around every legal corner.

Signs of a Well-Paved Highway:

  • Existing laws encourage mining investment
  • Relatively low bureaucracy
  • Well-established permitting process
  • Legacy of mining contributing to economy

#3: Politics: Professional Politics or Banana Republics?

A good legal framework is often the outcome of politics and stable governance—however so is a difficult legal framework.

The political stability of a nation can turn on one election and so can the prospects for developing a mine. An anti-mining leader can halt a mining project, or a pro-mining leader can usher forward one.

A positive national viewpoint on mining may be enough to lure investment dollars, but local politics may determine the success of a mining company.

Signs of Professional Politics:

  • Positive history with mining companies
  • Politically stable jurisdiction
  • Rule of law respected
  • Changes in government have little effect on the mining industry

#4: Infrastructure & Labor: Modern or Medieval

Sometimes it is the discovery of valuable minerals that spurs national development, but this can also happen the other way around, in which development can encourage mineral discovery.

A mining company looking to build a new mine in a country with a tradition of mining will have an easier time. Access or lack thereof to modern machinery and trained employees will determine how much money will be needed.

That said, if a company is looking to develop a mining project in a new mining region, they must be ready to help create the skills and infrastructure it needs to mine.

Signs of a Modern Jurisdiction:

  • Developed roads to access and support operations
  • Trained labor for staffing and development
  • Well-established grid lines and back-up power systems

#5: Community: Fostering Friendship or Sowing Enemies

Mining operations have a significant impact on the local community. Good companies look to make mutually beneficial partnerships of equals with local communities.

Ignoring or failing to respect the local community will jeopardize a mining project at every stage of its mine life. A local community that does not want mining to occur will oppose even the best laid plans.

Signs of a Friendly Relations:

  • Operations bring community together
  • Local history shows support for mining
  • Understanding of local concerns and regional variety
  • Company contributes to economic growth and health of the community

#6: Environment: Clean Campsite or One Night Party

There is no way around it: mining impacts the environment and local ecosystems. But, mining operations are a blip on the radar when it comes to Earth’s timeline.

Mine sites can again become productive ecosystems, if a company has the capacity and plan to mitigate mining’s impacts at every stage of the life of a mine—even beyond the life of a mine.

Signs of a Clean Campsite:

  • Development plan mitigates environmental damage
  • Well-planned closure and remediation
  • Understand how communities use their environment

Bringing it together: ESG Investing

These six points outlined above point towards a more complete picture of the impacts of a mining project. Currently, this falls under what is labeled as Environmental, Social and Governance “ESG” standards.

Mining companies are the forefront of a big push to adopt these types of considerations into their business, because they directly affect natural and human environments.

ESG is no longer green wash, especially for the mining industry. Companies that understand and apply these concepts in their business will have better outcomes in the jurisdictions they operate within, hopefully offering investors a more successful venture.

Geology does not change on the human time scale, but bad management can quickly lose a good project and investor’s money if they do not pay attention to the other attributes of a jurisdiction.

Subscribe to Visual Capitalist

Thank you!
Given email address is already subscribed, thank you!
Please provide a valid email address.
Please complete the CAPTCHA.
Oops. Something went wrong. Please try again later.

The post How to Avoid Common Mistakes With Mining Stocks (Part 3: Jurisdiction) appeared first on Visual Capitalist.

Data.visualization

via Visual Capitalist https://meson.in/3lF3GXd

August 28, 2020 at 04:38AM

The 100 Most Popular City Destinations

The 100 Most Popular City Destinations

https://meson.in/3gOSbZC

100 Most Popular City Destinations for Travel

The 100 Most Popular City Destinations

The pandemic has grounded many of us, but it can’t curb human wanderlust.

Cities like Hong Kong, Bangkok, and London have led city destination rankings for years, but movement within the ranks below them—revealed in the above infographic—help to highlight the intriguing travel trends happening before COVID-19.

With data from Euromonitor International’s 2019 travel report, we can uncover where travelers are likely headed once their passports are useful again. Pulling data from 400 cities, collected into mid-2019, the report encompasses millions of international travelers who stayed at their destination longer than 24 hours.

Here’s a closer look at where travelers are likely to touch down in post-pandemic life.

Not-So-Lonely At the Top

Although the top of this list has remained fairly stable in terms of rank in recent years, two cities have seen an impressive influx of travelers.

Paris and Istanbul both made significant gains between 2017 and 2019 with 20.6% and 37.2% growth in visitors respectively:

Note that only one North American city, New York City, is found in this top 10. As well, Asian cities account for half of the leading group, with two of the top 10 cities are located in China. Although Hong Kong leads the top 100 list, political turmoil led to a marked decline of international visitors of 4.2% from 2017 to 2019.

The largest rank changes in the top 10 were made by Macau and Istanbul, but the rise was subtle. Both cities gained two spots each between 2013 and 2018, though each had sizable traveler growth rates, with Macau growing by 19.0%.

Rank City Country Arrivals (Millions) 5yr Rank Change Growth (’17-19)
1 Hong Kong China (SAR) 29.26 -4.2%
2 Bangkok Thailand 24.17 15.1%
3 London United Kingdom 19.23 -1.4%
4 Macau China (SAR) 18.93 2 19.0%
5 Singapore Singapore 18.55 -1 12.2%
6 Paris France 17.56 -1 20.6%
7 Dubai UAE 15.92 3.4%
8 New York City US 13.60 1 7.0%
9 Kuala Lumpur Malaysia 13.43 1 9.6%
10 Istanbul Turkey 13.43 2 37.2%
11 Delhi India 12.65 30 49.6%
12 Antalya Turkey 12.44 -1 40.6%
13 Shenzhen China 12.20 -5 2.0%
14 Mumbai India 10.59 28 38.5%
15 Phuket Thailand 10.55 8.4%
16 Rome Italy 10.07 -3 8.3%
17 Tokyo Japan 9.99 15 9.3%
18 Pattaya Thailand 9.61 -1 8.9%
19 Taipei Taiwan, China 9.60 -1 7.7%
20 Mecca Saudi Arabia 9.57 1 0.3%
21 Guangzhou China 9.00 -5 0.1%
22 Prague Czechia 8.95 -3 3.9%
23 Medina Saudi Arabia 8.55 1 0.7%
24 Seoul South Korea 8.43 -10 19.1%
25 Amsterdam Netherlands 8.35 3 12.6%
26 Agra India 8.14 38 52.6%
27 Miami US 8.12 -7 6.9%
28 Osaka Japan 7.86 69 36.2%
29 Los Angeles US 7.50 -7 7.8%
30 Shanghai China 7.48 -7 7.8%
31 Ho Chi Minh City Vietnam 7.20 6 31.6%
32 Denpasar Indonesia 7.19 13 37.5%
33 Barcelona Spain 6.71 -6 11.6%
34 Las Vegas US 6.59 -9 -0.8%
35 Milan Italy 6.48 -9 3.9%
36 Chennai India 6.42 7 55.8%
37 Vienna Austria 6.41 -8 7.1%
38 Johor Bahru Malaysia 6.40 8 29.8%
39 Jaipur India 6.38 29 42.9%
40 Cancun Mexico 6.04 17 1.8%
41 Berlin Germany 5.96 -10 10.1%
42 Cairo Egypt 5.75 18 55.1%
43 Athens Greece 5.73 18 31.3%
44 Orlando US 5.55 -10 8.7%
45 Moscow Russia 5.51 -10 24.4%
46 Venice Italy 5.50 -16 5.3%
47 Madrid Spain 5.44 -8 6.3%
48 Ha Long Vietnam 5.29 14 44.0%
49 Riyadh Saudi Arabia 5.27 -9 0.9%
50 Dublin Ireland 5.21 -12 9.4%
51 Florence Italy 5.06 -15 3.9%
52 Ha Noi Vietnam 4.69 21 19.3%
53 Toronto Canada 4.51 10.5%
54 Johannesburg South Africa 4.12 -10 3.4%
55 Sydney Australia 4.09 1 12.1%
56 Munich Germany 4.06 -7 11.0%
57 Jakarta Indonesia 4.03 17 30.9%
58 Beijing China 4.00 -25 3.8%
59 St. Petersburg Russia 4.00 -11 23.9%
60 Brussels Belgium 3.94 -13 24.8%
61 Jerusalem Israel 3.93 -9 27.0%
62 Budapest Hungary 3.82 -7 10.4%
63 Lisbon Portugal 3.54 9 3.4%
64 Dammam Saudi Arabia 3.50 -14 0.3%
65 Penang Island Malaysia 3.44 -2 16.3%
66 Heraklion Greece 3.40 -1 -3.8%
67 Kyoto Japan 3.29 58 4.4%
68 Zhuhai China 3.26 -9 4.4%
69 Vancouver Canada 3.21 13 13.3%
70 Chiang Mai Thailand 3.20 6 4.2%
71 Copenhagen Denmark 3.07 8 7.8%
72 San Francisco US 2.90 -14 3.1%
73 Melbourne Australia 2.89 12 20.9%
74 Krakow Poland 2.85 -8 3.9%
75 Marrakech Morocco 2.84 2 13.1%
76 Kolkatta India 2.83 14 22.3%
77 Cebu Philippines 2.81 51 -4.2%
78 Auckland New Zealand 2.80 6 9.7%
79 Tel Aviv Israel 2.78 -8 16.0%
80 Guilin China 2.75 29 19.7%
81 Honolulu US 2.74 -11 6.0%
82 Hurgada Egypt 2.74 45 108.1%
83 Warsaw Poland 2.73 -16 7.2%
84 Mugla Turkey 2.72 -33 47.5%
85 Buenos Aires City Argentina 2.69 -31 8.6%
86 Chiba Japan 2.68 106 14.4%
87 Frankfurt Germany 2.64 -7 9.2%
88 Stockholm Sweden 2.60 10.1%
89 Lima Peru 2.54 -11 17.5%
90 Da Nang Vietnam 2.51 72 44.0%
91 Batam Indonesia 2.49 20 27.8%
92 Nice France 2.47 -17 10.7%
93 Fukuoka Japan 2.44 104 24.6%
94 Abu Dhabi UAE 2.40 12 14.7%
95 Jeju South Korea 2.35 -8 -6.2%
96 Porto Portugal 2.34 22 11.7%
97 Rhodes Greece 2.34 -11 10.6%
98 Rio de Janeiro Brazil 2.28 -7 3.6%
99 Krabi Thailand 2.26 -5 12.7%
100 Bangalore India 2.24 83 50.6%

It’s also worth noting that based on the data collected into 2019, London was projected to continue its downward trend, bringing it to 5th spot—mostly due to complications brought on by Brexit and associated visa restrictions.

Trending: Indian and Japanese Cities Take Flight

Most of the dramatic shifts in city travel patterns are happening below the top 10. Asian hot spots are gaining steam and swiftly making their way up the top 100 rankings, signaling a shift in global preferences before lockdowns began.

Take Japan for instance. The five Japanese cities in the top 100 rose by 352 places collectively since 2013. The country’s top city destinations have had an average traveler growth rate of 17.8% from 2017 to 2019. In light of Japan’s impeccable containment of COVID-19, that trend may be compounded in coming years.

Japan’s dramatic rise in the ranks is echoed by India. India’s seven cities in the top 100 have risen 229 places — with a huge average growth rate of 44.6% from 2017 to 2019. Some of that growth is the result of lifestyle tourism, particularly in the case of Delhi, which saw its traveler rate grow by 49.6% since 2017.

Prior to the pandemic, Delhi was expected to continue that steady growth and experience a leap in rank, which currently sits at 11.

With health and wellness tourism on the rise, India has gained noteworthy attention for its yoga retreats and Ayurveda practices. Delhi’s connectivity to important locations across North India has boosted inbound arrivals to the city.

— Euromonitor International

Where in the World? Asia and Europe

Asia continues to lead all other regions, followed by Europe.

Since 2013, the number of Asian cities in the top 100 has grown from 34 to 43. Asian outbound travel has also seen a surge, spurring a rise in travel campaigns from Europe and the Americas that target Asian travelers on social media platforms like WeChat.

Why the Ranking Matters: In Travel, They Trust

Before the pandemic, tourism was considered a leading and resilient economic sector.

In 2019, 1.5 billion people traveled internationally. By 2030, that number could grow to 1.8 billion—and many cities could become increasingly reliant on tourist dollars.

According to the World Travel and Tourism Council, cities like Macau, Cancun, Marrakech, and Las Vegas are all heavily dependent on direct tourism and travel contributions to their respective GDPs. As of 2018, more than 50% of Macau’s GDP was derived directly from tourism, while almost half of Cancun’s GDP relies on travelers.

Countries like India and the Philippines are also particularly reliant on travel. India has a related job-to-tourist ratio of two jobs for every tourist and the Philippines has a ratio of one job per tourist.

By 2030, there could be 1.8 billion tourists – just over one in five persons in the world–traveling around the globe.

United Nations World Tourism Organization

Where to Next? Wheels Up

Millions of travelers don’t lie — the siren call of cities is undeniable. In turn, those tourists have become a major lifeforce for many of these destinations, and a boon for the international travel industry.

The pandemic has thrown these dynamics off course, with much of the world grinding to a halt since early 2020. However, it’s only a matter of time before the world opens back up again.

Although travel may look very different in the future, wanderlust doesn’t simply disappear. In fact, frustrated travelers — including digital nomads and remote workers — may have all the more reason to run away.

Subscribe to Visual Capitalist

Thank you!
Given email address is already subscribed, thank you!
Please provide a valid email address.
Please complete the CAPTCHA.
Oops. Something went wrong. Please try again later.

The post The 100 Most Popular City Destinations appeared first on Visual Capitalist.

Data.visualization

via Visual Capitalist https://meson.in/3lF3GXd

August 29, 2020 at 08:29AM

Elon Musk demonstrated a Neuralink brain implant in a live pig

Elon Musk demonstrated a Neuralink brain implant in a live pig

https://meson.in/32EXyW7

By Leah Crane

New Scientist Default Image

Elon Musk, co-founder of Neuralink, led a demonstration of the brain implant technology on 28 August

Jae C Hong/AP/Shutterstock

Elon Musk has showed off his company Neuralink’s brain-computer interface for the first time. In an announcement on 28 August, Neuralink unveiled prototypes of its device and showed off pigs with the devices implanted in their brains.

The device resembles a coin with extremely thin wires coming from one side of it. It is designed to be implanted in the skull, with the wires embedded a few millimetres into the surface of the brain. Those wires can then detect when neurons are firing, or emit their own electrical signals to make the neurons fire. Musk showed a video of neurons responding to the electrodes.

Eventually, the hope is that these small devices will be able to both read and write neuron signals, helping with medical problems that originate in the brain and spine and maybe even allowing humans to integrate computers into their brains in the distant future, Musk said.

Advertisement

The Neuralink team trotted out three pigs to demonstrate the device: the first, named Joyce, had no implant, and the second, named Gertrude, had an implant that monitored neurons in her snout. Musk displayed a screen showing live signals from Gertrude’s Neuralink device as she rooted around in some hay, produced when she touched her snout to food or the ground.

The third pig, called Dorothy, had had an implant installed and then removed. “What Dorothy illustrates is that you can put in the Neuralink, remove it, and be healthy, happy and indistinguishable from a normal pig,” Musk said. This will be important for human users, he said, because they may want to remove or upgrade their implants.

“The challenging part that they’ve pulled off is that the animal is happy-looking and walking around and acting normal and the data is being relayed wirelessly,” says Timir Datta-Chaudhuri at the Feinstein Institutes for Medical Research in New York. “Other people that might have done something similar usually have the animal on an operating table under anaesthesia with wires coming from its brain.”

While this is impressive, Datta-Chaudhuri says, it is still not quite enough to prove the devices are safe. Musk said that implantation can be done with relatively little bleeding in the brain. “You sort of think if you stab something with a wire surely it will bleed, but actually at a really small scale it does not,” he said.

“They downplayed the potential damage to the brain, but that damage is sometimes not easily observable even in humans, let alone pigs,” Datta-Chaudhuri says. “You don’t know if the pig now has a slur or the other pigs aren’t really socialising with it because it’s acting weird.”

During the announcement, members of the Neuralink team expressed their long-term hopes for the device, ranging from restoring vision for people with eye injuries and limiting pain, to recording memories and telepathy.

Some of these goals are more realistic than others, Datta-Chaudhuri says. For example, Musk spoke about bypassing spinal injuries to restore movement for paralysed individuals, which he said will be the focus of the company’s first clinical trials in humans, beginning soon. Devices similar to Neuralink have achieved this, so it’s not outlandish to expect Neuralink to do the same.

On the other hand, a feat like reading a memory or thought would require a detailed understanding of the brain that we simply do not yet have, with advanced technology to match, Datta-Chaudhuri says.

“I feel like there’s still a lot that they have to learn, and it’s going to be an uphill battle for them,” he says. “But this snowball might get rolling and turn into something bigger, simply because of the advantage of the brand and having Elon Musk attached to it, that social spotlight.”

More on these topics:

Bio.medical

via New Scientist – Health https://meson.in/2AA4I2U

August 29, 2020 at 07:17PM

Modeling microbial metabolic trade-offs in a chemostat

Modeling microbial metabolic trade-offs in a chemostat

https://meson.in/2QDgC1n

by Zhiyuan Li, Bo Liu, Sophia Hsin-Jung Li, Christopher G. King, Zemer Gitai, Ned S. Wingreen

Microbes face intense competition in the natural world, and so need to wisely allocate their resources to multiple functions, in particular to metabolism. Understanding competition among metabolic strategies that are subject to trade-offs is therefore crucial for deeper insight into the competition, cooperation, and community assembly of microorganisms. In this work, we evaluate competing metabolic strategies within an ecological context by considering not only how the environment influences cell growth, but also how microbes shape their chemical environment. Utilizing chemostat-based resource-competition models, we exhibit a set of intuitive and general procedures for assessing metabolic strategies. Using this framework, we are able to relate and unify multiple metabolic models, and to demonstrate how the fitness landscape of strategies becomes intrinsically dynamic due to species-environment feedback. Such dynamic fitness landscapes produce rich behaviors, and prove to be crucial for ecological and evolutionarily stable coexistence in all the models we examined.

Bio.systems

via PLoS Computational Biology: New Articles https://meson.in/2QzvM7V

August 29, 2020 at 02:47AM

Announcing wrangler dev — the Edge on localhost

Announcing wrangler dev — the Edge on localhost

https://meson.in/32ExgDp

Announcing wrangler dev — the Edge on localhost

Cloudflare Workers — our serverless platform — allows developers around the world to run their applications from our network of 200 datacenters, as close as possible to their users.

A few weeks ago we announced a release candidate for wrangler dev — today, we’re excited to take wrangler dev, the world’s first edge-based development environment, to GA with the release of wrangler 1.11.

Think locally, develop globally

It was once assumed that to successfully run an application on the web, one had to go and acquire a server, set it up (in a data center that hopefully you had access to), and then maintain it on an ongoing basis. Luckily for most of us, that assumption was challenged with the emergence of the cloud. The cloud was always assumed to be centralized — large data centers in a single region (“us-east-1”), reserved for compute. The edge? That was for caching static content.

Again, assumptions are being challenged.

Cloudflare Workers is about moving compute from a centralized location to the edge. And it makes sense: if users are distributed all over the globe, why should all of them be routed to us-east-1, on the opposite side of the world, causing latency and degrading user experience?

But challenging one assumption caused others to come into view. One of the most obvious ones was: would a local development environment actually provide the best experience for someone looking to test their Worker code? Trying to fit the entire Cloudflare edge, with all its dependencies onto a developer’s machine didn’t seem to be the best approach. Especially given that the place the developer was going to run that code in production was mere milliseconds away from the computer they were running on.

When I was in college, getting started with programming, one of the biggest barriers to entry was installing all the dependencies required to run a single library. I would go as far as to say that the third, and often forgotten hardest problem in computer science is dependency management.

We’re not the first to try and unify development environments across machines — tools such as Docker aim to solve this exact problem by providing a prepackaged development environment.

Yet, packaging up the Workers runtime is not quite so simple.

Beyond the Workers runtime, there are many components that make up Cloudflare’s edge, including DNS resolution, the Cloudflare cache — all of those parts are what makes Cloudflare Workers so powerful. That means that without those components, a standalone runtime is insufficient to represent the behavior of Worker request handling. The reason to develop locally first is to have the opportunity to experiment without affecting production. Thus, having a local development environment that truly reflects production is a requirement.

wrangler dev

wrangler dev provides all the convenience of a local development environment, without the headache of trying to reproduce the reality of production locally — and then having to keep the two environments in sync.

By running at the edge, it provides a high fidelity, consistent experience for all developers, without sacrificing the speedy feedback loop of a local development environment.

Live reloading

Announcing wrangler dev — the Edge on localhost

As you update your code, wrangler dev will detect changes, and push the new version of your code to the edge.

console.log() at your fingertips

Announcing wrangler dev — the Edge on localhost

Previously to extract your console logs from the Workers runtime, you had to have the Workers Preview open in a browser window at all times. With wrangler dev, you can receive your own logs, directly to your terminal of choice.

Cache API, KV, and more!

Since wrangler dev runs on the edge, you can now easily test the state of a cache.put(), without having to deploy your Worker to production.

wrangler dev will spin up a new KV namespace for development, so you don’t have to worry about affecting your production data.

And if you’re looking to test out some of the features provided on request.cf that provide rich information about the request such as geo-location — they will all be provided from the Cloudflare data center.

Get started

wrangler dev is now available in the latest version of Wrangler, the official Cloudflare Workers CLI.

To get started, follow our installation instructions here.

What’s next?

wrangler dev is just our first foray into giving our developers more visibility and agility with their development process.

We recognize that we have a lot more work to do to meet our developers needs, including providing an easy testing framework for Workers, and allowing our customers to observe their Workers’ behavior in production.

Just as wrangler dev provides a quick feedback loop between our developers and their code, we love to have a tight feedback loop between our developers and our product. We love to hear what you’re building, how you’re building it, and how we can help you build it better.

Product.platform

via The Cloudflare Blog https://meson.in/2DaAAwa

August 26, 2020 at 08:04PM

How Argo Tunnel engineering uses Argo Tunnel

How Argo Tunnel engineering uses Argo Tunnel

https://meson.in/2EBuwP7

How Argo Tunnel engineering uses Argo Tunnel

Whether you are managing a fleet of machines or sharing a private site from your localhost, Argo Tunnel is here to help. On the Argo Tunnel team we help make origins accessible from the Internet in a secure and seamless manner. We also care deeply about productivity and developer experience for the team, so naturally we want to make sure we have a development environment that is reliable, easy to set up and fast to iterate on.

A brief history of our development environment (dev-stack)

Docker compose

When our development team was still small, we used a docker-compose file to orchestrate the services needed to develop Argo Tunnel. There was no native support for hot reload, so every time an engineer made a change, they had to restart their dev-stack.

We could hack around it to hot reload with docker-compose, but when that failed, we had to waste time debugging the internals of Docker. As the team grew, we realized we needed to invest in improving our dev stack.

At the same time Cloudflare was in the process of migrating from Marathon to kubernetes (k8s). We set out to find a tool that could detect changes in source code and automatically upgrade pods with new images.

Skaffold + Minikube

Initially Skaffold seemed to match the criteria. It watches for change in source code, builds new images and deploys applications onto any k8s. Following Skaffold’s tutorial, we picked minikube as the local k8s, but together they didn’t meet our expectations. Port forwarding wasn’t stable, we got frequent connections refused or timeout.

In addition, iteration time didn’t improve, because spinning up minikube takes a long time and it doesn’t use the host’s docker registry and so it can’t take advantage of caching. At this point we considered reverting back to using docker compose, but the k8s ecosystem is booming, so we did some more research.

Tilt + Docker for mac k8s

Eventually we found a great blog post from Tilt comparing different options for local k8s, and they seem to be solving the exact problem we are having. Tilt is a tool that makes local development on k8s easier. It detects changes in local sources and updates your deployment accordingly.

In addition, it supports live updates without having to rebuild containers, a process that used to take around 20 minutes. With live updates, we can copy the newest source into the container, run cargo build within the container, and restart the service without building a new image. Following Tilt’s blog post, we switched to Docker for Mac’s built-in k8s. Combining Tilt and Docker for Mac k8s, we finally have a development environment that meets our needs.

Rust services that could take 20 minutes to rebuild now take less than a minute.

Collaborating with a distributed team

We reached a much happier state with our dev-stack, but one problem remained: we needed a way to share it. As our teams became distributed with people in Austin, Lisbon and Seattle, we needed better ways to help each other.

One day, I was helping our newest member understand an error observed in cloudflared, Argo Tunnel’s command line interface (CLI) client. I knew the error could either originate from the backend service or a mock API gateway service, but I couldn’t tell for sure without looking at logs.

To get them, I had to ask our new teammate to manually send me the logs of the two services. By the time I discovered the source of the error, reviewed the deployment manifest, and determined the error was caused by a secret set as an empty string, two full hours had elapsed!

I could have solved this in minutes if I had remote access to her development environment. That’s exactly what Argo Tunnel can do! Argo Tunnel provides remote access to development environments by creating secure outbound-only connections to Cloudflare’s edge network from a resource exposing it to the Internet. That model helps protect servers and resources from being vulnerable to attack by an exposed IP address.

I can use Argo Tunnel to expose a remote dev environment, but the information stored is sensitive. Once exposed, we needed a way to prevent users from reaching it unless they are an authenticated member of my team. Cloudflare Access solves that challenge. Access sits in front of the hostname powered by Argo Tunnel and checks for identity on every request. I can combine both services to share the dev-stack details with the rest of the team in a secure deployment.

The built-in k8s dashboard gives a great overview of the dev-stack, with the list of pods, deployments, services, config maps, secrets, etc. It also allows us to inspect pod logs and exec into a container. By default, it is secured by a token that changes every time the service restarts. To avoid the hassle of distributing the service token to everyone on the team, we wrote a simple reverse proxy that injects the service token in the authorization header before forwarding requests to the dashboard service.

Then we run Argo Tunnel as a sidecar to this reverse proxy, so it is accessible from the Internet. Finally, to make sure no random person can see our dashboard, we put an Access policy that only allows team members to access the hostname.

The request flow is eyeball -> Access -> Argo Tunnel -> reverse proxy -> dashboard service

How Argo Tunnel engineering uses Argo Tunnel

Working example

Your team can use the same model to develop remotely. Here’s how to get started.

  1. Start a local k8s cluster. https://docs.tilt.dev/choosing_clusters.html offers great advice in choosing a local cluster based on your OS and experience with k8s
How Argo Tunnel engineering uses Argo Tunnel

2. Enable dashboard service:

How Argo Tunnel engineering uses Argo Tunnel

3. Create a reverse proxy that will inject the service token of the kubernetes-dashboard service account in the Authorization header before forwarding requests to kubernetes dashboard service

package main
 
import (
   "crypto/tls"
   "fmt"
   "net/http"
   "net/http/httputil"
   "net/url"
   "os"
)
 
func main() {
   config, err := loadConfigFromEnv()
   if err != nil {
       panic(err)
   }
   reverseProxy := httputil.NewSingleHostReverseProxy(config.proxyURL)
   // The default Director builds the request URL. We want our custom Director to add Authorization, in
   // addition to building the URL
   singleHostDirector := reverseProxy.Director
   reverseProxy.Director = func(r *http.Request) {
       singleHostDirector(r)
       r.Header.Add("Authorization", fmt.Sprintf("Bearer %s", config.token))
       fmt.Println("request header", r.Header)
       fmt.Println("request host", r.Host)
       fmt.Println("request ULR", r.URL)
   }
   reverseProxy.Transport = &http.Transport{
       TLSClientConfig: &tls.Config{
           InsecureSkipVerify: true,
       },
   }
   server := http.Server{
       Addr:    config.listenAddr,
       Handler: reverseProxy,
   }
   server.ListenAndServe()
}
 
type config struct {
   listenAddr string
   proxyURL   *url.URL
   token      string
}
 
func loadConfigFromEnv() (*config, error) {
   listenAddr, err := requireEnv("LISTEN_ADDRESS")
   if err != nil {
       return nil, err
   }
   proxyURLStr, err := requireEnv("DASHBOARD_PROXY_URL")
   if err != nil {
       return nil, err
   }
   proxyURL, err := url.Parse(proxyURLStr)
   if err != nil {
       return nil, err
   }
   token, err := requireEnv("DASHBOARD_TOKEN")
   if err != nil {
       return nil, err
   }
   return &config{
       listenAddr: listenAddr,
       proxyURL:   proxyURL,
       token:      token,
   }, nil
}
 
func requireEnv(key string) (string, error) {
   result := os.Getenv(key)
   if result == "" {
       return "", fmt.Errorf("%v not provided", key)
   }
   return result, nil
}

4. Create an Argo Tunnel sidecar to expose this reverse proxy

apiVersion: apps/v1
kind: Deployment
metadata:
 name: dashboard-auth-proxy
 namespace: kubernetes-dashboard
 labels:
   app: dashboard-auth-proxy
spec:
 replicas: 1
 selector:
   matchLabels:
     app: dashboard-auth-proxy
 template:
   metadata:
     labels:
       app: dashboard-auth-proxy
   spec:
     containers:
       - name: dashboard-tunnel
         # Image from https://hub.docker.com/r/cloudflare/cloudflared
         image: cloudflare/cloudflared:2020.8.0
         command: ["cloudflared", "tunnel"]
         ports:
           - containerPort: 5000
         env:
           - name: TUNNEL_URL
             value: "http://localhost:8000"
           - name: NO_AUTOUPDATE
             value: "true"
           - name: TUNNEL_METRICS
             value: "localhost:5000"
       # dashboard-proxy is a proxy that injects the dashboard token into Authorization header before forwarding
       # the request to dashboard_proxy service
       - name: dashboard-auth-proxy
         image: dashboard-auth-proxy
         ports:
           - containerPort: 8000
         env:
           - name: LISTEN_ADDRESS
             value: localhost:8000
           - name: DASHBOARD_PROXY_URL
             value: https://kubernetes-dashboard
           - name: DASHBOARD_TOKEN
             valueFrom:
               secretKeyRef:
                 name: ${TOKEN_NAME}
                 key: token

5. Find out the URL to access your dashboard from Tilt’s UI

How Argo Tunnel engineering uses Argo Tunnel

6. Share the URL with your collaborators so they can access your dashboard anywhere they are through the tunnel!

How Argo Tunnel engineering uses Argo Tunnel

You can find the source code for the example in https://github.com/cloudflare/argo-tunnel-examples/tree/master/sharing-k8s-dashboard

If this sounds like a team you want to be on, we are hiring!

Product.platform

via The Cloudflare Blog https://meson.in/2DaAAwa

August 27, 2020 at 08:03PM

Asynchronous HTMLRewriter for Cloudflare Workers

Asynchronous HTMLRewriter for Cloudflare Workers

https://meson.in/3jpRk3c

Asynchronous HTMLRewriter for Cloudflare Workers

Asynchronous HTMLRewriter for Cloudflare Workers

Last year, we launched HTMLRewriter for Cloudflare Workers, which enables developers to make streaming changes to HTML on the edge. Unlike a traditional DOM parser that loads the entire HTML document into memory, we developed a streaming parser written in Rust. Today, we’re announcing support for asynchronous handlers in HTMLRewriter. Now you can perform asynchronous tasks based on the content of the HTML document: from prefetching fonts and image assets to fetching user-specific content from a CMS.

How can I use HTMLRewriter?

We designed HTMLRewriter to have a jQuery-like experience. First, you define a handler, then you assign it to a CSS selector; Workers does the rest for you. You can look at our new and improved documentation to see our supported list of selectors, which now include nth-child selectors. The example below changes the alternative text for every second image in a document.

async function editHtml(request) {
  return new HTMLRewriter()
     .on("img:nth-child(2)", new ElementHandler())
     .transform(await fetch(request))
}

class ElementHandler {
   element(e) {
      e.setAttribute("alt", "A very interesting image")
   }
}

Since these changes are applied using streams, we maintain a low TTFB (time to first byte) and users never know the HTML was transformed. If you’re interested in how we’re able to accomplish this technically, you can read our blog post about HTML parsing.

What’s new with HTMLRewriter?

Now you can define an async handler which allows any code that uses await. This means you can make dynamic HTML injection, based on the contents of the document, without having prior knowledge of what it contains. This allows you to customize HTML based on a particular user, feature flag, or even an integration with a CMS.

class UserCustomizer {
   // Remember to add the `async` keyword to the handler method
   async element(e) {
      const user = await fetch(`https://my.api.com/user/${e.getAttribute("user-id")}/online`)
      if (user.ok) {
         // Add the user’s name to the element
         e.setAttribute("user-name", await user.text())
      } else {
         // Remove the element, since this user not online
         e.remove()
      }
   }
}

What can I build with HTMLRewriter?

To illustrate the flexibility of HTMLRewriter, I wrote an example that you can deploy on your own website. If you manage a website, you know that old links and images can expire with time. Here’s an excerpt from a years’ old post I wrote on the Cloudflare Blog:

Asynchronous HTMLRewriter for Cloudflare Workers

As you might see, that missing image is not the prettiest sight. However, we can easily fix this using async handlers in HTMLRewriter. Using a service like the Internet Archive API, we can check if an image no longer exists and rewrite the URL to use the latest archive. That means users don’t see an ugly placeholder and won’t even know the image was replaced.

async function fetchAndFixImages(request) {
   return new HTMLRewriter()
      .on("img", new ImageFixer())
      .transform(await fetch(request))
}

class ImageFixer {
   async element(e) {
    var url = e.getAttribute("src")
    var response = await fetch(url)
    if (!response.ok) {
       var archive = await fetch(`https://archive.org/wayback/available?url=${url}`)
       if (archive.ok) {
          var snapshot = await archive.json()
          e.setAttribute("src", snapshot.archived_snapshots.closest.url)
       } else {
          e.remove()
       }
    }
  }
}

Using the Workers Playground, you can view a working sample of the above code. A more complex example could even alert a service like Sentry when a missing image is detected. Using the previous missing image, now you can see the image is restored and users are none of the wiser.

Asynchronous HTMLRewriter for Cloudflare Workers

If you’re interested in deploying this to your own website, click on the button below:

Asynchronous HTMLRewriter for Cloudflare Workers

What else can I build with HTMLRewriter?

We’ve been blown away by developer projects using HTMLRewriter. Here are a few projects that caught our eye and are great examples of the power of Cloudflare Workers and HTMLRewriter:

If you’re interested in using HTMLRewriter, check out our documentation. Also be sure to share any creations you’ve made with @CloudflareDev, we love looking at the awesome projects you build.

Product.platform

via The Cloudflare Blog https://meson.in/2DaAAwa

August 28, 2020 at 08:01PM