Skip to content

Instantly share code, notes, and snippets.

View henri's full-sized avatar
💭
hacking the mainframe

henri henri

💭
hacking the mainframe
View GitHub Profile
#!/bin/sh
# Script by rtrouton
# Cleanup by Arjen van Bochoven (oct 2013)
# Get major OS version (uses uname -r and bash substitution)
# osvers is 10 for 10.6, 11 for 10.7, 12 for 10.8, etc.
osversionlong=$(uname -r)
osvers=${osversionlong/.*/}
# Checks to see if the OS on the Mac is >= 10.7
@henri
henri / example
Last active February 21, 2017 23:20
#!/usr/bin/env bash
grep `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk '/BSSID/{print $2}'` /tmp/file.csv | head -n 1 | awk -F "," '{print $2}'
@henri
henri / restart_bluetooth.sh
Created March 22, 2017 02:43 — forked from nicolasembleton/restart_bluetooth.sh
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
@henri
henri / disabling-macosx-notification-center.md
Created May 2, 2017 00:02 — forked from mikermcneil/disabling-macosx-notification-center.md
Disable/Enable Notification Center (MacOS X)

Toggle MacOS X Notification Center on or off

This gist is to remind me (and anyone else who it helps) how to quickly disable and re-enable Notification Center.

Set Up Bash Aliases

Installation

  1. Open your terminal (<⌘ + ␣ (spacebar)>, then type "terminal", then press <↩ (enter)>).
# view as xml on standard out
plutil -convert xml1 -o - ./com.apple.finder.plist
#!/bin/bash
# Copyright 2018 Henri Shustak - henri.mobilityprintrestart@shustak.org
# Licence MIT : https://opensource.org/licenses/MIT
# This script is tested and works on macOS 10.12.6 - It is used to keep the PaperCut
# MobilityPrint service running and to regularly restart the MobilityPrint daemon.
#!/usr/bin/env ruby
#
# (C)2009 Henri Shustak
# Released Under the GNU GPL
# Lucid Information Systems
# http://www.lucidsystems.org
#
# More information on this script : http://www.lbackup.org/developer/mounting_attached_backup_devices
# This version works on 10.13 with USB devices. Figured that setting up the gist would make it easier for people contribute
# modifications back to a central location.
#!/usr/bin/env ruby
#
# Check print queue status if it is stopped restart and send out a notification email.
#
# (C)2017 Henri Shustak
# Licenced Under the GNU GPL v3 or later <https://www.gnu.org/copyleft/gpl.html>
#
# Version 2.3
#
# For email delivery, sendEmail <http://caspian.dotconf.net/menu/Software/SendEmail/> is required.
@henri
henri / p5-backup2go-cheat-sheet.txt
Last active June 17, 2022 01:44
P5 Backup2Go Command Line Cheat Sheet
# Archiware Cheat Sheet - Backup2Go
# These are some useful commands which I stumbled upon while setting up automatic P5 configurarions
# web interface URL
http://127.0.0.1:8000/lexxapp/login?u_app=client
# start backup (from client) - depending on which server you wish to initate a backup with you may need to change this
/usr/local/aw/bin/nsdchat -c Server 10001 start now
# stop the deamon
@henri
henri / macOS - SIP Full Disk Access List
Created August 28, 2019 01:24
SIP Fill Disk Access Listing From Terminal
# Once the shell / terminal is granted full disk access, you will be able to run this command
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db 'select * from access' | grep AllFiles | awk -F '|' '{print $2}'