Skip to content

Instantly share code, notes, and snippets.

View fijimunkii's full-sized avatar
🦁
𐂃͠

Harrison Powers fijimunkii

🦁
𐂃͠
View GitHub Profile
@fijimunkii
fijimunkii / brew-unlink_relink.sh
Created April 11, 2014 21:05
brew: unlink and re-link all formulas and kegs
@fijimunkii
fijimunkii / ua.json
Last active November 24, 2023 17:53
Top 10 Most Common User Agents
[
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KH
@fijimunkii
fijimunkii / github_cleanup_disabled_workflows.sh
Created February 14, 2023 19:20
delete github actions runs for disabled workflows
#!/bin/sh
# delete github actions runs for disabled workflows
repo="$1"
for workflow_id in $(gh api /repos/$repo/actions/workflows | jq -r '.workflows[] | select(.state == "disabled_manually") | .id'); do
for run_id in $(gh api /repos/$repo/actions/workflows/$workflow_id/runs | jq -r '.workflow_runs[].id'); do
gh api /repos/$repo/actions/runs/$run_id -X DELETE
sleep 1 # to avoid rate limit
done
done
@fijimunkii
fijimunkii / rbenv_uninstall_gems.sh
Last active October 17, 2022 17:44 — forked from IanVaughan/uninstall_gems.sh
rbenv: uninstall all gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
@fijimunkii
fijimunkii / log-image.js
Created October 18, 2014 03:18
console.log a gif (from cssconf.eu)
console.log("%c+","font-size: 1px; padding: 180px 320px; line-height: 360px; background: url(http://i.imgur.com/kZfvHRV.gif); background-size: 640px 360px; color: transparent;");
@fijimunkii
fijimunkii / gpd_pocket_3.md
Last active April 14, 2022 21:31
GPD Pocket 3 setup

prep xubuntu image with https://github.com/fijimunkii/umpc-ubuntu

add the following to /usr/share/X11/xorg.conf.d/20-intel.conf

# fix screen flickering
Section "Device"

Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "sna"
@fijimunkii
fijimunkii / elasticdump_all_indices.sh
Created December 2, 2016 23:30
elasticdump all indices
INPUT=$1
DEST=$2
indices=$(curl -s -XGET $INPUT/_cat/indices?h=i)
for INDEX in $indices
do
elasticdump --input=$INPUT/$INDEX --output=$DEST/$INDEX --type=data
done
@fijimunkii
fijimunkii / gui-docker.md
Created July 26, 2019 20:01 — forked from rizky/gui-docker.md
Running Graphical applications in Docker for Mac

Setup

Docker for Mac lets you run any Linux executable in an isolated process on Mac. A graphical app is just another process, that needs access to the X11 socket of the system, or an X11 server. You can run X11 applications on a Mac using an open source project called Xquartz. The steps to expose XQuartz to a Linux process running in Docker are simple:

  1. install XQuartz from xquartz.org. Note: you need to install XQuartz version 2.7.10, version 2.7.11 does not work with Docker for Mac. Then you have 3 choices:
  2. Proxy the XQuartz socket to port 6000 or
  3. Tell Xquartz to accept network calls. This is not very secure.
  4. Tell Xquartz to accept network calls and require authentication, setup X11 security using xauth, and mount ~/.Xauthority in the container.
@fijimunkii
fijimunkii / max_expiry_cert.sh
Created October 6, 2017 17:17
max expiry / validity period for an x509 certificate
# https://groups.google.com/forum/#!topic/mailing.openssl.users/3kK_f0ywCZQ
openssl req -new -x509 -days 24855 -key ca.key -out ca.crt
@fijimunkii
fijimunkii / gist-patch.js
Created June 5, 2019 14:25
Update a gist with node core
const data = JSON.stringify({a:1,b:2,c:3},null,2);
const GIST_ID = 'axdl090asdfojal3rwaf';
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
return new Promise((resolve, reject) => {
const postData = JSON.stringify({files:{"ua.json":{content:data}}});
const options = {
hostname: 'api.github.com',
port: 443,
path: `/gists/${GIST_ID}`,