Skip to content

Instantly share code, notes, and snippets.

View mcxiaoke's full-sized avatar

Hello World mcxiaoke

  • Earth
View GitHub Profile
@mcxiaoke
mcxiaoke / ffmpeg-cuda-preset-test.txt
Last active April 25, 2024 09:25
ffmpeg hevc_nvenc cuda preset speed/bitrate/filesize simple test resutls
ffmpeg -hide_banner -n -v error -stats -hwaccel cuda -hwaccel_output_format cuda -i "ptest.mp4" -c:v hevc_nvenc
-cq 26 -c:a libfdk_aac -b:a 72k -preset p1 p1.mp4 35.9x 16s 283m
ffmpeg -hide_banner -n -v error -stats -hwaccel cuda -hwaccel_output_format cuda -i "ptest.mp4" -c:v hevc_nvenc
-cq 26 -c:a libfdk_aac -b:a 72k -preset p2 p2.mp4 27.1x 22s 253m
ffmpeg -hide_banner -n -v error -stats -hwaccel cuda -hwaccel_output_format cuda -i "ptest.mp4" -c:v hevc_nvenc
-cq 26 -c:a libfdk_aac -b:a 72k -preset p3 p3.mp4 25x 24s 248m
ffmpeg -hide_banner -n -v error -stats -hwaccel cuda -hwaccel_output_format cuda -i "ptest.mp4" -c:v hevc_nvenc
@mcxiaoke
mcxiaoke / miui-blotware-apps.md
Last active April 24, 2024 11:33
MIUI 13/14 bloatware apps, updated at 20240816

对于所有应用,不建议直接删除,使用adb shell pm disable-user package-name禁用即可,方便出问题时恢复。

DO NOT UNINSTALL:

  • com.miui.securitycenter
  • com.miui.securityadd
  • com.xiaomi.finddevice

(Don’t uninstall these three apps or services from your Xiaomi device. Otherwise, you may encounter device bricking or bootloop issues.)

@mcxiaoke
mcxiaoke / openwrt-in-docker.md
Created June 7, 2021 10:07
Run OpenWrt in Docker

OpenWrt Docker镜像构建

为了在Docker中运行OpenWrt系统,我们需要用到OpenWrt的docker镜像,网上有很多人分享已经制作好的镜像。但是,每个人都有自己不同的需求,自己学会制作镜像就显得特别重要了。

其实使用OpenWrt的固件, 可以很方便的构建Docker镜像,这里的固件不光是官方固件,也可以是经过自己定制编译生成的固件。

直接使用

@mcxiaoke
mcxiaoke / wine-retina.md
Last active March 24, 2024 14:21
Wine and CrossOver Retine Support on macOS. from http://ielk.blogspot.com/2017/02/wine-20-on-macos-10122.html

Blurry font issue with Wine 2.0 on macOS 10.12.2

After installing the latest Wine release, which currently is 2.0 (I chose the development branch) on XQuartz 2.7.11, I was having problems with blurry text in both winecfg, regedit and other programs launched through Wine. After trying to enable font smoothing and font replacements (source) with only slight changes I found someone trying to solve the same issues (source), albeit compiling everything from scratch which I don't want to do. It turns out that the Retina display on my MacBook Pro was causing the issues with blurry fonts because Wine was not using the "real" resolution, only the reported "lower resolution".

To enable Retina support in Wine open the registry editor via a terminal, preferably through Wine Devel.app installed with Wine:
$ wine regedit

Then find the folder/key:

@mcxiaoke
mcxiaoke / disabled.txt
Created September 1, 2023 06:37
miui 14 packages disabed 20230901
adb shell pm disable-user com.miui.accessibility
adb shell pm disable-user com.miui.daemon
adb shell pm disable-user com.android.carrierdefaultapp
adb shell pm disable-user com.android.traceur
adb shell pm disable-user com.miui.miservice
adb shell pm disable-user com.xiaomi.mi_connect_service
adb shell pm disable-user com.xiaomi.mirror
adb shell pm disable-user com.android.stk
adb shell pm disable-user com.goodix.fingerprint.setting
adb shell pm disable-user com.android.cellbroadcastservice
根据Unicode5.0整理如下:
1)标准CJK文字
http://www.unicode.org/Public/UNIDATA/Unihan.html
2)全角ASCII、全角中英文标点、半宽片假名、半宽平假名、半宽韩文字母:FF00-FFEF
http://www.unicode.org/charts/PDF/UFF00.pdf
3)CJK部首补充:2E80-2EFF
http://www.unicode.org/charts/PDF/U2E80.pdf
@mcxiaoke
mcxiaoke / git-show-big-files.sh
Created January 5, 2018 07:22 — forked from debreczeni/git-show-big-files.sh
Find large files in git repository
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
@mcxiaoke
mcxiaoke / app.swift
Created May 24, 2016 04:13 — forked from lucamarrocco/app.swift
swift osx application without nib
import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {
let app: NSApplication
let controller: NSWindowController
init(app: NSApplication) {
self.app = app
self.controller = NiblessWindowController()
@mcxiaoke
mcxiaoke / index.html
Created July 3, 2014 03:53 — forked from davidwkeith/index.html
detect app installed in browser
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!-- iframe used for attempting to load a custom protocol -->
<iframe style="display:none" height="0" width="0" id="loader"></iframe>
@mcxiaoke
mcxiaoke / linux-and-macos-tips.sh
Last active February 16, 2024 12:23
Linux and Macos Tips
# Disable suspend and hibernation
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
# How to run commands at shutdown on Linux
[Unit]
Description=Run mycommand at shutdown
Requires=network.target
DefaultDependencies=no
Before=shutdown.target reboot.target