Skip to content

Instantly share code, notes, and snippets.

@miku
miku / .gitignore
Last active August 23, 2024 09:56
Rotating fds for keeping logs intact after logrotate / golang
go.log
# Copyright 2022 by Jan Philip Wahle, https://jpwahle.com/
# All rights reserved.
import colorcet as cc
import dask_ml.feature_extraction.text
import datashader as ds
import pandas as pd
from datasets import load_dataset
from datashader.utils import export_image
from openTSNE import TSNE
@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 13, 2025 01:37
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@taskylizard
taskylizard / fmhy.md
Last active May 13, 2025 12:06
/r/freemediaheckyeah, in one single file (view raw)
@carmel
carmel / marked-katex.js
Created January 8, 2022 15:35
marked with katex
import { marked } from 'marked'
import hljs from 'highlight.js'
import katex from 'katex'
marked.setOptions({
langPrefix: 'hljs lang-',
pedantic: false,
gfm: true, // 是否启动类似Github样式的Markdown
breaks: false, // 是否支持Github换行符
tables: true, // 是否支持Github形式的表格
@fwarren
fwarren / withsqlite.py
Last active April 25, 2024 19:47
Simple sqlite3 context manager for Python 3 will type annotations
#!/usr/bin/env python
"""Open Sqlite3 databae with context manager"""
from pathlib import Path
from types import TracebackType
from typing import overload, Any, Optional, Union
class dbopen(): # pylint: disable=invalid-name
"""Simple context manager for sqlite3 databases"""
@the-spyke
the-spyke / pipewire.md
Last active May 3, 2025 13:52
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@miku
miku / .gitignore
Last active January 17, 2022 23:30
Lightning talk, Notes on Storage
golangleipzig.cdx
golangleipzig.warc.gz
@bfgits
bfgits / get_china_ip.sh
Last active April 5, 2024 00:01
get china ip
#!/bin/sh
#获取中国IP段
wget -c http://ftp.apnic.net/stats/apnic/delegated-apnic-latest
cat delegated-apnic-latest | awk -F '|' '/CN/&&/ipv4/ {print $4 "/" 32-log($5)/log(2)}' | cat > ./cn_ip_list.conf
# install ipset
apt-get install ipset -y
@klingtnet
klingtnet / rl.go
Last active December 1, 2020 19:22
Read random lines from a file
// inspired by https://github.com/miku/randlines
package main
import (
"errors"
"io"
"log"
"math/rand"
"os"
"strconv"