Anduin Xue

let today = new Beginning();

Web


Web 应用开发检查单

这篇博客提供了一个 Web 应用开发检查单,旨在确保你的业务系统是安全、稳定、快速、可扩展、自动化的。检查单包括了网络配置、权限配置、运维策略、DevOps、容器化、应用开发、应用体验和合规性等方面。它可以帮助你确保服务器的网络安全和性能,减小权限,快速恢复业务,自动化部署和容器化,代码是否存在各种攻击的风险,以及是否符合各种合规性。该检查单详细介绍了每个方面的最佳实践,并提供了一些有趣的问题来启发读者思考,如:你的应用是否支持黑色主题和大字体?你的代码是否可能产生违反 GDPR 或 CCPA 的行为?该检查单可以帮助你确保你的业务系统是符合最佳实践的,从而提高你的业务系统的质量和可靠性。--GPT 4

Web Linux Cloud Server Container Service Development

Mirror YouTube channel to watch videos with best experience

This article explains how to mirror YouTube channels to watch videos without ads and interruptions, using the command-line tool youtube-dl. The author provides a script that downloads videos from a list of YouTube channels and saves them to a local folder, which can be added to the media library of a media server like Jellyfin. The article also explains how to expose the video folder to the internet via a web server and play the videos using other players like VLC. The step-by-step instructions are detailed and easy to follow, making it a great guide for anyone who wants to watch YouTube videos without ads.--GPT 4

Web Linux Ubuntu Python Youtube Jellyfin VLC

Setup a Ubuntu apt mirror server

This blog post provides a comprehensive guide on how to set up an Ubuntu apt mirror server. The process begins with installing the `apt-mirror` package and configuring the `mirror.list` file to specify the source you want to mirror. The author then explains how to start mirroring and where the downloaded files will be stored. The next step involves configuring a web server using Aiursoft.Static, including modifying permissions for accessibility and creating a systemd service for automatic startup. The guide continues with instructions on how to configure a reverse proxy using Caddy and finally, how to configure your client to use your mirror source. The author concludes by stating the benefits of setting up an Ubuntu mirror, such as bandwidth saving and faster software package downloads. Would it be possible to further optimize this process? How secure is this setup?--GPT 4

Web Linux Ubuntu Cache Server apt Mirror

自己独立运营一个面向你的朋友的 AI 绘画系统(基于 Stable Diffusion)

本篇博客介绍了如何独立运营一个面向朋友的AI绘画系统,基于Stable Diffusion。文章首先建议限制某些功能,以避免暴露给朋友的任意Prompt填写导致的潜在危险。接下来,博客详细介绍了如何编辑`ui-config.json`文件来限制Stable Diffusion画色图的功能,并提供了一份示例配置。 文章还建议编辑`user.css`文件,隐藏一些可能让人困惑的按钮,提供了相应的CSS代码。最后,博客介绍了如何使用FRPC和Caddy将Stable Diffusion暴露到公网,并使用加密通信。文章给出了一个搭建成功的示例网址,并提供了FRP和Caddy的使用教程链接。 在阅读本文后,你是否对如何独立运营一个面向朋友的AI绘画系统有了更清晰的认识?如何确保系统的安全性和用户体验?如何将本地服务暴露到公网并保证通信安全?希望这篇博客能为你提供启发和帮助。--GPT 4

Web Server Tune Stable Diffusion Ai Self hosting

Install Nextcloud on a Ubuntu 20.04\22.04 server

本篇博客详细介绍了如何在Ubuntu 20.04/22.04服务器上安装Nextcloud。文章分为17个步骤,包括安装所需的软件包、配置数据库、创建Nextcloud目录、设置权限、配置Apache、安装和配置SSL证书、设置大文件上传、配置Cron、调整数据存储位置、完成区域设置、完成电子邮件设置、完成Redis设置、设置备份、设置反向代理(可选)以及设置GPU。 文章还提供了一些有趣的问题,以吸引读者阅读并启发思考。例如,在调整数据存储位置时,如何确保在重启后云仍然可以正常工作?在设置备份时,如何自动运行备份脚本以确保数据安全?在设置反向代理时,如何避免出现问题? 通过阅读本篇博客,读者可以了解到如何成功安装和配置Nextcloud,以及如何根据自己的需求进行一些额外的设置。在文章的最后,作者还提到了如何为Nextcloud添加GPU支持,以便在安装了识别应用程序的情况下提高性能。 现在,你是否对在Ubuntu服务器上安装Nextcloud感兴趣?是否想知道如何通过这些设置来优化你的Nextcloud实例?快来阅读全文,自己找到答案吧!--GPT 4

Web Linux Ubuntu IT Apache2 PHP MySQL Certbot Nextcloud Storage

在一秒钟内打开苏康码

在这篇博客中,我们探讨了如何在一秒钟内打开苏康码,摆脱支付宝和微信小程序的繁琐。首先,我们通过访问苏州公安局的官方网站获取苏康码,然后将获取到的URL复制到手机并固定到桌面。这样,当需要出示健康码时,可以快速打开。此外,我们还讨论了这种方法是否合法,以及是否可以在电脑上完成。结果发现,这种方法是合法的,因为我们仍然通过正常渠道获取健康码。同时,这个方法也可以在电脑上完成,为那些手机没电的情况提供了便利。 但是,这篇文章中介绍的方法已经失效,作者正在寻找替代方案。那么,有没有其他方法可以更快速地打开苏康码呢?在未来,我们是否能够找到更便捷的方式来展示我们的健康码,以减轻生活中的不便?期待你的探索和发现!--GPT 4

Web China Health Code

Build a package that can be used in browser and node with TypeScript

本篇博客详细介绍了如何使用TypeScript构建一个可在浏览器和Node.js中使用的包。首先,我们需要安装必要的依赖,如terser-webpack-plugin、ts-loader、typescript、webpack和webpack-cli。接着,在项目中创建tsconfig.json文件,配置TypeScript编译选项。然后,在项目中创建一个名为src的文件夹,并在其中放置.ts文件。示例中展示了一个名为DisableWith的类,并将其导出为默认导出。 接下来,我们需要在项目的根目录下创建webpack.config.js文件,配置Webpack以便将TypeScript代码打包成UMD格式的库。在生产模式下,我们还会使用terser插件对包进行优化。最后,别忘了修改package.json文件,指定库的入口文件。 通过运行`npm run build`命令,我们可以构建项目,并在dist文件夹中生成相应的文件。然后,可以通过一个简单的示例来测试生成的库。最后,我们将项目发布到npm,使用户可以通过`npm install`命令安装我们的包,并在他们的项目中使用。 整个过程详细介绍了从项目创建到发布的每个步骤,为那些希望使用TypeScript构建库的开发者提供了很好的参考。在阅读本文后,你是否已经掌握了如何使用TypeScript构建可在浏览器和Node.js中使用的包?有没有什么可以改进的地方?欢迎阅读全文并进行深入探讨。--GPT 4

Web npm TypeScript node webpack JavaScript Front-end

Creating a proxy to another URL with ASP.NET Core

本文讨论了如何在C#或ASP.NET Core中编写简单的HTTP代理逻辑,以及如何让您的项目代理请求到其他URL。这不是关于为您的ASP.NET Core项目部署代理服务器的内容。 首先,您需要明确您要代理的目标,这应该是一个URL。 在项目的任意位置添加以下代码: (此处省略代码示例) 这个方法将用户发送的`HttpContext.Request`转换为可重用的`HttpRequestMessage`,以便您将此消息发送到目标服务器。 在目标服务器响应之后,您需要将响应的`HttpResponseMessage`复制到`HttpContext.Response`,以便用户的浏览器直接获取到它。 (此处省略代码示例) 现在准备工作已经完成,回到我们的控制器: (此处省略代码示例) 尝试访问它,它将被代理到google.com。 (此处省略图片示例) 本文向您展示了如何在ASP.NET Core中实现简单的HTTP代理功能,通过这个代理功能,您可以将请求代理到其他URL。这将为您的项目带来更多的灵活性和扩展性。那么,您是否已经考虑在自己的项目中使用这种代理功能呢?如何有效地利用这个功能来改进您的项目呢?--GPT 4

ASP.NET Core Reverse Proxy Web Proxy

微信的架构是如何实现分布式消息分发?

微信作为生活中不可或缺的通讯工具,其架构设计之巧妙令人称赞。本文探讨了微信如何通过分布式架构实现高效的消息分发。文章首先提出了一些关于微信的疑问,例如需要手机扫码登录PC端、切换设备后无法同步聊天记录等,然后通过深入分析微信的架构设计,解释了这些现象背后的原因。 文章提出,微信采用了分布式应用架构,其服务器遍布全球各地,没有中心化的服务器。为了实现分布式通讯,微信至少需要设计三个算法:服务器选择算法、服务器端切换算法和用户发现算法。这三个算法共同保证了用户能够快速定位到合适的微信服务器并进行通信。 分布式架构的设计带来了许多好处,例如运维上的便利、对单台服务器生命的弱化、国际化应用的支持等。此外,文章还通过类比Email的通信过程,解释了微信群聊、文件传输等功能的实现原理。 最后,文章指出许多产品经理可能无法理解微信架构设计的复杂性,而盲目模仿或吐槽微信的槽点。实际上,微信的设计非常精巧,为用户提供了高效便捷的通讯体验。然而,这种设计也存在一定的局限性,有些功能并非程序员脑残,而是数据结构本身无法支撑。因此,产品经理在设计产品时,需要更深入地了解技术架构,避免提出不切实际的需求。--GPT 4

Web WeChat Distributed Messging IM

HTTP post file from .NET Core new HTTP client

随着.NET Core 3的发布,微软推出了一款全新的.NET Core HTTP客户端。新客户端使得调用WEB API变得更加简单。本文将介绍如何使用新客户端提交文件至服务器。 通常情况下,我们调用Web API时不需要提交二进制文件。但是在新客户端中,我们应该如何向服务器提交文件呢?首先,我们需要了解HTTP POST请求带文件与表单URL编码内容的不同之处。表单通过一些边界进行划分,边界名称在HTTP头部的内容类型中指定。 要从.NET Core HTTP客户端提交文件,可以使用`MultipartFormDataContent`,这样框架就可以处理多部分内容。然后,通过添加新的流内容将文件添加到表单中。此外,您还可以向表单中添加其他内容,如URL编码的内容。最后,提交表单。 本文提供的示例代码展示了如何使用新的HTTP客户端提交文件至服务器。在这个过程中,您可能会遇到一些有趣的问题,例如如何处理多个文件的上传,或者如何在提交文件的同时提交其他类型的数据。文章内容将引导您探索这些问题,并帮助您找到合适的解决方案。--GPT 4

ASP.NET Core C# .NET Core HTTP Web File HTTP Client POST

Bootstrap dark theme minimum style

With the increasing popularity of dark mode in mobile apps and websites, it's essential to adapt your Bootstrap-based website to support this feature. This blog post discusses a simple method to enable automatic dark theme switching with minimal changes to your existing website. Using media queries in CSS, you can easily detect if the current device is set to dark mode and apply the appropriate styles. Similarly, with JavaScript, you can detect dark mode and execute specific actions. The blog provides code snippets to accomplish these tasks, including monitoring dark mode status changes and modifying elements' classes based on the user's preference. However, detecting dark mode alone is not enough. You also need to modify some styles for specific elements like input fields. The blog provides a list of CSS rules to be applied when the dark mode is enabled, ensuring a seamless and visually appealing experience for users who prefer the dark theme. By implementing this method, you can ...--GPT 4

Web CSS Bootstrap Media Query Style Dark theme

Use IIS or Azure App Service as a reverse proxy

In this blog post, we explore the process of setting up a reverse proxy using IIS or Azure App Service. Reverse proxies are beneficial for hiding the origin server's identity and improving performance, security, and load balancing. Before configuring the reverse proxy, it's essential to install IIS and the necessary extensions, such as RequestRouter and Rewrite. Once installed, enable the proxy settings in the IIS management tools and create a new reverse proxy rule by configuring domain bindings and HTTPS certificates. Creating a web.config file under the site root path is crucial for adding rules, such as redirecting HTTP traffic to HTTPS and setting up the real reverse proxy logic. The blog post provides a detailed example of setting up a reverse proxy for Aiursoft.IO and a simpler example for Google.com. To further enhance security, the HSTS feature can be enabled by adding specific code to the web.config file. For deploying the reverse proxy server to Azure App Service, simply ...--GPT 4

IIS web.config Reverse Proxy Web Azure App Service Azure

  • 1