标签为“Linux以及各种捣鼓的笔记”的页面如下
Radicale with Caddy v2
In this article (in Chinese), I discussed installing and using Radicale in termux. However, in most sceneries we are more likely to put radicale behind a web proxy. In this article I take notes on how did I make radicale work with Caddy v2.
If you search “radicale with caddy”, you are more likely to find information about using radicale with Caddy v1. By explicitly searching “radicale with caddy v2” you can fetch meaningful answers as in this post. Though I didn’t find the very post before I worked out the solution myself. T_T
Learn from Linux from Scratch (LFS) (Part 2)
在Part 1中,涉及的知识点主要集中在宿主机上准备构建环境。本篇将记录对应于书中第5章”Constructing a Temporary System”一章的从“Introduction”到“GCC-9.2.0 – Pass 2”有关内容。
Learn from Linux from Scratch (LFS) (Part 1)
Learn from Linux from Scratch (LFS)这个系列的文章是我在阅读Linux from Scratch 9.1过程中的笔记。我用的宿主系统为CentOS 8(运行于VituralBox虚拟机中,VirtualBox虚拟机的Host是Windows 10)。
阴阳师爬塔与迷宫生成算法
最近的阴阳师缘结神活动新增了走迷宫的要素。几百层的迷宫不可能手动绘制吧?于是想到了是不是有迷宫生成算法。
能查到的迷宫生成算法有三种:递归回溯、 随机prim算法、 递归分割。前两种属于“拆墙法”,而递归分割则是“造墙法”。先放一下结论:
SELinux学习笔记
前排提示(2022-08-18):这 post 一直躺在我的草稿箱里面,没有写完,但不发出来又觉得难过
基于规则的安全模型
具体地说,在CentOS和Fedora的默认配置中,SELinux使用的targeted策略只覆盖了有限的(系统)应用程序。用户,特别是在/usr/local和/home目录运行的东西不受targeted约束。设计这样的默认配置显然是为了在易用性和安全性之间取得某种平衡。
使用Radicale建立你的私有日历和联系人同步服务器
换手机了,发现新手机完全不能兼容google play,看log是少一个权限无法申请。不知道是不是google单方面ban了华为,或者华为单方面ban了google。不管怎么样我想要同步我的google账号上的日历和联系人是不可能了。
就在我导出google日历和联系人的时候,我又开始在想那个问题了:数据不在自己的手上,有一天可能就找不回来了。能不能自己搭建一个私有云呢?说到私有云我立刻想到了Nextcloud,但是看到Nextcloud的各种php、数据库还有http服务器依赖之后我觉得太麻烦了——我的需求是日历同步,Nextcloud一套上来过于复杂了,而且不够轻量。
于是我找到了Radicale这个开始于学校作业的项目。这个项目基本上可以在任何能运行Python的地方运行。它支持的CalDAV协议。这种协议的客户端的话,PC上的邮件和日历app基本都支持这个协议,我用的是thunderbird。手机上的话,貌似华为不能直接支持这种协议,得装个DAVx5。
Wired and Wireless connections on the same Windows machine
如果一台装了Windows 7或者Windows 10机器同时连接着有线网和无线网,它会使用哪个接口去访问互联网呢?
如果只是想知道系统的路由,那么使用route print就可以了。但是如果想要强行设置从哪个接口出去呢?这时候可以通过调整**自动跃点计数(Automatic metric)**来实现。
解决Linux关机时音响会发出巨响的问题
如果你上网搜“linux pop sound on shutdown”会发现许多发行版都存在这个问题。我这边的发行版是Fedora,机器是惠普的暗影精灵第一代。
我试了一下,关机或者重启前用将系统静音并不能解决问题,仍然会听到“砰”一声响。
Installing nvidia driver on Fedora 29
Forewords
Installing the nvidia driver on Fedora has been a painful experience for me. If I don’t get it wrong, I have been trying since F26!
I will not touch on bumblebee. I will instead use nvidia-xrun to utilize the driver.
This article serves as a reminder for myself on what did I do to make things work for my Intel/nvidia hybrid laptop. It might hopefully help other people as well.
Notes on setting up a Raspberry Pi as an NAT mode IPv4/IPv6 dual stack wireless access point
The offical document turns out to be a good example of setting up an NAT mode IPv4 only wireless access point. In this post, I will extend the official doc a little bit, by adding the IPv6 stack to the RPi AP. I will also touch on a few lines about enabling 802.11n in hostapd.
GNU nano basics| nano编辑器的使用提示
命令行选项
-m 此选项可激活鼠标,按住shift建即可选择文本。对应nanorc的set mouse
-l 显示行号。对应nanorc的set linenumbers
-E或--tabstospaces 把已有文件中的tab转换为空格。对应nanorc的set tabstospaces
-i或--autoindent 启动自动缩进。对应nanorc的set autoindent
-A或--smarthome启动智能home键。对应nanorc的set smarthome
-$或--softwrap 开启自动折行。对应nanorc的set softwrap
找回Windows 10右键菜单的“在此打开命令窗口”
在Windows 7以及以前的Windows系统上,我们基本上都是手动往注册表里添加键值实现这一目的的。
HKEY_CLASSES_ROOT\Directory\Background\shell\cmd HKEY_CLASSES_ROOT\Directory\shell\cmd
tracert – The Windows counterpart of traceroute
It’s simple, no need to install cygwin or msys to obtain traceroute (I doubt if traceroute would work on Windows). tracert.exe comes with your Windows install:
tracert /?
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout]
[-R] [-S srcaddr] [-4] [-6] target_name
Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list (IPv4-only).
-w timeout Wait timeout milliseconds for each reply.
-R Trace round-trip path (IPv6-only).
-S srcaddr Source address to use (IPv6-only).
-4 Force using IPv4.
-6 Force using IPv6.
Linux主机获取校园网的ipv6地址……
这个是迷一样——我在Windows 10上,我的Android手机上,都能获取到global IPv6地址,可是一到我的Fedora Linux就只能获取到fe开头的非global地址……
Windows上通过pip安装Python软件包遭遇“UnicodeDecodeError”的解决
简而言之,如果你通过Windows自带的命令提示符(cmd)启动了pip,并且看到了类似下面的错误提示
in console_to_strreturn s.decode(sys.__stdout__.encoding)UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 33: invalid start byte
多半是因为命令提示符当前使用的代码页不是UTF-8。使用命令chcp,将当前代码页切换成UTF-8即可解决:
Port forwarding (or proxying) on OpenWRT with socat
在校园网环境中可能会有这种需求:我可以获取到公网IPv6而不能获取到公网IPv4,但是我的应用程序只支持IPv4(比如某些游戏),能否把到达我的公网IPv6的数据转发到内网IPv4(forward IPv6 to IPv4)?
用Lighttpd转发V2Ray的WebSocket连接
在开始阅读之前,你可能会对“用Nginx转发V2Ray的WebSocket连接”感兴趣,所以我先把这个链接附在这里:
https://oing9179.github.io/blog/2017/03/v2ray-as-WebSocket-Proxy-behind-Nginx/
老版极路由1s(HC 5661)刷入OpenWRT记录
(UPDATE Mar-17, 2017) 本文的内容适用于OpenWrt DD分支。但对于最近版本的LEDE(LEDE Reboot 17.01.4)事实上也基本适用。
先贴介绍链接
OpenWRT/LEDE
(旧的)OpenWRT DD
关于创建U盘启动盘的一点思考 | Some considerations when creating bootable flash disks
分区表
U盘在出厂时多半会使用MS-DOS格式的分区表,而不是现代硬盘中常见的GPT。我猜可能是因为需要考虑到兼容性?
分区和文件系统
如果你只用Linux,那么你尽管分区,理论上现代的Linux发行版都能将你U盘上的分区识别出来,无论是通过图形用户界面的自动识别还是通过lsblk然后用mount命令挂载。
但是,如果你还用Windows,并且你希望你创建的可启动U盘同时也能正常地当作一个大容量存储器,分区的时候最好注意以下几点:
- 分区表采用MS-DOS格式;
- 作为普通U盘那样存储数据部分的分区,必须是第一个分区,而且必须是主分区;
- 作为数据存储的这个分区应该使用Windows原生支持的文件系统,而且最好是U盘出厂时使用的文件系统(对于32G以内的U盘,一般来说是FAT32);
- 作为可引导的分区,也就是存放U盘操作系统的分区,应该被设为可启动分区。
ssh connect through sock5 proxy
This post provides a straightforward method to connect your ssh client through a local socks5 proxy.
It’s quite simple, if you have a socks5 server listening on your local port, say, 8888:
ssh -l login -p ssh_server_port -o ProxyCommand='nc --proxy-type socks5 --proxy 127.0.0.1:8888 %h %p' ssh_server_host_name
If you are not using nmap’s netcat utility, you may try:
ssh -l login -p ssh_server_port -o ProxyCommand='nc -X 5 -x 127.0.0.1:8888 %h %p' ssh_server_host_name
将v2ray、shadowsocks等设置为局域网中的代理服务器
使用代理服务器上网的时候,不知道大家有没有这样一个困惑:如果整个局域网都需要走代理,能不能只设置某一台机器(设为机器A)连接外网,其他机器连接那台能走外网的机器A呢?
Replacing blueman with blueberry in Fedora 26 Xfce
Maybe the graphical bluetooth management tool blueman is either too complicated or buggy. Anyway, I don’t like it.
在Visual Studio中使用GNU Scientific Library (GSL)
发现一个github仓库实现了这个事情: GNU Scientific Library with CMake build support。
Shadowsocks-rss wiki rescue
These pages are pulled from Google Web cache. Unfortunately these are not everything of the original wiki. If you have the other parts of the wiki that are missing here, don’t hesitate to comment below!
要不要用静态网页呢?
2020-08-23 UPDATE: 如果你看到这些文字,说明你看到的是静态网页
今天看到Linux中国的微信推送介绍静态网页生成工具Hugo。看起来很有意思啊,让我想起自己用Notepad++和Geany写HTML的日子。
现在用的Wordpress,感觉对服务器资源消耗甚是巨大。而且一查服务器日志,各种bot各种扫描。一句话,廉价VPS应付起来不太利索。
不知道有没有时间把博客“静态化”啊。
通过直接执行注销代码注销Dr.com的登陆
之所以有这个想法是因为安卓手机上的WebKit似乎不能正常执行注销按钮的javascript响应函数wc()。或者说,点那个注销按钮根本没反应。
神坑的360安全路由DNS代理
背景:在实验室用网络,发现手机上用DNS66设置的DNS服务器地址如同不起作用一样,Google死活上不去,挂shadowsocks却能上。
极路由 极1s(老版) HC5661 刷入OpenWRT Barrier Breaker 14.07 手记
本文提到的github仓库看起来很久没更新了,许多问题也没有修复,因此**不建议**刷入那个仓库的固件。关于刷入最新版OpenWRT的问题可以看我的这篇文章。
