Skip to content

Instantly share code, notes, and snippets.

View posoo's full-sized avatar
🐝
caffeine fueled

Sen Lin posoo

🐝
caffeine fueled
View GitHub Profile
@posoo
posoo / dpdk-bootstrap.sh
Last active July 30, 2021 05:49
Install DPDK 20.02 on Ubuntu 18.04
#!/bin/bash
# Check architecture and kernel version
if [[ ! $(uname -m) == "x86_64" ]]
then
echo "Only support x86_64 architecture"
exit 1
fi
if [[ ! $(uname -r) =~ ^4.15.* ]]
then
@posoo
posoo / tag_dir_mover.py
Created July 14, 2021 04:57
macOS Finder.app: Move files and directories with specified color tags to the target directory.
import os
import click
import mac_tag
import json
@click.command()
@click.option('--input_dir', type=click.Path(exists=True), required=True)
@click.option('--output_dir', type=click.Path(exists=False), required=True)
@click.option('--tag_color', type=click.Choice(['Green', 'Red', 'Yellow', 'Blue', 'Purple', 'Gray'], case_sensitive=False), required=True)
def main(input_dir, output_dir, tag_color):
@posoo
posoo / tag_union.py
Created July 14, 2021 04:55
macOS Finder.app: Apply the tags of files to their parent directories. (The parent directory has a union of tags of its files)
import os
import click
import mac_tag
import json
@click.command()
@click.option('--root_dir', type=click.Path(exists=True), required=True)
def main(root_dir):
ROOT_DIR_PATH = os.path.abspath(root_dir)
print("ROOT_DIR_PATH:", ROOT_DIR_PATH)
@posoo
posoo / pull-clion-remote-kernel-headers.sh
Last active June 4, 2021 18:12
A workaround for incomplete header synchronization in CLion
#!/bin/bash
# Required arguments
REMOTE_USER=$1
REMOTE_HOST=$2
REMOTE_PORT=$3
LOCAL_CACHE_BASE=$4
ARCH=$5
@posoo
posoo / tag_paster.py
Last active January 5, 2024 00:37
macOS Finder.app: Save and restore tags.
import os
import click
import mac_tag
import json
def scan(root):
os.chdir(root)
print('Working on ', os.getcwd())
paths = []

Keybase proof

I hereby claim:

  • I am posoo on github.
  • I am posoo (https://keybase.io/posoo) on keybase.
  • I have a public key ASCP4z5uNUBRcP5_ndi_B-khCcfQBaIlsFcSyOvc6l_NhQo

To claim this, I am signing this object:

@posoo
posoo / install_csi_tool.sh
Last active April 3, 2021 05:42
Linux 802.11n CSI Tool Installation Shell Script
#!/bin/bash
# Install development tools
sudo apt update
sudo apt install gcc make linux-headers-$(uname -r) git-core
# Build and install the modified wireless driver
CSITOOL_KERNEL_TAG=csitool-$(uname -r | cut -d . -f 1-2)
git clone https://github.com/posoo/linux-80211n-csitool.git --branch ${CSITOOL_KERNEL_TAG} --depth 1
cd linux-80211n-csitool
make -C /lib/modules/$(uname -r)/build M=$(pwd)/drivers/net/wireless/iwlwifi modules
@posoo
posoo / hexo.yml
Created October 22, 2019 18:57
Workflow Configuration to Automatically Deploy Hexo through GitHub Actions
name: Hexo
on:
push:
branches:
- 'source'
jobs:
build:
runs-on: ubuntu-latest