python |
Pythonタグが付けられた新着投稿 - Qiita |
【強化学習】MuZeroを完成させたStochasticMuZeroを解説・実装 |
https://qiita.com/pocokhc/items/8ac7b66c2f18cbdf8ade
|
muzero |
2022-08-14 08:52:06 |
海外TECH |
DEV Community |
How to serve *any* website from your own domain (for free!) |
https://dev.to/just_moh_it/how-to-serve-any-website-from-your-own-domain-for-free-44l9
|
How to serve any website from your own domain for free Have you ever wanted to white label a website like display it on your own domain Or have you wanted to remove a watermark from a website that asks for premium for edu purposes ofc Well this guide contains everything you need to know to proxy a website webpage on your custom domain subdomain Let s just get into it The Backstory reading optional A few months ago I got my own domain from Google and have been putting up things on it for a long time Though when it comes to social media I wanted to show a links in bio page not my personal portfolio page I looked into some solutions Found a few websites like short io that allow you to shorten links and make them visible on your domain base but they re paid and provide little room for customization And the ones that did provide awesome features were mostly paid So I was left with no choice but to go with the standard solution mainstream websites like bio link or Linktree I got my links up on it customized it to just how I wanted and it looked really cool But since I consider myself somewhat of a perfectionist an understatement sometimes and like to bring something unique to the table I thought about a way to serve the bio link page on my own domain ️But why A few pros and consThere are a few pros to hosting a domain Just to name a few for me it was to ability to Makes links in bio page looks unique Unlike pages that are bio link username the custom domain page looks very professional just like how your portfolio on youdomain dev looks better as compared to p domain vercel appHave total control over anything served over the domain Remove watermarks or modify existing content pretty easily Cloudflare Workers specific pros Analytics Cloudflare tracks every request through its proxy so you could have a direct idea about where your domain visits are coming from and how they re reaching your website Caching Faster loads Cloudflare also caches every request that goes through its DNS proxy so a slow SPA could easily benefit on subsequent requests from the same user right out of the box though it s disabled by default Increased Uptime even when the source is down In case the source website goes down for a short time the content served over the domain would still work flawlessly given that it was recently cached Load Balancing You could randomly fetch from different sources and get a very basic version of load balancing Bypass account s free limits For example if you have accounts on Vercel hosting the same exact website you could easily modify the worker s code to randomly fetch from any one of them This way you could evenly distribute the data usage between the accounts and not hit the free account limit on the source website though this might be against the fair use policy ConsIt s important to note the downsides of this as wellMight not work on every website Well engineered web apps like Google s auth platform could easily detect if the receiver in this case Cloudflare s servers are the end users of the request This way they could prevent kind of man in the middle attacks But of the websites won t have problems like these Adds an extra layer Though this is pretty unnoticeable since the responses are un cached but basically since all the data goes through a third party Cloudflare the resource per request usage also increases Could get pretty expensive sometimes If your usage stats are out of the roof and you get more than k request per day subsequent users could face errors if you re on the free plan till the quota gets reset But hey for light usage and very typical use cases chances are that these cons won t matter In fact with features like caching and simple analytics the pros would certainly outweigh the cons ️But what is Cloudflare Workers Glad you asked According to Workers docs Cloudflare Workers provides a serverless execution environment that allows you to create entirely new applications or augment existing ones without configuring or maintaining infrastructure It s basically a way to run serverless functions just like AWS Lambda or Google Cloud Run but with a few small differences Cost At the time of writing this article it has around k free requests per day more than enough even for very famous webpages ️A Step by Step GuideThis guide assumes you have no little prior knowledge about Cloudflare and Cloudflare Workers Though if you re pretty experienced this guide doesn t compromise on quality over simplicity Create your Cloudflare account and add a domain optional Follow the usual intructions on configuring the domain s nameservers as illustrated in their adding a site docs If you aren t managing your DNS through Cloudflare point the domain to Cloudflare s servers Read their docs for more info Add your cloudflare worker RouteAdd the catch all domain sub domainClick Manage Workers and create a new worker Service Select the second option HTTP Router when creating the worker since we don t just want to send a simple responseOpen the web code editor to quickly edit the Cloudflare Worker logicEdit Paste the code and previewEdit the default code snippet that s already in the editor or add the following addEventListener fetch event gt event respondWith handleRequest event request catch err gt new Response err stack status Many more examples available at param Request request returns Promise lt Response gt async function handleRequest request return fetch Assign the custom domain to your workerAnd that s it Heap the Benefits Analytics Caching amp Custom DomainsWe can now access the contents of justmohit bio link at links mohitya dev Heck we even get simple analytics without the option being enabled by the bio link team Also get instant feedback on anything the server sends including status codes requests etc and the data is persisted for weeks at end in the free tier Taking it to the next level Edit response HTMLWe could change the Cloudflare Workers code in order to change the response that is displayed to the end user For example we could use it to our advantage for educational purposes only of course by removing a watermark on a website that requires a premium subscription to remove it You could find more info on how to modify response content using Cloudflare Workers on their HTML Rewriter docs A few AlternativesThough I m not fond of paying for a webpage with such a low view count I d still like to highlight some alternatives Paid Ably host Host any website on your subdomain within a few minutes no code alternative Free Self hosted Nginx If you want to manage everything Nginx could be easily used as a reverse proxy for routing both internal and external traffic Learn more That s it Thanks for reading along Let me know how what you re using this for if you ve tried to follow along Till then see you later |
2022-08-13 23:10:52 |
Apple |
AppleInsider - Frontpage News |
What to expect from Apple's September iPhone 14 event |
https://appleinsider.com/articles/22/08/13/what-to-expect-from-apples-september-iphone-14-event?utm_medium=rss
|
What to expect from Apple x s September iPhone eventEvery year anticipation grows for what Apple will release in the fall alongside the annual iPhone refresh Here s what to expect from September s Apple event Regular as clockwork Apple takes time in the fall to launch a swathe of new products intended for consumers to buy during the following holiday shopping period As a very lucrative time of year for the company Apple puts a lot of effort into its fall events showing off as many new items as possible While primarily centered on its iPhone product line Apple does take time to look at other complementary products and services Read more |
2022-08-13 23:26:32 |
海外ニュース |
Japan Times latest articles |
Subterranean sake: Cave aging Japan’s national drink |
https://www.japantimes.co.jp/life/2022/08/14/food/shimazaki-brewery/
|
caverns |
2022-08-14 08:00:48 |
海外ニュース |
Japan Times latest articles |
In Canada’s extreme north, grocery bills reach ‘alarming’ levels |
https://www.japantimes.co.jp/life/2022/08/14/food/canada-grocery-bills/
|
nunavut |
2022-08-14 08:00:42 |
ニュース |
BBC News - Home |
The Papers: Energy cap plans and 'Sanction Iran over Rushdie' |
https://www.bbc.co.uk/news/blogs-the-papers-62537356?at_medium=RSS&at_campaign=KARANGA
|
The Papers Energy cap plans and x Sanction Iran over Rushdie x Proposals to reduce coming hikes in energy costs and a call by Rishi Sunak for sanctions against Iran s Revolutionary Guard lead the papers |
2022-08-13 23:30:39 |
ニュース |
BBC News - Home |
MOTD analysis: How ‘pathetic’ Manchester United were thumped by Brentford |
https://www.bbc.co.uk/sport/av/football/62537505?at_medium=RSS&at_campaign=KARANGA
|
MOTD analysis How pathetic Manchester United were thumped by BrentfordMatch of the Day pundits Alan Shearer and Micah Richards analyse Manchester United s pathetic performance in their loss at Brentford |
2022-08-13 23:03:53 |
北海道 |
北海道新聞 |
真夏の徹夜おどり、一心に 岐阜・郡上、3年ぶり開催 |
https://www.hokkaido-np.co.jp/article/717485/
|
夏の風物詩 |
2022-08-14 08:36:16 |
北海道 |
北海道新聞 |
台風8号、太平洋を北上 土砂災害や高波警戒 |
https://www.hokkaido-np.co.jp/article/717516/
|
土砂災害 |
2022-08-14 08:19:54 |
北海道 |
北海道新聞 |
南部ヘルソン奪還作戦が失速か 兵器不足と米紙報道 |
https://www.hokkaido-np.co.jp/article/717520/
|
奪還作戦 |
2022-08-14 08:08:09 |
北海道 |
北海道新聞 |
85歳夫を殺害、81歳妻を容疑で逮捕 札幌白石署 |
https://www.hokkaido-np.co.jp/article/717521/
|
札幌市白石区本通 |
2022-08-14 08:02:24 |
コメント
コメントを投稿