Skip to content

Instantly share code, notes, and snippets.

View yingshaoxo's full-sized avatar
🧠
Work in a health way.

yingshaoxo yingshaoxo

🧠
Work in a health way.
View GitHub Profile
@yingshaoxo
yingshaoxo / linux_usb_midi_driver.py
Created March 20, 2024 06:56
linux usb midi driver 1.0 for python
# Author: yingshaoxo
# Python: 3.5
# midi usb protocol: 1.0 ; There has no need to upgrade to 2.0
device_name = "/dev/midi1" # "/dev/dmmidi1" # "/dev/snd/midiC1D0"
while True:
with open(device_name, "rb") as f:
bytes_list = [None] * 3
for index in range(3):
@yingshaoxo
yingshaoxo / midi_usb_driver.c
Created March 20, 2024 06:55
Linux MIDI input driver, protocol 1.0
// Linux MIDI input driver, protocol 1.0, there is no need to upgrade to protocol 2.0
// Author: yingshaoxo
// Run it in root shell
// gcc main.c -o main.run
// ./main.run
#include <sys/soundcard.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
@yingshaoxo
yingshaoxo / Evil Percentage for a Company.md
Created December 19, 2023 23:54
By using this standard you could get the evil point of a company.

Evil Percentage for a Company

You should finish the following table and get a yes/all percentage.

1. Take away user's power

Take away user's freedom of information sending or receiving (freedom of speech), has a strong censorship system that almost blocks anything that useful and has_high_intelligence inside.

Hide lower level knowledge from user, so the more user use their service, the more likely the user become an idiot. So user will never be able to live without that company.

Take away the root permission from user, so the user can't do anything that really useful in software or hardware level. So the company can do whatever they like in user's device or system.

@yingshaoxo
yingshaoxo / zbook_studio_g8_nvidia_ubuntu_tensorflow_installation_tutorial.md
Created April 21, 2023 22:59
How to install Nvidia Driver and Tensorflow/Pytorch GPU version in Ubuntu/PopOS 22.04 at HP Zbook Studio G8 laptop

1. Upgrade HP bios

You could directly use online bios update to update your bios fireware.


Reboot -> F2 -> Esc -> Set up WiFi -> reboot -> F10 -> update bios in a online way

@yingshaoxo
yingshaoxo / bash_minimum_example.sh
Last active December 12, 2022 23:26
variable, function, for loop, if else
#!/bin/bash
function hi() {
#no matter what get print out, it will get returned
author=$1
echo "${author}: \n"
echo "hi,\n";
echo "you";
}
@yingshaoxo
yingshaoxo / curses_example.py
Created December 12, 2022 01:51
minimum example for intereacting with terminal in Python
import curses
from typing import Any
try:
curses._CursesWindow
except Exception as e:
curses._CursesWindow = Any
IN = False
@yingshaoxo
yingshaoxo / set_up_raspberry_pi.md
Created March 2, 2019 20:01
Let's rock the Raspberry Pi

1. set wifi

sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
@yingshaoxo
yingshaoxo / linux_screen_text_translator.md
Created March 2, 2019 19:53
Linux Screen Text Translator

vim mode and jupyter mode

i or enter: go to vim mode

shift + esc: go back to jupyter mode

vim mode

i: start writing