Skip to content

Instantly share code, notes, and snippets.

View Tonyliu2ca's full-sized avatar

ApplePi(苹果派) T.S.L Tonyliu2ca

View GitHub Profile
@zqhong
zqhong / find-exec-ffmpeg.sh
Last active June 24, 2021 05:42
ffmpeg 批量对 find 匹配后的视频文件进行处理
#!/bin/bash
: '
用法:
find-exec-ffmpeg path file_ext
例子:
find-exec-ffmpeg /home/ mp4:【转换 /home 目录下的 mp4 视频文件】
说明:
@talkingmoose
talkingmoose / Manage App Notifications.bash
Last active January 25, 2024 15:26
macOS Catalina will prompt users to allow Notifications from each app that makes a request. Administrators can manage these prompts using a Configuration Profile. If running Jamf Pro 10.19 or later, I suggest instead using this manifest: https://github.com/talkingmoose/jamf-manifests/blob/master/macOS%20Notifications%20(com.apple.notificationset…
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/9faf50deaaefafa9a147e48ba39bb4b0
@pudquick
pudquick / archiveorg_mame.py
Last active August 2, 2016 12:41
Download individual MAME ROMs from archive.org MAME reference sets via python over HTTP/S without downloading the entire set
import posixpath, urlparse, urllib2, re, ast, struct, cmd, os, os.path
import xml.etree.ElementTree as ET
def discover_roms(rom_url):
# step 1: based on the URL, download the _files.xml for the details
# I could do this a lot easier, but this is more fun
url_parts = urlparse.urlsplit(rom_url)
base_path, page_path = posixpath.split(url_parts.path)
files_path = posixpath.join(url_parts.path, page_path + '_files.xml')
new_parts = url_parts._replace(path=files_path)
#!/usr/bin/python
import os
import subprocess
import sqlite3
desktop_picture_path = '/Library/Desktop Pictures/Wave.jpg'
database_location = os.path.expanduser(
'~/Library/Application Support/Dock/desktoppicture.db')
@return1
return1 / trim_enabler.txt
Last active August 25, 2023 02:59
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 14, 2024 18:00
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@dayglojesus
dayglojesus / patchhomedirmech.rb
Created May 8, 2012 14:41
Patch Lion HomeDirMechanism Format Strings with Null Bytes and Purge Security Logs
#!/usr/bin/ruby
# This code comes with no guarantees and it is not a "fix", just a workaround.
# It would be trivial to replace the patched file and restore these debugging messages.
# Also, this script modifies a Mac OS X System file, so...
require 'etc'
require 'fileutils'
require 'syslog'
@log = Syslog.open('patchhomedirmech')
@garethrees
garethrees / hack.sh
Last active December 30, 2018 18:49 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2470157/hack.sh | sh
#
@MatthewEppelsheimer
MatthewEppelsheimer / hack.sh
Created March 31, 2012 23:00 — forked from erikh/hack.sh
OSX Settings
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2269385/a714e0e69ba99936f914ade0083709dcca6f8438/hack.sh | sh
#