Skip to content

Instantly share code, notes, and snippets.

@williamjacksn
williamjacksn / rw_possible_song_collisions.sql
Created March 8, 2012 17:11
Rainwave SQL / Possible song title collisions
select
max(sid),
song_filename
from
rw_songs
where
song_verified is true
group by
song_filename
having
@williamjacksn
williamjacksn / rw_users.sql
Created April 2, 2012 13:48
Rainwave SQL / Users
select
user_id,
user_type,
username,
timestamp with time zone 'epoch' + user_regdate * interval '1 second' as registration_date,
timestamp with time zone 'epoch' + user_lastvisit * interval '1 second' as last_visit,
user_posts,
radio_inactive
from
phpbb_users
#!/bin/bash
crontab -l | grep -v "no crontab for" | grep -v "freshclam" | grep -v "clamscan" > /tmp/crontmp
crontab /tmp/crontmp
rm /tmp/crontmp
find /Users ( -name "uk.co.markallan.clamxav.clamscan.plist" -or -name "uk.co.markallan.clamxav.freshclam.plist" ) -execdir launchctl unload -w "{}" \;
find /Users -name "uk.co.markallan.clamxav.*" -delete
rm -r /Library/Receipts/clamav*
rm -r /Library/Receipts/ClamAV*
rm -r /usr/local/clamXav
@williamjacksn
williamjacksn / gpo-backup-script.ps1
Created September 12, 2012 16:44
Backup all GPOs that match a pattern
Import-Module GroupPolicy
Get-GPO -All | Where-Object {$_.DisplayName -like "ops*"} | Backup-GPO -Path "\\server\share" -Comment "Backup Comment"
@williamjacksn
williamjacksn / firefox-detect-esr.vbs
Last active December 10, 2015 21:28
Update the Firefox DisplayName in the Add/Remove Programs list to indicate whether Firefox is on the "esr" release channel.
' This script will try to detect what update channel Firefox is using. If the
' update channel is "esr" then the DisplayName in the Add/Remove Programs list
' will be updated to inclued an "[esr]" tag at the end.
' If the update channel is "release" and there is an "[esr]" tag in the
' DisplayName, the tag will be removed.
' by William Jackson ([email protected])
Set shell = WScript.CreateObject("WScript.Shell")
@williamjacksn
williamjacksn / install-jdk-with-jre.bat
Last active December 15, 2015 14:09
Install 32-bit Java Development Kit and Java Runtime Environment on 32- or 64-bit Windows.
msiexec.exe /package "%~dp0jdk1.7.0_17.msi" /quiet /norestart
goto [%PROCESSOR_ARCHITECTURE%]
goto end
:[x86]
msiexec.exe /package "%ProgramFiles%\Java\jdk1.7.0_17\jre.msi" /quiet /norestart
goto end
:[AMD64]
WITH
rated_songs AS (
SELECT song_rating_id
FROM rw_songratings
WHERE user_id = %s),
unrated_songs AS (
SELECT song_id, album_id, song_available, song_releasetime
FROM rw_songs
WHERE song_verified AND sid = %s AND song_rating_id NOT IN (
@williamjacksn
williamjacksn / README.md
Last active December 27, 2015 04:29
Email daily calendar
@williamjacksn
williamjacksn / install-microsoft-updates.vbs
Last active January 2, 2016 16:18
Install Microsoft Updates. Skip Language Packs, Internet Explorer, and Bing.
' Install Microsoft Updates. Skip Language Packs, Internet Explorer, and Bing.
Option Explicit
Dim debug, dry_run, task_sequence, arg
debug = False
dry_run = False
task_sequence = False
For Each arg In WScript.Arguments
@williamjacksn
williamjacksn / cm-version.vbs
Created February 3, 2014 17:54
Display Configuration Manager Client version
For Each c In GetObject("winmgmts:root/ccm").InstancesOf("CCM_InstalledComponent")
If c.Name = "CcmFramework" Then
WScript.Echo c.Version
End If
Next