Skip to content

Instantly share code, notes, and snippets.

View Chenx221's full-sized avatar
🏠
Working from home

Chenx221 Chenx221

🏠
Working from home
View GitHub Profile
@Chenx221
Chenx221 / config.json
Last active September 8, 2024 06:50
Self-use sing-box config
{
"log": {
"disabled": false,
"level": "info",
"timestamp": true
},
"experimental": {
"clash_api": {
"external_controller": "127.0.0.1:9090",
"external_ui": "metacubexd",
@Chenx221
Chenx221 / config.yaml
Last active September 1, 2024 04:06
Self-use Clash configuration file
mixed-port: 7890 # HTTP(S) 和 SOCKS 代理混合端口
allow-lan: true # 允许局域网连接
external-controller: 0.0.0.0:9090
geodata-mode: true
geo-auto-update: true # 是否自动更新 geodata
geo-update-interval: 24 # 更新间隔,单位:小时
geox-url:
geoip: "https://git.chenx221.cyou/chenx221/v2ray-rules-dat/raw/branch/release/geoip.dat"
geosite: "https://git.chenx221.cyou/chenx221/v2ray-rules-dat/raw/branch/release/geosite.dat"
@Chenx221
Chenx221 / PublicKeyCredentialSourceRepository.php
Created March 17, 2024 09:22
Yii2, Webauthn Framework (Part 4)
<?php
namespace app\models;
use JsonException;
use Webauthn\PublicKeyCredentialSource;
use Yii;
use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
@Chenx221
Chenx221 / WebauthnInfo.php
Created March 17, 2024 09:19
Yii2, Webauthn Framework (Part 3)
<h5>
<i class="fa-solid fa-key"></i>
Webauthn
</h5>
<div class="input-group" id="totp_area">
<input type="text" class="form-control" placeholder="New Name" aria-label="New Name" name="fido_name"
id="fido_name">
<?= Html::button('Add', ['id' => "webauthn_add", 'type' => 'button', 'class' => 'btn btn-primary btn-sm']) ?>
<?= Html::button('Verify', ['id' => "webauthn_verify", 'type' => 'button', 'class' => 'btn btn-primary btn-sm']) ?>
</div>
@Chenx221
Chenx221 / Webauthn.js
Created March 17, 2024 09:15
Yii2, Webauthn Framework (Part 2)
const { startRegistration } = SimpleWebAuthnBrowser;
const elemBegin = document.getElementById('webauthn_add');
const elemSuccess = document.getElementById('webauthn_success');
const elemError = document.getElementById('webauthn_error');
elemBegin.addEventListener('click', async () => {
elemSuccess.innerHTML = '';
elemError.innerHTML = '';
elemSuccess.parentElement.hidden = true;
elemError.parentElement.hidden = true;
@Chenx221
Chenx221 / WebauthnController.php
Created March 17, 2024 09:11
Yii2, Webauthn Framework (Part 1)
public function actionCreateCredentialOptions(): Response
{
$id = Yii::$app->params['domain'];
$user = Yii::$app->user->identity;
$rpEntity = PublicKeyCredentialRpEntity::create(
'NetDisk Application',
$id
);
$userEntity = PublicKeyCredentialUserEntity::create(
$user->username,
@Chenx221
Chenx221 / hosts
Last active September 7, 2023 02:25
Adobe Hosts
127.0.0.1 ij0gdyrfka.adobe.io
127.0.0.1 23ynjitwt5.adobe.io
@Chenx221
Chenx221 / recovery.json, cloudready_recovery.json
Last active October 30, 2023 17:55
Chrome OS recovery images manual download (Flex)
# Chrome OS recovery images manual download
https://dl.google.com/dl/edgedl/chromeos/recovery/recovery2.json
https://dl.google.com/dl/edgedl/chromeos/recovery/recovery.json
# Google Chrome OS Flex images manual download
https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery2.json
https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery.json