-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.xml
28 lines (28 loc) · 11.7 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Notes</title><link>http://localhost/</link><description>Recent content on Notes</description><generator>Hugo -- gohugo.io</generator><lastBuildDate>Wed, 31 Aug 2022 00:00:00 +0000</lastBuildDate><atom:link href="http://localhost/index.xml" rel="self" type="application/rss+xml"/><item><title>SQL教程</title><link>http://localhost/database/sql/</link><pubDate>Wed, 31 Aug 2022 00:00:00 +0000</pubDate><guid>http://localhost/database/sql/</guid><description>聚合函数(Aggregate Functions) SELECT MAX(invoice_total) as max, MIN(invoice_total) as min, AVG(invoice_total) as avg, SUM(invoice_total) as total_sales FROM invoices; SELECT COUNT(payment_date) AS no_of_paid, -- 注意count不统计null值 COUNT(*) AS no_of_invoices -- 统计全部值 FROM invoices; SELECT &#39;Q1 2019&#39; AS data_range, SUM(invoice_total) AS total_sales, SUM(payment_total) AS total_payments, SUM(invoice_total - payment_total) AS unpaid FROM invoices WHERE invoice_date BETWEEN &#39;2019-01-01&#39; AND &#39;2019-03-31&#39; UNION SELECT &#39;Q2 2019&#39; AS data_range, SUM(invoice_total) AS total_sales, SUM(payment_total) AS total_payments, SUM(invoice_total - payment_total) AS unpaid FROM invoices WHERE invoice_date BETWEEN &#39;2019-04-01&#39; AND &#39;2019-06-30&#39; UNION SELECT &#39;Total&#39; AS data_range, SUM(invoice_total) AS total_sales, SUM(payment_total) AS total_payments, SUM(invoice_total - payment_total) AS unpaid FROM invoices WHERE invoice_date BETWEEN &#39;2019-01-01&#39; AND &#39;2019-06-30&#39;; data_range total_sales total_payments unpaid Q1 2019 699.</description></item><item><title>注入攻击</title><link>http://localhost/database/injection-attack/</link><pubDate>Wed, 31 Aug 2022 00:00:00 +0000</pubDate><guid>http://localhost/database/injection-attack/</guid><description> 识别漏洞 如下请求如果结果相同,说明很可能存在 SQL 注入漏洞
http://www.victim.com/showproducts.php?category=bikes # 原始请求 http://www.victim.com/showproducts.php?category=bi&#39;||&#39;kes # Oracle 和 PostgreSQL http://www.victim.com/showproducts.php?category=bi&#39;+&#39;kes # MS SQLServer http://www.victim.com/showproducts.php?category=bi&#39; &#39;kes # MySQL</description></item><item><title>GAMES 101</title><link>http://localhost/computer-graphics/games101/</link><pubDate>Thu, 03 Feb 2022 00:00:00 +0000</pubDate><guid>http://localhost/computer-graphics/games101/</guid><description>之前的内容
从长宽比和垂直方向的可视角度可以推算出水平方向的可视角度。此外也可推算出正交投影的远近、左右、上下信息。
光栅化 (Rasterization) 离散化三角形 (Triangles) What is a screen?
An array of pixels Size of the array: resolution A typical kind of raster display Raster == screen in German(屏幕的德语词汇)
Rasterize == drawing onto the screen Pixel (FYI, short for “picture element”)
For now: A pixel is a little square with uniform color Color is a mixture of (red, green, blue) 光栅化步骤 从变换空间[-1,1]^3^映射到到屏幕空间。首先忽略 z 方向,使用视口变换将 xy 空间映射到屏幕。
视口变换:把[-1,1]^2^变换为[0,width] x [0,height]的屏幕空间。视口变换矩(Viewport transform matrix)阵如下,除以 2 是因为原空间的宽高都是 2,最后一列是平移变换,将原点定义到屏幕中心(否则中心在屏幕左下角)。</description></item><item><title>Debian VPS 配置</title><link>http://localhost/fuck-gfw/debian-vps/</link><pubDate>Sat, 30 Oct 2021 00:00:00 +0000</pubDate><guid>http://localhost/fuck-gfw/debian-vps/</guid><description>XRay 官方脚本安装的文件 模板编辑配置文件 Xray 教程 V2rayN 4.12 配置教程 将语言更改成英语 首先输入下列语句,打开 locale 文件。
sudo vim /etc/default/locale 显示如下
LANG=&#34;zh_CN.UTF-8&#34; LANGUAGE=&#34;zh_CN:zh&#34; 将其内容更改成如下内容,然后重启。
LANG=&#34;en_US.UTF-8&#34; LANGUAGE=&#34;en_US:en&#34; 配置 sudo apt install sudo chmod 777 /etc/sudoers # 将sudoers修改为可编辑权限 vim /etc/sudoers 在root ALL=(ALL:ALL) ALL下添加user ALL=(ALL) ALL
chmod 440 /etc/sudoers # 将sudoers改回只读权限 配置静态 IP 打开/etc/network/interfaces文件,写入如下信息
iface ens192 inet static address 192.168.7.220 netmask 255.255.255.0 gateway 192.168.7.1 之后输入reboot重启。之后输入/etc/init.d/networking restart重启网络服务。
修改 GRUB 引导菜单等待时间 编辑/etc/default/grub文件,修改GRUB_TIMEOUT=5 这一参数值, 且保存退出。之后执行sudo update-grub重新生成 GRUB。
Docker 配置国内源 创建/etc/docker/daemon.json文件,写入如下内容,之后输入sudo systemctl restart docker重启 Docker 服务。</description></item><item><title>软路由系统</title><link>http://localhost/fuck-gfw/soft-routeros/</link><pubDate>Sat, 30 Oct 2021 00:00:00 +0000</pubDate><guid>http://localhost/fuck-gfw/soft-routeros/</guid><description>概论 软路由配置建议 仅装路由系统:J1900 + 2G 内存 一机多用+功能最大化:支持 VT-d 技术的 CPU + 大内存 =&gt; 虚拟机 VT-d 技术:虚拟化直通技术,LEDE 系统可以绕过虚拟平台,直接使用硬件资源 如需在软路由上玩虚拟化,最好选择 Intel 网卡 硬盘的读写速度不会影响裸装软路由的性能 裸装软路由的内存消耗大约只有 200+MB,大的内存不会提生速度,一般分配 1GB 内存足够 CPU 对软路由的性能起决定性作用,网卡决定了稳定性的好坏 软路由多网口的意义 多条宽带接入,需要多个 WAN 口 软路由内网传输需要消耗一定的 CPU 资源,因此不建议作为交换机使用 性能不好的软路由,最好搭配交换机 软路由 CPU 比较 CPU 频率 规格 功耗 单线程分数 多线程分数 虚拟化技术(VT-x) 定向虚拟化(VT-d) AES 指令集 参考价格 J1900 1.99GHz 4 核 4 线程 10W 535 1839 Y N N 600 起 3205U 1.50GHz 2 核 2 线程 15W 803 1499 Y Y N 750 起 ==3215U== 1.</description></item><item><title>GAMES 202</title><link>http://localhost/computer-graphics/games202/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>http://localhost/computer-graphics/games202/</guid><description>实时渲染:对离线渲染的科学知识的简化和变得更快的方法,以及相关的系统工程。
实时渲染进化史 Interactive 3D graphics pipeline as in OpenGL
Earliest SGI machines (Clark 82) to today Most of focus on more geometry, texture mapping Some tweaks for realism (shadow mapping, accum. buffer) 20 years ago
Interactive 3D geometry with simple texture mapping, fake shadows(OpenGL, DirectX) 20 -&gt; 10 years ago
A giant leap since the emergence of programmable shaders(2000) ==可编程渲染管线被发布出来== Complex environment lighting, real materials (velvet, satin, paints), soft shadows Today</description></item><item><title>Linux Logical Volume Manager(LVM)详解</title><link>http://localhost/fuck-gfw/lvm/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>http://localhost/fuck-gfw/lvm/</guid><description>LVM 简介 LVM 是 Logical Volume Manager(逻辑卷管理)的简写,它是 Linux 环境下对磁盘分区进行管理的一种机制。LVM 是在磁盘分区和文件系统之间添加的一个逻辑层,来为文件系统屏蔽下层磁盘分区布局,提供一个抽象的盘卷,在盘卷上建立文件系统,来提高磁盘分区管理的灵活性。通过 LVM 系统管理员可以轻松管理磁盘分区,如:将若干个磁盘分区连接为一个整块的卷组(volume group),形成一个存储池。管理员可以在卷组上随意创建逻辑卷组(logical volumes),并进一步在逻辑卷组上创建文件系统。管理员通过 LVM 可以方便的调整存储卷组的大小,并且可以对磁盘存储按照组的方式进行命名、管理和分配,例如按照使用用途进行定义:“DBdata”和“DBSoft”,而不是使用物理磁盘名“sda”和“sdb”或”hda”和”hdb”。而且当系统添加了新的磁盘,通过 LVM 管理员就不必将磁盘的文件移动到新的磁盘上以充分利用新的存储空间,而是直接扩展文件系统跨越磁盘即可。
LVM 将一个或多个磁盘分区(PV)虚拟为一个卷组(VG),相当于一个大的硬盘,我们可以在上面划分一些逻辑卷(LV)。当卷组的空间不够使用时,可以将新的磁盘分区加入进来。我们还可以从卷组剩余空间上划分一些空间给空间不够用的逻辑卷使用。LVM 模型如下:
物理卷(PV)被由大小等同的基本单元 PE 组成,一个卷组由一个或多个物理卷组成。逻辑卷建立在卷组上。逻辑卷就相当于非 LVM 系统的磁盘分区,可以在其上创建文件系统。
下图是磁盘分区、卷组、逻辑卷和文件系统之间的逻辑关系的示意图:
LVM 基本术语 物理存储介质(The physical media):这里指系统的存储设备:硬盘,如:/dev/hda、/dev/sda 等等,是存储系统最低层的存储单元。
物理卷(Physical Volume,PV):物理卷就是指硬盘分区或从逻辑上与磁盘分区具有同样功能的设备(如 RAID),是 LVM 的基本存储逻辑块,但和基本的物理存储介质(如分区、磁盘等)比较,却包含有与 LVM 相关的管理参数。
卷组(Volume Group,VG):LVM 卷组类似于非 LVM 系统中的物理硬盘,其由物理卷组成。可以在卷组上创建一个或多个“LVM 分区”(逻辑卷),LVM 卷组由一个或多个物理卷组成。
逻辑卷(Logical Volume,LV):LVM 的逻辑卷类似于非 LVM 系统中的硬盘分区,在逻辑卷之上可以建立文件系统(比如/home 或者/usr 等)。
PE(Physical Extent):每一个物理卷被划分为称为 PE(Physical Extents)的基本单元,具有唯一编号的 PE 是可以被 LVM 寻址的最小单元。PE 的大小是可配置的,默认为 4MB。
LE(Logical Extent):逻辑卷也被划分为被称为 LE(Logical Extents) 的可被寻址的基本单位。在同一个卷组中,LE 的大小和 PE 是相同的,并且一一对应。</description></item><item><title>Python脚本</title><link>http://localhost/scripts/python/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>http://localhost/scripts/python/</guid><description>mongo 数据迁移 from pymongo import MongoClient src_url = &#34;mongodb://mongoadmin:mongopassword@192.168.106.132:27017&#34; dest_url = &#34;mongodb://mongoadmin:mongopassword@localhost:27017&#34; database_list = [&#39;books_db&#39;, &#39;hourse_db&#39;, &#39;maya_corpus&#39;, &#39;music_db&#39;] src_client = MongoClient(src_url) dest_client = MongoClient(dest_url) print(&#39;all db\&#39;s names are&#39;, src_client.list_database_names()) for db_name in database_list: src_db = src_client[db_name] for collection_name in src_db.list_collection_names(): count = src_db[collection_name].count_documents(filter={}) print(db_name, collection_name, count) records = src_db[collection_name].find() print(&#39;duplicating&#39;) dest_client[db_name][collection_name].insert_many(records) 扫描文件夹内的全部文件 import os def walk_files(dir_path, suffix = None): &#34;&#34;&#34; :param dir_path:str 目标文件夹的路径 :param suffix:str 扫描指定后缀的文件, 传入None将扫描所有文件 &#34;&#34;&#34; files_list = [] for root, sub_dirs, files in os.</description></item></channel></rss>