Skip to content

Instantly share code, notes, and snippets.

View patrick330602's full-sized avatar

Patrick Wu patrick330602

View GitHub Profile
@LinuxSBC
LinuxSBC / 1password-flatpak-browser-integration.sh
Last active May 13, 2025 14:22
1Password Integration with Flatpak Browsers
#!/bin/bash
set -oue pipefail
INFO='\033[0;36m' # Cyan for general information
SUCCESS='\033[0;32m' # Green for success messages
WARN='\033[0;33m' # Yellow for warnings
ERROR='\033[0;31m' # Red for errors
NC='\033[0m' # No Color
echo "This script will help you set up 1Password in a Flatpak browser."
@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@cerebrate
cerebrate / README.md
Last active February 6, 2025 00:37
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

@sainnhe
sainnhe / lightline-and-tmux-config.md
Last active October 29, 2024 14:35
Sexy & Powerful Configuration for Lightline and Tmux

π‘Ίπ’†π’™π’š & π‘·π’π’˜π’†π’“π’‡π’–π’ π‘ͺπ’π’π’‡π’Šπ’ˆπ’–π’“π’‚π’•π’Šπ’π’ 𝒇𝒐𝒓 π‘³π’Šπ’ˆπ’‰π’•π’π’Šπ’π’† 𝒂𝒏𝒅 π‘»π’Žπ’–π’™

Nerd Font

First of all, install a nerd font, and apply it: nerd font

# Simple and stupid script that locks the computer and starts filming using the webcam if the mouse coursor moves
# Requires ffmpeg to be installed
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
function mousecheck {
while($true)
{
Start-Sleep -m 500 #added delay
$mouseY = ([System.Windows.Forms.Cursor]::Position.Y ) #read the Y coordinates
@matthiassb
matthiassb / dns-sync.sh
Last active August 24, 2024 09:43
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@anthonyeden
anthonyeden / FontInstallation.ps1
Last active February 11, 2025 21:56
Font User Installation - Powershell (No Admin Password Needed)
# Run this as a Computer Startup script to allow installing fonts from C:\InstallFont\
# Based on http://www.edugeek.net/forums/windows-7/123187-installation-fonts-without-admin-rights-2.html
# Run this as a Computer Startup Script in Group Policy
# Full details on my website - https://mediarealm.com.au/articles/windows-font-install-no-password-powershell/
$SourceDir = "C:\InstallFont\"
$Source = "C:\InstallFont\*"
$Destination = (New-Object -ComObject Shell.Application).Namespace(0x14)
$TempFolder = "C:\Windows\Temp\Fonts"
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 10, 2025 14:55
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \