Skip to content

Instantly share code, notes, and snippets.

@florido
florido / defaults.sh
Created June 1, 2020 00:23 — forked from andrewp-as-is/defaults.sh
🍎 macOS security
#!/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 January 11, 2020 19:44 — forked from niksmac/zmv-examples.md
ZMV-Examples (require autoload zmv)

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 December 1, 2019 01:19 — forked from jveldboom/bisac.csv
BISAC codes and values
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
# 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 21:27 — forked from lyralemos/showrss.py
Downloads torrents from showrss and adds them to transmission; Dependencies: Feedparser and Transmissionrpc
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)
# 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
#!/bin/bash
cname='mycomputername'
nbname='mybiosname'
# path to /Volumes/not-system-root-volumes
#vo=/Volumes/path
#---------------------------------------------------------------------
# Unlod airplay, cupsd, netbiosd
@florido
florido / disable-bluetooth.sh
Created May 3, 2019 03:06 — forked from midore/disable-bluetooth.sh
disable-bluetooth
#!/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 07:38 — forked from DOSputin/README.MD
Disable facetime HD cameral Mac OS

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

#!/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