Skip to content

Instantly share code, notes, and snippets.

View i8degrees's full-sized avatar

Jeffrey Carpenter i8degrees

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:
@sankalp-khare
sankalp-khare / git-change-url
Last active October 29, 2022 07:16
Changes the git url type from https to ssh or vice versa
#!/usr/bin/env bash
# Utility to change the connection method for a git repo.
# === Colour Definitions ===
red='\e[0;31m'
green='\e[0;32m'
purple='\e[0;35m'
orange='\e[0;33m'
# No Color, i.e. turn off color
@badp
badp / spam.py
Created November 11, 2010 14:19
Send a message to all users on a system. Depends on the `libnotify-bin` package.
We couldn’t find that file to show.
@i8degrees
i8degrees / notify.py
Created May 1, 2023 08:55
Modern 'wall' command
# Sourced from https://gist.githubusercontent.com/badp/672546/raw/4c6bc7dee6d547d8a7f002ce95c9a66363108f6e/spam.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under MIT license: http://www.opensource.org/licenses/mit-license.php
import os, subprocess, sys
# thanks: Martin-Éric Racine, Roger Pate
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=433960
# http://chat.askubuntu.com/rooms/3/conversation/spam-py
@skylord123
skylord123 / gist:892b6e30b724b81a8a48
Created November 11, 2015 05:38
Linux machine to chromcast server
Following is taken from: https://plus.google.com/111475821387295047208/posts/KDEfS6S2hyk
-------------------------
How to turn your Linux machine into a Chromecast Server
Stream YouTube, Netflix, Hulu, Etc. from your smartphone or tablet onto your server or laptop. ...without buying Chromecast hardware...
Prerequisite- Install Google Chrome on your Desktop. Install Chromecast application onto your portable device.
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@brandt
brandt / README.md
Last active February 3, 2024 01:28
Creates a loopback alias with IP 127.0.0.2 at startup on Mac OS X

Loopback Alias

Creates an alias on the loopback interface (lo0) with the IP 127.0.0.2 on macOS.

Installation

  1. Install the plist to: /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  2. Set mode: sudo chmod 0644 /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  3. Set owner: sudo chown root:wheel /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  4. Load: sudo launchctl load /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
@jthat
jthat / truenas-scale-kernel-upgrade.adoc
Last active February 3, 2024 09:12
Instructions to ad-hoc upgrade the TrueNAS SCALE kernel

Ad-hoc upgrade of TrueNAS SCALE kernel

Warning
This is unsupported and has the potential to corrupt your data. Proceed at your own risk.

Installation

Choose an existing stable kernel branch, e.g. SCALE-v5.15-stable.

@deepak1556
deepak1556 / webp2png.js
Created December 7, 2013 17:30
webp support using libwebpjs (webp->png in canvas)
WebPDecodeAndDraw = function (data) {
var decoder = new WebPDecoder();
var bitmap = decoder.WebPDecode(data, data.length);
if (bitmap) {
//Draw Image
var output = ctx.createImageData(canvas.width, canvas.height);
var biWidth = canvas.width;
var outputData = output.data;
@Th3Whit3Wolf
Th3Whit3Wolf / Arch Secure Laptop Install.md
Last active February 23, 2024 16:00
My install instruction for a secure Arch Linux (sway) laptop workstation

What's Cool

  • Encrypted root partition
    • AES-256 bit cipher
    • Argon2id variant for PBKDF
    • Sha3-512 bit hash
  • rEFInd bootloader
    • With dreary theme
    • Optimal Settings (optimized for aesthetics, and boot time)
  • Boot into backups thanks to refind-btrfs