Skip to content

Instantly share code, notes, and snippets.

View wcxaaa's full-sized avatar
✌️
位,耶赛 啪盒类 福航斯诶!

Chenxuan Wang wcxaaa

✌️
位,耶赛 啪盒类 福航斯诶!
  • @xtoneict
  • Chengdu
View GitHub Profile
@wcxaaa
wcxaaa / svcore-admin-runas.md
Created June 5, 2022 15:08
Windows Server Core 管理员以普通用户身份运行程序

Windows Server Core 管理员以普通用户身份运行程序,普通用户重新以权限汪身份运行程序

管理员以普通用户身份运行程序

示例:

RUNAS /trustlevel:"0x20000" powershell

("0x20000"指普通用户)

@wcxaaa
wcxaaa / btrfs-system-on-the-go.md
Created June 5, 2022 14:41
btrfs 子卷系统迁移清单

准备

要准备一个目标系统,或者至少要live cd

开始迁移 进chroot

  • 执行btrfs send 和 btrfs rec
  • 挂子卷,挂efi
  • /etc/fstab (删subvolid,改uuid, 加swap space)
  • /etc底下:hostname hosts resolv.conf
@wcxaaa
wcxaaa / btrfs-create-swapfile.md
Created June 5, 2022 13:57
btrfs 创建 swapfile
  • 在Btrfs分区根目录创建一个新子卷:
btrfs subvol create @swap
  • 继续执行以下命令:
chattr +C @swap # 禁用Copy On Write
btrfs property set @swap compression none # 禁用压缩
let t = {a: 'zzz'};
t.a instanceof String >>> false!!!!!
typeof t.a >>> 'string'
@wcxaaa
wcxaaa / relative.php
Last active January 31, 2018 07:21
Wordpress 相对路径
/*wp-config.php*/
/*设置相对路径*/
define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST']);
define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST']);
/* wp-includes/post.php 注意加注释的地方的$url */
/* 设置图片附件为相对路径 */
function wp_get_attachment_url( $attachment_id = 0 ) {
// ...
$url = '';
@wcxaaa
wcxaaa / docker_mongo_Init.md
Last active March 23, 2020 14:01
Dockerized mongoDB initialization

First create a mongod config file. e.g.

# mongod.conf
# Where and how to store data.
storage:
  dbPath: /data/db
  directoryPerDB: true
  journal:
    enabled: true
@wcxaaa
wcxaaa / docker_mySQL_Init.md
Last active February 22, 2018 03:47
Initializing docker mysql-server container
$ docker run --name mysql-c1 -d -v /workspace/docking:/workspace/docking mysql/mysql-server

Remember to wait for a few seconds and then continue.

$ docker logs mysql-c1 2>&1 | grep GENERATED # On Windows it's "findstr" instead of "grep"
# Copy that password from output: e.g. GENERATED ROOT PASSWORD: Axegh3kAJyDLaRuBemecis&EShOs
$ docker exec -it mysql-c1 mysql -u root -p
@wcxaaa
wcxaaa / divAlign.css
Created December 15, 2017 08:06
CSS - description page div align parent left or right
@media only screen and (min-width: 992px) {
.flex-left {
display: flex;
flex-direction: row;
}
.flex-right {
// usage e.g.: div align right.
// can also replace Bootstrap col-md-push and col-md-pull back in bootstrap 3
display: flex;