Skip to content

Instantly share code, notes, and snippets.

View jameswhite's full-sized avatar
📁
copying files

James S White jameswhite

📁
copying files
View GitHub Profile
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
@jameswhite
jameswhite / README.txt
Created July 1, 2023 14:54 — forked from mariotaku/README.txt
Twitter reverse proxy configuration for Nginx
Settings on Twidere:
API URL Format: https://your-host/[DOMAIN.]twitter.com/
Uncheck "Same OAuth signing URL"
Uncheck "No verion suffix"
Password login recommended.
@jameswhite
jameswhite / README.MD
Created January 23, 2021 18:01 — forked from lmarkus/README.MD
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...

@jameswhite
jameswhite / gist:ccd2b08395da5f881d43e0fccee28e92
Created May 14, 2020 14:58 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@jameswhite
jameswhite / diskripper.sh
Created March 21, 2020 04:15 — forked from tacofumi/diskripper.sh
This script rips DVD/Blu-ray using makemkvcon. Use udev to invoke this script to auto-rip when disk is inserted. Some variables such as length of string to trim in order to get the title of movie may vary depending on your environment.
#!/bin/bash
{
echo $(date)
echo ">>>Disk found"
echo ">>>Setting the title..."
title=$(makemkvcon -r info)
title=`echo "$title" | grep "DRV:0\+"`
title=${title:53}
@jameswhite
jameswhite / LICENSE
Created January 31, 2020 18:14 — forked from brianbruggeman/LICENSE
Convert Viscosity to Open VPN
Public Domain
@jameswhite
jameswhite / rbvmomi_example1.rb
Created November 17, 2019 17:38 — forked from rubiojr/rbvmomi_example1.rb
Ruby VMWare VSphere API Example 1 (rbvmomi)
require 'rubygems'
require 'rbvmomi'
require 'pp'
require 'alchemist'
hyper = 'thunder03'
vim = RbVmomi::VIM.connect :host => hyper, :user => 'root', :password => 'secret', :insecure => true
#
# get current time