Skip to content

Instantly share code, notes, and snippets.

View SilverRainZ's full-sized avatar

Shengyu Zhang SilverRainZ

View GitHub Profile
@fsantand
fsantand / wireplumber_audio_switcher.py
Created February 8, 2024 23:49
Wireplumber switcher for rofi/dmenu
#!/usr/bin/python3
import sys
import subprocess
"""
Wireplumber sink/source switcher
It lets you pass your sinks/sources into a dmenu dropdown
for ease of access
@catchdave
catchdave / replace_synology_ssl_certs.sh
Last active July 8, 2024 15:30
CLI script to programmatically replace SSL certs on Synology NAS
#!/bin/bash
#
# *** For DSM v7.x ***
#
# How to use this script:
# 1. Get your 3 PEM files ready to copy over from your local machine/update server (privkey.pem, fullchain.pem, cert.pem)
# and put into a directory (this will be $CERT_DIRECTORY).
# Personally, I use this script (https://gist.github.com/catchdave/3f6f412bbf0f0cec32469fb0c9747295) to automate steps 1 & 4.
# 2. Ensure you have a user setup on synology that has ssh access (and ssh access is setup).
# This user will need to be able to sudo as root (i.e. add this line to sudoers, <USER> is the user you create):
@ruanbekker
ruanbekker / tree_style_tab_firefox.md
Created November 28, 2019 06:18
Hide Native Tabs with Tree Style Tabs for Firefox
@bbqtd
bbqtd / macos-tmux-256color.md
Last active July 16, 2024 21:16
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active July 19, 2024 17:36
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active July 22, 2024 17:46
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@yougg
yougg / proxy.md
Last active July 17, 2024 09:23
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@cpba
cpba / im.srain.Srain.json
Last active February 22, 2018 15:52
flatpak manifest for Srain
{
"app-id": "im.srain.Srain",
"runtime": "org.gnome.Platform",
"runtime-version": "3.26",
"sdk": "org.gnome.Sdk",
"command": "srain",
"rename-desktop-file": "Srain.desktop",
"rename-icon": "srain",
"finish-args": [
"--device=all",
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active July 12, 2024 19:23
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@ZWindL
ZWindL / .color_coded
Created December 13, 2016 03:27
Srain's color coded config file
-fcolor-diagnostics
-isystem/usr/include/c++/6.2.1/
-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/include
-I./inc
-pthread
-I/usr/include/gtk-3.0
-I/usr/include/at-spi2-atk/2.0
-I/usr/include/at-spi-2.0
-I/usr/include/dbus-1.0
-I/usr/lib/dbus-1.0/include