Skip to content

Instantly share code, notes, and snippets.

@florido
florido / defaults.sh
Created Jun 1, 2020 — forked from andrewp-as-is/defaults.sh
🍎 macOS security
View defaults.sh
#!/usr/bin/env bash
# Disable Face Detect in Photos app
defaults write com.apple.iPhoto PKFaceDetectionEnabled 0
defaults write com.apple.gamed Disabled -bool true
defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES # log out, log in
@florido
florido / zmv-examples.md
Created Jan 11, 2020 — forked from niksmac/zmv-examples.md
ZMV-Examples (require autoload zmv)
View zmv-examples.md

rename a section of a filename, i. e. example.1.{txt,conf,db} or 12345.1.{wav,ogg,mp3} and

change the 1 to a 2 in the filename while preserving the rest of it.

$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'

Rename files to lower case

$ zmv '*' '${(L)f}'

serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)

$ autoload zmv

@florido
florido / bisac.csv
Created Dec 1, 2019 — forked from jveldboom/bisac.csv
BISAC codes and values
View bisac.csv
ANT000000 Antiques & Collectibles / General
ANT001000 Antiques & Collectibles / Americana
ANT002000 Antiques & Collectibles / Art
ANT003000 Antiques & Collectibles / Autographs
ANT005000 Antiques & Collectibles / Books
ANT006000 Antiques & Collectibles / Bottles
ANT007000 Antiques & Collectibles / Buttons & Pins
ANT008000 Antiques & Collectibles / Care & Restoration
ANT009000 Antiques & Collectibles / Transportation
ANT010000 Antiques & Collectibles / Clocks & Watches
View gnu_nongnu_homebrew.sh
# See http://pacha.hk/2017-07-15_gnu_nongnu_homebrew.html
# XCode CLT
xcode-select --install
# Update Homebrew and add formulae
brew update
# Check for broken dependencies and/or outdated packages
brew doctor
@florido
florido / showrss.py
Created May 19, 2019 — forked from lyralemos/showrss.py
Downloads torrents from showrss and adds them to transmission; Dependencies: Feedparser and Transmissionrpc
View showrss.py
import os
import feedparser
import transmissionrpc as tm
script_dir = os.path.dirname(__file__)
downloaded_file = os.path.join(script_dir, 'showrss.downloaded')
base_path = '/media/seagate/Video/Series/'
feed_url = 'http://showrss.info/user/448.rss'
feed = feedparser.parse(feed_url)
View gist:763c3b1ca299e4b371e925ef50629f5c
# Admin User
#-------------------------
myd=`date "+%Y-%m-%d-%H-%M-%S"`
# ovverride.plist
#-------------------------
sudo cat /var/db/launchd.db/com.apple.launchd/overrides.plist > ~/$myd-root-ovverrides.txt
sudo lsof -i > ~/$myd-root-lsof.txt
# blued
View 00-first.sh
#!/bin/bash
cname='mycomputername'
nbname='mybiosname'
# path to /Volumes/not-system-root-volumes
#vo=/Volumes/path
#---------------------------------------------------------------------
# Unlod airplay, cupsd, netbiosd
View disable-bluetooth.sh
#!/bin/bash
# disable bluetooth
# OS X 10.8.2
# 2012-10-08
home=$HOME
bk=$home/backup-bluetooth-extentions
mkdir $bk
@florido
florido / Disable facetime HD cameral Mac OS.MD
Created May 1, 2019 — forked from DOSputin/README.MD
Disable facetime HD cameral Mac OS
View Disable facetime HD cameral Mac OS.MD

Turn Off Rootless System Integrity Protection:

$ csrutil disable

Disable Camera:

all commands performaed as sudo

$ chmod a-r /System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC

View AppleScript for user input
#!/bin/bash
/usr/bin/osascript <<EOT
set theResponse to display dialog "What's your code?" default answer "" with icon stop buttons {"Cancel", "Continue"} default button "Continue" with hidden answer
display dialog "My Secret Code is " & (text returned of theResponse) & "."
EOT