Skip to content

Instantly share code, notes, and snippets.

@cuu
cuu / .xinitrc
Last active June 11, 2024 14:47
dotxinitrc
##virtual box only
VBoxClient-all &
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export LC_CTYPE=en_US.UTF-8
@cuu
cuu / sync_docker.sh
Created January 30, 2024 04:22
move docker folder to another
#!/bin/bash
rsync -avPHSX /var/lib/docker/ /data/lib/docker/
@cuu
cuu / 24c_read.c
Created November 24, 2022 12:49
24c_read.c
#include "comPro.h"
#include <stdio.h>
#include <string.h>
int main(int argc,char* argv[])
{
int icdev,st,number;
char szVer[128];
int iNode = 0;
char szNode[128];
@cuu
cuu / 24c.c
Last active November 24, 2022 12:48
24c.c
#include "comPro.h"
#include <stdio.h>
#include <string.h>
int main(int argc,char* argv[])
{
int icdev,st,number;
char szVer[128];
int iNode = 0;
char szNode[128];
int ledPin=PA8;
HardwareTimer timer(1);
void setup() {
// put your setup code here, to run once:
pinMode(ledPin,OUTPUT);
digitalWrite(ledPin,LOW);
pinMode(ledPin,PWM);
@cuu
cuu / default.pa
Created August 18, 2022 12:51
devterm a06 /etc/pulse/default.pa
#!/usr/bin/pulseaudio -nF
.fail
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
load-module module-augment-properties
load-module module-switch-on-port-available
.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
@cuu
cuu / gist:92bfa28a9b6de421834e5f9f408a12a4
Created July 22, 2022 04:09
lineage os 19.1 kernel .config for rpi4 cm4
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.10.112 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="real-aarch64-linux-android-gcc (GCC) 4.9.x 20150123 (prerelease)"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=40900
CONFIG_LD_VERSION=227000000
CONFIG_CLANG_VERSION=0
CONFIG_LLD_VERSION=0
@cuu
cuu / resize_devterm_d1_root.sh
Created March 30, 2022 06:23
resize devterm d1 rootfs without reboot
#!/bin/bash
GREEN='\033[1;32m'
NC='\033[0m'
printf "${GREEN}Installing dependencies...${NC}\n"
# Install growpart util
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y install cloud-guest-utils
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
@cuu
cuu / fontdemo.py
Last active July 7, 2020 10:10
create a image contains 256 ascii in specific font, font demo game resource image ,raster
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Needs freetype-py>=1.0
# For more info see:
# http://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python
# The MIT License (MIT)
#
# Copyright (c) 2013 Daniel Bader (http://dbader.org)