Skip to content

Instantly share code, notes, and snippets.

View CFM880's full-sized avatar
🎉
Focusing

Cheng Fangming CFM880

🎉
Focusing
View GitHub Profile
@CFM880
CFM880 / NVIDIA_RUN_install.md
Last active December 31, 2024 11:32
NVIDIA run file install
sudo apt remove --purge *nvidia*
sudo apt autoremove
sudo apt install pkg-config libglvnd-dev dkms build-essential libegl-dev libegl1 libgl-dev libgl1 libgles-dev libgles1 libglvnd-core-dev libglx-dev libopengl-dev gcc make
sudo apt install dkms
sudo apt remove libnvidia-egl-wayland1
sudo vim /etc/modprobe.d/nvidia-install-disable-nouveau.conf

nvidia-install-disable-nouveau.conf

  1. 提示缺少 libncurses.so.5,找到对于的库,建立软链接
find / -name libncurses.so
/usr/lib/x86_64-linux-gnu/libncurses.so

cd /usr/lib/x86_64-linux-gnu/

ls -al libncurses*
sudo ln -s libncurses.so.6.4 libncurses.so.5
sudo ln -s libncurses.so.6.4 libtinfo.so.5
@CFM880
CFM880 / Dockerfile
Last active December 18, 2024 09:34
Qt build
FROM ubuntu:latest
RUN apt update && apt install -y locales && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG=en_US.utf8
RUN apt upgrade -y
RUN apt install -y \
libfontconfig1-dev \
libfreetype-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-cursor-dev \
@CFM880
CFM880 / Ubuntu no permissions.md
Last active October 10, 2023 09:01
no permissions (missing udev rules)?
cfm880@cfm880:~$ adb devices
List of devices attached
93CY18K0U	no permissions (missing udev rules? user is in the plugdev group); see [http://developer.android.com/tools/device.html]

cfm880@cfm880:~$ lsusb
Bus 002 Device 002: ID 18d1:4ee7 Google Inc. Nexus/Pixel Device (charging + debug)
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 0e0f:0008 VMware, Inc. Virtual Bluetooth Adapter
Bus 001 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
@CFM880
CFM880 / android9.patch
Last active April 19, 2023 14:57
Android AOSP 9
project art/
diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc
index b9d51c1125..f034a3db4f 100644
--- a/runtime/mem_map.cc
+++ b/runtime/mem_map.cc
@@ -504,6 +504,11 @@ MemMap* MemMap::MapFileAtAddress(uint8_t* expected_ptr,
DCHECK(ContainedWithinExistingMap(expected_ptr, byte_count, error_msg))
<< ((error_msg != nullptr) ? *error_msg : std::string());
flags |= MAP_FIXED;
@CFM880
CFM880 / aosp.patch
Last active December 13, 2024 02:39
AOSP检测隐私政策patch
project frameworks/base/
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index db5dcc5c264b..404db6dfaf64 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -741,6 +741,7 @@ public class Activity extends ContextThemeWrapper
OnCreateContextMenuListener, ComponentCallbacks2,
Window.OnWindowDismissedCallback,
AutofillManager.AutofillClient, ContentCaptureManager.ContentCaptureClient {
@CFM880
CFM880 / java_download.sh
Created January 29, 2023 12:49 — forked from wavezhang/java_download.sh
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@CFM880
CFM880 / conv.sh
Last active December 3, 2019 11:50
批量GB2312转UTF-8
#!/bin/bash
function gbk2utf(){
file="$1"
echo "处理文件 '$file' ..."
iconv -f gb2312 -t UTF-8 -c "$file" > tmp
mv -f tmp "$file"
}
function getdir(){
for element in `ls $1`
@CFM880
CFM880 / 01reset_code.sh
Created July 6, 2019 12:18
teamcity Android build shell
#!/usr/bin/env bash
git_hash=kkkk
if [ -z $git_hash ];
then
echo "$i 是空字符串"
else
git reset --hard ${git_hash}
fi
@CFM880
CFM880 / adb_options.sh
Last active May 21, 2019 06:03
根据id对应的视频文件下载对应的视频文件保存为id.mp4,同时生成局域网流媒体对应的json配置
#!/usr/bin/env bash
devices_info=`adb devices`
echo $devices_info
devices_info=`echo ${devices_info} | sed 's/^List of devices attached//'`
devices_info=(${devices_info})
device_names=""
for(( i=0;i<${#devices_info[@]};i++));
do
if [ $((i%2)) == 0 ]; then
device_names=${device_names}" "${devices_info[i]}