Skip to content

Instantly share code, notes, and snippets.

View ttimasdf's full-sized avatar

Known Rabbit ttimasdf

View GitHub Profile
@eric-hu
eric-hu / Open iterm tab here
Last active March 11, 2022 02:45
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder. To use: (1) Open Automator (2) Create a new service (3) Change "Service receives selected" drop downs to "Files or folders" in "Finder" (4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
@alexalouit
alexalouit / openwrt.squid.transparent
Last active April 11, 2022 21:25
OpenWRT Squid transparent configuration
Squid required:
Mount HD (15GB min) on /tmp/cache, chmod -R 777 /tmp/cache
Firewall section:
config redirect
option src 'lan'
option proto 'tcp'
option src_ip '!192.168.1.1'
option src_dport '80'
option dest_ip '192.168.1.1'
@eculver
eculver / protocol-fix.txt
Created March 16, 2015 18:54
How to deal with tmux "protocol version mismatch"
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach
@maraino
maraino / list.sh
Last active May 6, 2022 11:31
Create CRL index.txt
#!/bin/sh
set -e
# prepare copy directory
mkdir -p /crl/db/
# clean leftovers
rm -f /crl/db/*
# make a copy of badger db
# The following is adapted from https://github.com/reswitched/loaders/blob/master/nxo64.py
#
# ===========================================================================================
#
# Copyright 2017 Reswitched Team
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or
# without fee is hereby granted, provided that the above copyright notice and this permission
# notice appear in all copies.
#
@tonymtz
tonymtz / gist:714e73ccb79e21c4fc9c
Created November 15, 2014 00:02
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
@Kutkovsky
Kutkovsky / Catalina_ISO.sh
Created June 26, 2019 10:17
The steps allowing to create macOS 10.15 Catalina VM on vSphere or ESXi
#!/bin/bash
# Steps to create the macOS Catalina (10.15) VM:
# login to developer.apple.com or beta.apple.com to download a tester's profile for your OS. Install it.
# Go to System Preferences > Software Update and start the update process
# When the Catalina Installer (few MBytes) is started, it downloads the remain part of installation.
# After all `Install Catalina Beta.app` should lay in the /Applications folder with approx. 6.5g size
# Proceed with the following script.
set -eux
@derhuerst
derhuerst / awesome-twitter-bots.md
Last active April 7, 2023 17:45
Awesome Twitter Bots
@cdpath
cdpath / wechat.json
Last active May 8, 2023 09:47
使用 Huginn 实现微信公众号全文 RSS
{
"schema_version": 1,
"name": "WeChat",
"description": "微信公众号全文 RSS",
"source_url": false,
"guid": "dd67102f09869c2228f8ed903a32d063",
"tag_fg_color": "#333333",
"tag_bg_color": "#66ff66",
"icon": "leaf",
"exported_at": "2019-01-12T10:56:41Z",
$ git clone -b 1.22 https://github.com/crosstool-ng/crosstool-ng.git
$ cd crosstool-ng
$ ./bootstrap
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ..
$ mkdir ctng
$ cd rpi1
$ ct-ng menuconfig