Skip to content

Instantly share code, notes, and snippets.

@victorouse
victorouse / So Fresh So Clean So Mac (Munki).md
Last active November 4, 2019 00:17
So Fresh So Clean So Mac (Munki).md
anonymous
anonymous / mp4.sh
Created November 28, 2016 06:56
Merge multiple mp4 files as chapters
#! /usr/bin/env bash
####################################################
# Required Libraries
#
# library name | commands used | verified version
# ------------------------------------------------
# ffmpeg | ffmpeg/ffprobe | 3.1.4 3.2
# gpac | mp4box | 0.6.1
# mp4v2 | mp4chaps | 2.0.0
@alexeagle
alexeagle / titleUrlMarkdownClip.js
Last active August 3, 2023 19:13 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@cmbaughman
cmbaughman / how_to_irc.md
Last active March 20, 2025 06:16
IRC How To AnonOps

Introduction

Now onto actually using IRC. A lot of this stuff is just extra info. You don't need to know it. We don't need to know it. We just love typing out this crap. You are smart, you already know all this. No need to read it. OK now that was sarcasm. IRC is full of it so get used to it. You really do need to know this stuff. If you thought it was rude of me to be sarcastic, you wont survive on IRC very long.

Getting started

First up, pick a nick. A nickname, commonly referred to as 'nick', is your IRC name. Yours will appear before all of your messages in IRC to identify who is talking. If another user types your nick, the text is printed in red. This is a highlight. Some clients also will flash the window, send a beep, etc. You can select almost any nickname you like, provided nobody else uses it. If you choose a nick like 'justinbieber' or 'Ims0l33t4ndc00l', prepare to be ridiculed. Seriously. The [ ] in the command indicate where to place your own choices. Do not include the [ ] themselves.

@b-
b- / _deepsleep.sh.md
Last active September 4, 2018 03:38
Hibernate macOS computer

deepsleep.sh: hibernate macOS computer

There is no easy way to hibernate a macOS computer on demand. This utility fixes that problem. This command must be run as root, but there's an easy way to fix that:

  • Copy deepsleep.sh to a folder, such as /usr/bin (In Terminal, type cp /PATH/TO/deepsleep.sh /usr/bin)
  • In Terminal, type: sudo visudo to edit the /etc/sudoers file. DO NOT edit this file with another command. If you do not like vi you can type export VISUAL=nano first to tell visudo to use nano
  • Add a line anywhere in the file (I recommend either the very beginning or very end) that says ALL ALL=NOPASSWD:/LOCATION/TO/deepsleep.sh (so, for example, ALL ALL=NOPASSWD:/usr/bin/deepsleep.sh)
  • Run the command using sudo /path/to/deepsleep.sh

WARNING:

If you wake the computer before it's finished hibernating, this script will leave it in a bad spot where it will hibernate every time you tell it to go to sleep. To fix this, type sudo pmset -a hibernatemode 3 or `sudo path/to/deeps

@RichardForrester
RichardForrester / init.lua
Last active September 26, 2018 01:06
Karabiner Elements and Hammerspoon on MacOS Sierra
-- ln -s ~/repos/config/init.lua ~/.hammerspoon/init.lua
-- Global variable for the Command Mode
cMode = hs.hotkey.modal.new({}, "F17")
-- Global variable for Delete Mode
dMode = hs.hotkey.modal.new({}, 'F20')
-- Global variable for Select Mode
sMode = hs.hotkey.modal.new({}, 'F19')
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@mitcdh
mitcdh / Remove URL.applescript
Last active April 3, 2017 00:42
Removes URLs from the selected Devonthink record
tell application id "DNtp"
try
set this_selection to the selection
set this_count to count of this_selection
if this_count > 0 then
show progress indicator "Removing URL" steps this_count
repeat with this_item in this_selection
set the URL of this_item to ""
end repeat
hide progress indicator
@anthonywu
anthonywu / icloud_password_restore.sh
Created November 1, 2016 18:25
icloud_password_restore.sh
# if the iCloud password option is disabled, you'll not see your iCloud login with this result
dscl . read /Users/your_username | grep AuthenticationAuthority
# use this command to add your icloud password as an auth authority again
sudo dscl . append /Users/your_username AuthenticationAuthority ";AppleID;[email protected]"
# confirm the previous command
dscl . read /Users/your_username | grep AuthenticationAuthority