Skip to content

Instantly share code, notes, and snippets.

@kingtosh
kingtosh / macOS_SytemPrefs.md
Created November 23, 2021 05:23 — forked from rmcdongit/macOS_SytemPrefs.md
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@kingtosh
kingtosh / DoubleTap_left-control_Run_Safari.json
Created November 28, 2021 23:35 — forked from s-show/DoubleTap_left-control_Run_Safari.json
karabiner-elementsの設定(左controlを2回連打したらSafariが立ち上がる)
{
"description": "Double tap 'left_control' to 'open -a 'safari'",
"manipulators": [
{
"type": "basic",
"from": { "key_code": "left_control" },
"to": [
{ "shell_command": "open -a 'safari'" }
],
"conditions": [
@kingtosh
kingtosh / wordRegister.scpt
Created March 14, 2022 08:45 — forked from kuronekomichael/wordRegister.scpt
ことえり単語登録に文字を入力するApple Script -- appleScript, apple script, AppleScript
-- ことえり単語登録(== "WordRegister")
tell application "WordRegister"
activate
end tell
tell application "System Events"
-- 単語の欄にペースト
-- source url
-- http://d.hatena.ne.jp/zariganitosh/20140129/mavericks_kotoeri_mechanism
tell application "System Preferences"
reveal anchor "Text" of pane id "com.apple.preference.keyboard"
activate
end tell
@kingtosh
kingtosh / createramdiskatboot.command
Created April 15, 2022 10:41 — forked from Egregius/createramdiskatboot.command
Use RAM disk for macOS caches and logs
#!/bin/bash
while [ ! -d /Volumes ]
do
echo "waiting..."
sleep 0.5
done
if [ ! -d /Volumes/RamDisk ]; then
echo "creating ramdisk..."
sleep 0.5
diskutil partitionDisk $(hdiutil attach -nomount ram://$((2048*16000))) 1 GPTFormat APFS 'RamDisk' '100%'
@kingtosh
kingtosh / Run Menu Item - Collapse All Groups.jsx
Created April 15, 2022 16:52 — forked from MarshySwamp/Run Menu Item - Collapse All Groups.jsx
Code snippet: Run menu item - Collapse All Groups
/* An example of running a menu item command.
Use Script Listener to find the menu name, often by inserting the menu command into an action */
// Collapse all layer groups/sets
app.runMenuItem(stringIDToTypeID('collapseAllGroupsEvent'));
// another example:
// More info:
csrutil disable
sudo nvram boot-args="intcoproc_unrestricted=1 kext-dev-mode=1 amfi_allow_any_signature=1 amfi_unrestrict_task_for_pid=1 PE_i_can_has_debugger=1 cs_enforcement_disable=1 amfi_get_out_of_my_way=0x1 amfi=0xff"
sudo spctl --master-disable
sudo defaults write /Library/Preferences/com.apple.security.coderequirements Entitlements -string always
sudo defaults write /Library/Preferences/com.apple.security.coderequirements AllowUnsafeDynamicLinking -bool YES
sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool YES
@kingtosh
kingtosh / launchd_memo.md
Created April 26, 2022 08:10 — forked from kozy4324/launchd_memo.md
launchd, launchctlについて(導入編)

launchd, launchctl

man

$ man launchd
$ man launchctl
$ man launchd.plist

$ man plutil

@kingtosh
kingtosh / 0-README.md
Created June 4, 2022 21:41 — forked from mattintosh4/0-README.md
Automator 用シェルクリプト集 その1

Shell script for Automator Part.1

Automator のシェルスクリプトアクションで使えるサンプル集です。「アプリケーション」や「サービス」を作成するときにどうぞ。


入力の種類について

@kingtosh
kingtosh / kensington-trackball.json
Created June 21, 2022 03:02 — forked from matsuoshi/kensington-trackball.json
Karabiner setting, for Kensington Trackball
{
"title": "for Kensington Trackball",
"rules": [
{
"description": "L_btn + R_btn to Button 2",
"manipulators": [
{
"type": "basic",
"from": {
"simultaneous": [