Skip to content

Instantly share code, notes, and snippets.

# 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
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@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

@florido
florido / DevonThink Search operators
Last active November 16, 2023 10:41 — forked from keicoder/snippet.txt
DevonThink Search operators
DevonThink Search operators
In the toolbar search field, as well as in both the interactive and the simple web interface, you can use standard and extended Boolean operators, parenthesis, and more to fine tune your search.
The syntax of the operators is compatible to DEVONagent and EasyFind, the Finder, Spotlight, common search engines as well as common programming languages such as C, C++, Objective-C, Java, and JavaScript. The complexity of the query is unlimited.
Case
All terms are case-insensitive. You may, if you wish, use capitalization for proper names in a query, but DEVONthink Pro Office will ignore case in interpreting the query.
md copy
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('Markdown%20Copy','['+document.title+']('+location+')\n\n>'+s)})();void(0)
md link
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('Markdown%20Link','['+s+']('+location+')')})();void(0)
md ref link
@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 / drafts.js
Created October 12, 2018 03:09 — forked from billygoat/drafts.js
Drafts Bookmarklet
javascript:(function(){
var w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";
tmplt="Title: "+pageTitle+"\nLink: "+pageUri+"\n\n";
if(pageSelectedTxt!="") {
pageSelectedTxt=">%20"+pageSelectedTxt;
pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n");
pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20");
}
w.location.href="drafts://x-callback-url/create/?text="+encodeURIComponent(tmplt+pageSelectedTxt);
})();
@florido
florido / .zsh_plugins.txt
Created January 14, 2019 14:40
ZSH setup and plugins I use with http://getantibody.github.io/
# Bundles from the default repo (robbyrussell's oh-my-zsh).
robbyrussell/oh-my-zsh folder:plugins/git
robbyrussell/oh-my-zsh folder:plugins/github
robbyrussell/oh-my-zsh folder:plugins/heroku
robbyrussell/oh-my-zsh folder:plugins/lein
robbyrussell/oh-my-zsh folder:plugins/command-not-found
# robbyrussell/oh-my-zsh folder:plugins/common-aliases
robbyrussell/oh-my-zsh folder:plugins/autojump
robbyrussell/oh-my-zsh folder:plugins/compleat
@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