avatar
busylog
initramfs modules swapping
idea: portting initramfs to use another kernel, so /lib/modules should be changed. unmkinitramfs is helpful to handle prepended parts. and snippet from mkinitramfs(debian): [ "$(id -ru)" != 0 ] && cpio_owner_root="-R 0:0" cd "${DESTDIR}" && find . | LC_ALL=C sort | cpio --quiet $cpio_owner_root $cpio_reproducible -o -H newc >>"${outfile}" || exit 1 Code: (you can gzip -9 -n /tmp/T1F later) # use T1 as base and T2 as /lib/modules T1=$(mktemp) T2=$(mktemp) T1D=$(mktemp -d) T2D=$(mktemp -d) outfile=/tmp/T1F wget -o $T1…
avatar
busylog
Windows 11 Notes (24H2)
Winget is convenient! no more powershell hacks to uninstall appx. find your apps at https://github.com/microsoft/winget-pkgs or winget search. Photos can be replaced with legacy Windows Photo Viewer (registry file import required). rem winget uninstall Microsoft.Windows.Photos_8wekyb3d8bbwe winget uninstall Microsoft.549981C3F5F10_8wekyb3d8bbwe winget uninstall Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe winget uninstall Microsoft.OneDriveSync_8wekyb3d8bbwe winget uninstall Microsoft.WindowsMaps_8wekyb3d8bbwe winget uninstall Microsoft.ZuneMusic_8wekyb3d8bbwe winget uninstall Microsoft.ZuneVideo_8wekyb3d8bbwe winget uninstall Microsoft.Todos_8wekyb3d8bbwe winget uninstall Microsoft.Getstarted_8wekyb3d8bbwe winget uninstall Microsoft.XboxGameOverlay_8wekyb3d8bbwe winget uninstall Microsoft.Xbox.TCUI_8wekyb3d8bbwe winget uninstall Microsoft.GamingApp_8wekyb3d8bbwe winget…
avatar
Mark24
组建局域网 01_搭建 DNS 服务器给设备专属域名
我的博客地址 https://mark24code.github.io/%E5%88%86%E4%BA%AB%E4%B8%8E%E5%88%9B%E9%80%A0/2021/11/23/%E7%BB%84%E5%BB%BA%E5%B1%80%E5%9F%9F%E7%BD%9101_%E6%90%AD%E5%BB%BADNS%E6%9C%8D%E5%8A%A1%E5%99%A8.html 背景: 在家庭局域网中,我们有若干个设备连接在同一台路由其中。路由器和下属设备形成了一个小型局域网。 我们可以在局域网中通过ip互相访问。这是一般情况。 目标 我希望可以给局域网中…
avatar
busylog
Dism++ exclusion rules for WoA(ARM64)
ProgramData\Microsoft\Windows Defender\Scans\ ProgramData\Microsoft\Windows Defender\Definition Updates\ $SysReset Windows\XtaCache Windows\System32\winevt\Logs Windows\System32\LogFiles ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb optional (need to reinstall/upgrade edge) Program Files (x86)\Microsoft\Edge Program Files (x86)\Microsoft\EdgeCore Program Files (x86)\Microsoft\EdgeUpdate
avatar
Mark24
Ruby标准库有趣部分摘要
我的BLOG https://mark24code.github.io/ruby/2021/12/07/Ruby%E6%A0%87%E5%87%86%E5%BA%93%E6%9C%89%E8%B6%A3%E9%83%A8%E5%88%86%E6%91%98%E8%A6%81.html 摘要 etc 用来获得 /etc 下面信息。比如系统登录用户,可以做一个系统粘合性较高的程序来使用。 enumerable 把你的class变成迭代器 objectspace 可以返回class实例统计信息,size等,可以作为扫描、performance、统计使用。 observable 把你的class变成发布订阅模式 marshal 把程序对象字节…
avatar
Rei
Tailwind CSS 浅析
Tailwind CSS 是近几年比较火的 CSS 框架,我学习了一些它的理念和用法,把想法记录如下。 什么是 Tailwind CSS Tailwind CSS 是一个工具类优先的 CSS 框架。跟别的 CSS 框架最大的区别是,别的框架通常提供 .button, .card 这样有语义的样式名,Tailwind 提供的是 flex, pt-4, text-center 这样无语义的样式名。 可以看一个例子(取自官网): 使用 Tailwind 的页面里,没有 .card .author-name 这样的语义化样式,而是 bg-gray-100 rounded-xl 这样的…
avatar
Mark24
《Ruby 设计模式》笔记
算是私人笔记。但是记录下也许需要人可以获得有价值的信息。 这本书绝版了 Ruby设计模式笔记
avatar
windy
Rails7 正布发布(译)
Rails7 的新理念几年前就开始了。这是我们愿景的实现,真正意义的全栈Web开发框架,完美将前端和后端的技术挑战进行了融合和平衡。其中包括了全方位的开箱即用的点菜单,从餐前开胃菜到餐后甜点都有。 这个理念其实几年前就有,但之前无法启动。主要是我们没有足够的相关技术成熟度。随着浏览器全面支持ES6、ESM,和HTTP/2的适配,还有令人兴奋的 importmap 相关标准,这一切变为了可能。Rails7…
avatar
Mark24
Ruby环境搭建asdf+ruby+gem+bundler+源替换
我的博客 https://mark24code.github.io/ruby/2021/12/24/Ruby%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BAasdf+ruby+gem+bundler+%E6%BA%90%E6%9B%BF%E6%8D%A2.html 适用于新手搭建Ruby环境 step1 asdf asdf 的功能类似 rvm, 但是更高级点,严格意义上说 asdf 继承了所有语言的 *vm 管理。我喜欢一劳永逸。 开始吧 详细可以访问官网 https://asdf-vm.com 我下面列举我要做做的事情,大家根据自己的实际情况来。 1.1 安装 asdf 安装就是 clone git…
avatar
Rei
Rails on Docker: 用 Docker Compose 搭建开发环境
💡 Rails on Docker 系列文章是面向 Rails 程序员的 Docker 教程,描述了如何从开发环境到部署环境中应用 Docker。这是系列文章的第二篇。 在上一节中我们已经学习了 Docker 使用的基础,这一节将介绍如何用 Docker Compose 搭建 Rails 开发环境。 为什么要用 Docker 首先回答一个问题,为什么要在开发环境使用 Docker,直接在本地系统上搭建环境不好吗? 在开发环境使用 Docker 可以获得以下好处: 将开发环境固化成配置文件,方便新加入的开发者启动…
avatar
Rei
如何从 Webpacker 切换到 CSS/JS bundling
最近 Rails 7 正式发布,其中一个引人注目的特性是 CSS/JS bundling,用于取代 Rails 6 的 Webpacker。我在之前的文章中介绍过新的方案带来什么变化。 现在 Rails 创建项目,将会增加两个参数: -j, [--javascript=JAVASCRIPT] # Choose JavaScript approach [options: importmap (default), webpack, esbuild, rollup] -c, [--css=CSS] # Choose CSS processor [options: tailwind, bootstrap, bulma, postcss, sass...] 例如要使用 esbuild 和 sass 可以用以下命令: $ rails new myapp -j esbuild -c sass 但大多数人关心的可能是如何从已有项目上切换到新方案,下面…
avatar
老王
Nikon Mikron 6x15
待收货中
avatar
roogen
Python for Business: Optimize Pre-Processing Data for Decision-Making
The rise of machine learning and the use of Artificial Intelligence gradually increases the requirement of data processing. That’s because the machine learning projects go through and process a lot of data, and that data should come in the specified format to make it easier for the AI to catch and process. Likewise, Python is a popular name in the data preprocessing world because of its ability to process the functionalities in different ways. Besides, libraries like Pandas and Numpy make Python one of the most efficient technologies available in the market. In this article, we will discuss how…
avatar
Rei
在 Fly.io 部署 Rails 应用
这几天我把 GeekNote 的部署环境迁移到了 Fly.io,我觉得这是一个值得推荐的平台,所以写这篇日志介绍一下。 为什么选择 Fly.io Fly.io 是一个基于容器的部署平台,致力于在全球各个区域提供贴近最终用户的部署环境。 跟传统的基于 VM 的云服务相比,基于容器的的部署平台不需要管理底层操作系统,能确保应用在开发和生产环境运行在同一环境,并且可以轻松缩放。 跟其他容器部署平台相比(例如 Heroku),Fly.io 提供…
avatar
刘东
Rails on Docker: 用 Docker Compose 搭建 Rails 7 开发环境
原文地址:https://clwy.cn/guide/pages/docker-clwy-v1-rails-dev 前提条件 如果你对Docker并不太了解,请务必先学习并尝试Rei的Rails on Docker 系列文章。 我在Rei这两篇教程的基础上,做了一个相对更完善的,构建更加简便的教程,让Docker方便于Rails的工程开发。 这里使用了: ruby 3.1.0 rails 7.0.1 postgresql 14.1 redis 6.2.6 构建 Rails 基础镜像 任意目录,创建一个文件夹,例如docker-rails,里面新建一个文件Dockerfile-rails-7…
avatar
鱼翅
数据结构其一 线性表
数据结构: 线性表 前言(啰嗦两句) 作为一名普通野鸡大学的毕业的科班生,虽然在学校学过《数据结构》这样一门课程,但彼时的我所有的编码经验也就只是写过一些诸如杨辉三角,水仙花数之类的例题,因而在结课后很快就还给老师了…… 最近颇乏于写应用层代码画页面,终于又双叒叕难得想学数据结构了,遂打算开一个系列,希望能够有始有终的写完。 yuchiXiong/data-structure: 我又双叒叕准备学数据结构啦 1. 线性表是什么…
avatar
Rei
在 Hotwire Turbo 链接跳转时保持窗口滚动位置
GeekNote 使用了 Hotwire 的 Turbo,有些地方需要用到 Tab 导航。我希望在切换 Tab 的时候保持页面滚动的位置,避免页面跳动。 经过搜索,发现 Hotwire 有个 Issus 提出了这个需求,然后维护者给了官方的实现思路:https://github.com/hotwired/turbo/issues/37#issuecomment-751523976 。这个实现对当前版本有些问题,根据后面的回复我找到了适合当前版本的实现。 只需加入一段 js: let scrollTop = 0 window.addEventListener("turbo:click", ({ target }) => { if (target.hasAttribute("data-turbo-preserve-scroll")) { scrollTop = document…
avatar
fengzhi
使用 nuapi 记录 github 上别人关注的仓库列表
nuapi.com 浏览github上厉害人的时候,我们有时也想知道别人关注的仓库是什么,这样我们就能发现新的宝藏。例如Vue的创建者尤雨溪 我们想查看他关注的仓库列表是,我们可以选择直接访问页面上 yyx990803 star 当我们想知道更多细节的时候,这个时候数据就更重要了。要是我们能通过API来获取到他关注的信息,那我们不就更方便快捷的获取到关注信息了。 我们找到github的api文档,看看…
avatar
fleam
erlang Elixir phoenix 安装记录
长生不老火凤凰 第一步,安装elixir https://www.jianshu.com/p/ca9b58e7fff8 我用的1.11的版本 elixir和erlang版本之间应该有版本对应,我都用最新的或者比较新的 asdf global elixir 1.11 设置镜像(安装依赖用) 如果elixir安装失败,试试先设置镜像 https://ruby-china.org/topics/31631 第二步,安装erlang 这个很难安装,浪费了很长时间 最后源码编译,也是急了,无脑按他的readMe来 https://gitee.com/mirrors/otp make后提示有两个东西没有,没报错没管…
avatar
Rei
Rails 社区遇到了真正的危机
堡垒最容易从内部攻破。 —— 列宁 Rails 社区其实一直以来都有不少唱衰,有说 Ruby 已死的,有说 Rails 无法扩展的,有说 Rails 已经落后于前端开发模式的……我一直不以为然,因为我知道只要 Rails 还是精于小团队的生产力框架,它就有继续成长的空间。 但今天我感觉 Rails 社区遇到了真正的危机,它来自于核心维护成员。 几天前 DHH 发了一条推,宣布他无缘今年的 RailsConf 主题演讲: DHH 在的文章 No RailsConf…