Skip to content

Instantly share code, notes, and snippets.

View JiangXL's full-sized avatar
👀
?

H.F. JiangXL

👀
?
View GitHub Profile
@tobikris
tobikris / repair-dualboot-bootloader.sh
Last active April 14, 2024 22:47 — forked from Tamal/set-chroot.sh
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ # http://dadadom.de/2020/04/11/fix-fedora-uefi-boot-with-encrypted-partitions/
$ udiskctl unlock -b /dev/nvme0n1p6 # unlock root luks partition
$ mount /dev/mapper/fedora_fedora-root /mnt # mount root partition
$ mount /dev/mapper/fedora_fedora-var /mnt/var
$ mount /dev/nvme0n1p5 /mnt/boot # mount boot partition
"""
@package
Output: CSV (comma-separated)
Grouped By: Value
Sorted By: Ref
Fields: Comment,Designator,Footprint,LCSC
Outputs the BOM for JLCPCB. Run this AFTER generating your POS file for SMT assembly.
Attempts to find and modify POS header to JLC format in the same output folder.
@karuboniru
karuboniru / podman qq setup
Last active October 10, 2021 01:47
Podman QQ
podman run --name qq \
--device /dev/snd --net=host --ipc=host \ # remove net=host if you don't want this
--device=/dev/dri/card0:/dev/dri/card0 \
--device=/dev/dri/renderD128:/dev/dri/renderD128 \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-v ${XDG_RUNTIME_DIR}/pulse/native:/run/user/0/pulse/native \
-e PULSE_SERVER=unix:/run/user/0/pulse/native \
-v $HOME/containerhome:/root:Z \ # choose a path you like, same for following
-v $HOME/containerhome/TencentFiles:/TencentFiles:Z \
-v $HOME/文档/Fonts:/usr/share/fonts/Windows:Z \ # external fonts, any path in /usr/share/fonts will be fine
@probonopd
probonopd / Wayland.md
Last active May 10, 2024 05:20
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@Tamal
Tamal / set-chroot.sh
Last active April 26, 2024 09:57
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ mount /dev/mapper/fedora_localhost--live-root /mnt # mount root partition
$ cat /mnt/etc/fedora-release
Fedora release 31 (Thirty One)
$ mount /dev/nvme0n1p2 /mnt/boot # mount boot partition
$ mount /dev/nvme0n1p1 /mnt/boot/efi # mount EFI partition
# Note: If you are not able to mount EFI partition ('Input/Output error'),
# You may have to repair ESP file system or format ESP.
@msenol86
msenol86 / PKGBUILD
Last active May 10, 2021 23:12 — forked from springzfx/PKGBUILD
Fix copytoclipboard in deepin-screenshot by using xclip
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>
# Contributor: Mucahit Senol <mucahitsenol86 at gmail dot com>
pkgname=deepin-screenshot
pkgver=5.0.0
pkgrel=1
pkgdesc="Easy-to-use screenshot tool for linuxdeepin desktop environment"
arch=('x86_64')
@jb-alvarado
jb-alvarado / pci-passthrough.md
Last active October 27, 2023 02:16
PCI Passthrough on Fedora 31

PCI Passthrough

Hardware:

  • Mainboard ASUS PRIME Z390-A Z390
  • ASUS Dual-GTX1650-O4G
  • Intel i9 9900
  • 32GB Ram
  • NEC Corporation uPD720200 USB 3.0 Host Controller
  • Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 (1 TB)
@docPhil99
docPhil99 / opencv_qt_label.md
Last active April 13, 2024 15:48
How to display opencv video in pyqt apps

The code for this tutorial is here

Opencv provides are useful, but limited, method of building a GUI. A much more complete system could be acheived using pyqt. The question is, how do we display images. There are quite a few possible routes but perhaps the easiest is to use QLabel since it has a setPixmap function. Below is some code that creates two labels. It then creates a grey pixmap and displays it one of the labels. code: staticLabel1.py

from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtGui import QPixmap, QColor
import sys
@arturo182
arturo182 / bom2grouped_csv_jlcpcb.xsl
Last active April 24, 2024 16:08
A KiCad BOM script for generating JLCPCB PCBA-compatible files!
<!--XSL style sheet to convert EESCHEMA XML Partlist Format to grouped CSV BOM Format
Copyright (C) 2014, Wolf Walter.
Copyright (C) 2013, Stefan Helmert.
Copyright (C) 2018, Kicad developers.
Copyright (C) 2019, arturo182.
GPL v2.
Functionality:
Generation of JLCPCB PCBA compatible BOM
@antronic
antronic / iphone-usb_tethering-to-rpi.md
Last active January 30, 2024 07:06
iPhone USB Tethering to RPi

iPhone Tethering to Raspberry Pi

Instruction

On RPi

  • sudo apt-get install usbmuxd
  • connect iPhone

On iPhone

  • Trust