Skip to content

Instantly share code, notes, and snippets.

@YSaxon
YSaxon / cowDedupe.sh
Last active March 29, 2024 20:21
Shell script to deduplicate in a directory with MacOS APFS cow copies using rdfind
#!/bin/zsh
# Optionally use apfs-clonechecker to check for clones before recloning, useful if you are rerunning the script
export do_clone_check=${do_clone_check:-1}
export cleanup=${cleanup:-1}
export verbosity=${verbosity:-3}
export do_extra_checksum_test=${do_extra_checksum_test:-1}
export reuse_existing_results_txt=${reuse_existing_results_txt:-0}
export minsize=${minsize:-4096}
@przemoc
przemoc / youtube-sort-videos-by-length.md
Last active February 26, 2024 16:59
Bookmarklet for YouTube: Sort videos by length in videos tab

Bookmarklet for YouTube: Sort videos by length in videos tab

On channels in videos tab you can sort videos by:

  • Most popular
  • Date added (oldest)
  • Date added (newest)

But you cannot sort by length. So I decided to create a bookmarklet to do it in ascending order.

@vishaltelangre
vishaltelangre / mac_locate_big_files.md
Last active February 22, 2022 00:55
Locate big files on macOS #mdfind #find #bigfiles
$ mdfind 'kMDItemFSSize > 200000000' | sed 's| |\\ |g' | xargs du -sch
#                             ^
#                         ~ 200MiB
@LincDavis
LincDavis / script.command
Last active July 3, 2023 06:05
Diagnostic script
#! /bin/ksh
# This script copyrighted (C) 2014-2018 by Linc Davis. All rights reserved.
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/libexec;IFS=$' \t';LC_ALL=C;TERM=xterm-256color;TMPDIR=`getconf DARWIN_USER_TEMP_DIR`;eval HOME=~$USER;unset BLOCKSIZE COLUMNS DYLD_INSERT_LIBRARIES DYLD_LIBRARY_PATH FIGNORE FPATH HISTFILE LD_LIBRARY_PATH TMOUT;stty -echo;printf $'\e[8;16;55t\e]2;Diagnostic Script \xc2\xa9 2014-2018 Linc Davis\a';osascript -lJavaScript -e ' w=Application("Terminal").windows[0];w.backgroundColor="black";w.normalTextColor="black";w.cursorColor="yellow";w.fontSize=14;';clear;p=(1904 20 51 0.2 8 10 25 9215 1.0 1000 25 1536 400 40 500 300 85 20 2.0 262144 20 2000 524288 604800 5 1024 25 10 10 8 10 $(printf '%.2s' `uname -r`) 1800 `sysctl -n hw.logicalcpu` 16 `id -u` 10 (3360141552 2033013220 174611125 188739418 2052836284 1075906481 3825718575 2300025090 1148937583 998162157 251475945 682956541 927568548 820662417 4241232455 1991908505 3842510280 3977296738 308326518 734968811 2881593577 3505613185 20118
@geoff-nixon
geoff-nixon / osx-software-update-urls.txt
Created September 23, 2015 08:04 — forked from stefanschmidt/osx-software-update-urls.txt
URLs of the index files used by the software update client on OS X
10.3 (Panther):
https://swscan.apple.com/scanningpoints/scanningpointX.xml
10.4 (Tiger):
https://swscan.apple.com/content/catalogs/index.sucatalog
https://swscan.apple.com/content/catalogs/index-1.sucatalog
10.5 (Leopard):
https://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog
@renestalder
renestalder / README.md
Last active April 25, 2024 14:19
Unfollow all on Facebook

Facebook: Unfollow people and pages

See comments section for more up-to-date versions of the script. The original script is from 2014 and will not work as is.

  1. Open news feed preferences on your Facebook menu (browser)
  2. Click people or pages
  3. Scroll down (or click see more) until your full list is loaded
  4. Run the script in your browser console

Facebook will block this feature for you while you use it, depending on how much entities you try to unfollow. It automatically unblocks in a couple of hours and you will be able to continue.

@shayne
shayne / gist:3086902
Created July 10, 2012 23:27
Add Mac OS X user to "wheel" group (no more sudo passwd)
sudo dscl . -append /groups/wheel GroupMembership <username>
# now `sudo visudo` and remove comment from: %wheel ALL=(ALL) NOPASSWD: ALL
@pklaus
pklaus / AlwaysMountRootFSWithNoatime_MacOSX.sh
Created April 20, 2011 15:08
SSD Optimizations of Mac OS X 10.6 Operating System
#!/bin/bash
# +----------------------------------------------------------------------+
# | |
# | Mount the root file system / with the option noatime |
# | |
# | By Philipp Klaus <http://blog.philippklaus.de> |
# | Tip found on <http://blogs.nullvision.com/?p=275> |
# | |
# +----------------------------------------------------------------------+