Skip to content

Instantly share code, notes, and snippets.

@gaelicWizard
gaelicWizard / Archive Emlx.scpt
Created July 17, 2011 21:38 — forked from gruber/gist:1063605
Simple Inbox Archiving Script for Apple Mail
-- See article here: http://daringfireball.net/2007/07/simple_inbox_sweeper
-- The following should be one long line:
set _description to "All unflagged, read messages in each IMAP account
inbox will be moved to the “Archive” mailbox corresponding to that
account. This action is not undoable."
tell application "Mail"
display alert "Archive read messages from IMAP inboxes?" buttons ¬
{"Cancel", "Archive"} cancel button 1 message _description
#!/usr/bin/env python
"""
FORK TODO: Do something like http://pythonwise.blogspot.com/2013/12/reading-passwords-of-osx-keychain.html for username access from keychain.
FORK TODO: Detect OSX-or-not.
This script is designed to generate a simple html file with _all_ of your
Pinboard.in bookmarks The HTML file can be added to Launchbar's index as a
custom bookmark file and you can search your entire Pinboard.in collection
instantly from Launchbar (by title only). It includes any applied tags as part
@gaelicWizard
gaelicWizard / Decline-WsusItaniumUpdates.ps1
Last active June 7, 2016 13:42
Schedule the following script to decline all Itanium updates, then e-mail a report. Original by Mark @ TechNet Script Center.
Param(
[string]$WsusServer = ([system.net.dns]::GetHostByName('localhost')).hostname,
[bool]$UseSSL = $False,
[int]$PortNumber = 80,
[bool]$TrialRun = $True,
[bool]$EmailLog = $True,
[string]$SMTPServer = "smtp.company.tld",
[string]$From = "[email protected]",
[string]$To = "[email protected]",
[string]$Subject = "WSUS :: Declining Itanium Updates"
@gaelicWizard
gaelicWizard / update_computer_description.vbs
Last active February 12, 2024 21:51
Automatically sync the Description field between the local registry, Active Directory, and LogMeIn.
'VERSION: 1.1
'NOTE : This script requires that "SELF" have "WRITE DESCRIPTION" permission on AD computer object. Do this through "delegate control".
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
Set objSysInfo = CreateObject("ADSystemInfo")
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
@gaelicWizard
gaelicWizard / dcm4chee_install.sh
Last active October 18, 2022 14:44 — forked from gunlock/dcm4chee_install.sh
bash script to install dcm4chee and components on fresh Ubuntu 12.04 image
#!/bin/bash
set -e
function usage()
{
echo "Usage: $0 -u <Postgres_Username> -p <Password>"
}
@gaelicWizard
gaelicWizard / afplay.completion.bash
Created August 4, 2021 00:34 — forked from ttscoff/afplay.completion.bash
Bash custom completion to afplay System sounds on Mac
play() {
command afplay "/System/Library/Sounds/$1.aiff"
}
_complete_system_sounds ()
{
local cur
local LC_ALL='C'
COMPREPLY=()
@gaelicWizard
gaelicWizard / logr.bash
Last active September 27, 2021 15:21 — forked from ttscoff/logr.bash
Bash logging utility that simplifies use of logger command
#!/bin/bash
# Logging utility that simplifies user of bash logger command
# # First source the script
# source ~/scripts/logr.bash
# # Start the logger, generates log name from scripts filename
# logr start
# # or define your own
# logr start LOG_NAME
@gaelicWizard
gaelicWizard / speedmail.applescript
Last active January 19, 2022 20:32 — forked from ttscoff/speedmail.applescript
Speed up Mail.app
(*
Speed up Mail.app by vacuuming the Envelope Index
Code from: http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/
Originally by "pmbuko" with modifications by Romulo
Updated by Brett Terpstra 2012
Updated by Mathias Törnblom 2015 to support V3 in El Capitan and still keep backwards compability
Updated by @lbutlr for V5 and Container folder in High Sierra and use du
*)
tell application "Mail" to quit