Skip to content

Instantly share code, notes, and snippets.

@karawitan
karawitan / audio-hijack-close-missing-audio-device-popup.md
Last active June 18, 2025 14:47
macosx audio hijack script to acknoledge "missing audio device" popup

Macosx: Audio Hijack script to acknowledge "missing audio device" popup

To programmatically acknowledge or handle a "missing audio device" popup in macOS when using Audio Hijack, you can use AppleScript or a shell script to automate certain responses, though there are limitations depending on the nature and context of the popup.

osascript -e 'tell application "System Events"' -e 'tell process "Audio Hijack"' -e 'try' -e 'click button 1 of (first window whose subrole is "AXDialog")' -e 'end try' -e 'end tell' -e 'end tell'

You may Save this as a .scpt file and run it with Script Editor or osascript from Terminal.

@satyaog
satyaog / cleanup_test.sh
Last active January 8, 2020 13:04
git-annex_test_hardlinks
#!/bin/bash
datalad remove *
cd .annex-cache/
git-annex uninit
cd ..
rm -rf .annex-cache/
@desaiuditd
desaiuditd / git-squash.md
Last active August 20, 2021 10:31
Git Squash Commits and Change Timestamp

Let's say, 5 commits are made in develop branch.

  • Commit 4 => 2017/06/23
  • Commit 3 => 2017/06/22
  • Commit 2 => 2017/06/21
  • Commit 1 => 2017/06/20

Now we want to squash these commits into one commit (i.e., the latest commit on 2017/06/23).

git rebase -i HEAD~4

@AdrianKoshka
AdrianKoshka / make_ipxe_uefi_usb.md
Last active June 21, 2025 03:12
Making a UEFI bootable iPXE USB drive

Making a UEFI bootable iPXE USB drive

Build the UEFI executable for iPXE

# First we'll clone iPXE
$ git clone git://git.ipxe.org/ipxe.git
# Go into the src directory of the cloned git repo
$ cd ipxe/src
# Compile the UEFI iPXE executable
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active May 11, 2024 17:43
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@Paxa
Paxa / _wget.md
Last active April 1, 2020 04:25
Cross-compiling wget for blackberry 10 (QNX)

How to compile wget for blackberry 10

Prepare

  1. Download from here http://ftp.gnu.org/gnu/wget/
  2. Extract sources archive, (using extract for example)
  3. Or run tar xf wget-1.15.tar.xz
  4. Copy file bb10_compile from this gist to source folder

Compile

@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@mnewt
mnewt / print_dom_tree1.js
Created December 18, 2012 20:12
print dom tree
<SCRIPT LANGUAGE="JavaScript">
<!--
// F. Permadi 2005.
// (C) F. Permadi
// Print DOM tree
////////////////////////////////////////////
// This function traverses the DOM tree of an element and prints the tree.
// This function called recursively until the DOM tree is fully traversed.
//
// Parameters:
@larswittenberg
larswittenberg / .htaccess
Created June 27, 2012 09:26
MediaElement.js with autoplay
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2025 14:55
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname