Skip to content

Instantly share code, notes, and snippets.

View peeweep's full-sized avatar

jinqiang zhang peeweep

View GitHub Profile
@thesamesam
thesamesam / gentoo-crossdev.md
Last active April 24, 2024 13:01
Gentoo cross compilation instructions (crossdev -> stage3)

Cross instructions

These instructions cover:

  1. building a cross toolchain
  2. populating the new ROOT
  3. making it chrootable using qemu-user to easily run "native" builds or tests (this is like a stage3 at the end)

You do not need to follow through to the end if you don't need a stage3-like root.

Set up the toolchain

@aeghn
aeghn / rofipass
Last active November 2, 2022 15:53
rofipass
#!/usr/bin/env bash
shopt -s nullglob globstar
set -o pipefail
export PASSWORD_STORE_DIR="path/to/password-store"
export EDITOR='vim'
PREV_FILE="$HOME/.cache/rofi-pass-cahce"
@lilydjwg
lilydjwg / gh-check
Last active March 18, 2024 04:43
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
@MineBartekSA
MineBartekSA / catbox
Last active March 18, 2024 21:03
CatBox - An implementation of catbox.moe API in Bash
#!/bin/bash
#
# CatBox v2.0
# An implementation of catbox.moe API in Bash
# Author: MineBartekSA
# Gist: https://gist.github.com/MineBartekSA/1d42d6973ddafb82793fd49b4fb06591
# Change log: https://gist.github.com/MineBartekSA/1d42d6973ddafb82793fd49b4fb06591?permalink_comment_id=4596132#gistcomment-4596132
#
# MIT License
#
@edison23
edison23 / mail_notify.sh
Created June 12, 2015 17:21
Mail notification for maildir maintained by Offlineimap
#!/bin/sh
# WHAT IS THIS SHIT?
# It's a script comprising of shitty regexes that notifies you,
# when there has been a change in you mailbox dir.
# Works best with offlineimap.
# PREREQUISITIES
# Depends on inotify-tools and libnotify
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: