Skip to content

Instantly share code, notes, and snippets.

@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
@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_song_history.sql
Created February 23, 2012 14:06
Rainwave SQL / Song history
select
case rw_songs.sid
when 1 then 'Game'
when 2 then 'OCReMix'
when 3 then 'Covers'
when 4 then 'Chiptune'
else 'All'
end as "Channel",
album_id as "Album ID",
album_name as "Album Title",
@williamjacksn
williamjacksn / rw_all_songs_with_cooldown_group.sql
Created February 23, 2012 13:34
Rainwave SQL / All songs with cooldown group
select
min(rw_songs.sid) as "Channel ID",
min(album_id) as "Album ID",
min(album_name) as "Album Title",
song_id as "Song ID",
min(song_title) as "Song Title",
array_agg(artist_name) as "Artist",
oac_name as "Cooldown Group",
min(song_rating_avg) as "Average Rating",
timestamp with time zone 'epoch' + min(song_addedon) * interval '1 second' as "Song Added On"
@williamjacksn
williamjacksn / rw_del_dup_rating.sql
Last active September 30, 2015 20:18
Rainwave SQL / Find and delete duplicate song ratings
delete from
r4_song_ratings
where
ctid in (
select
min(ctid)
from
r4_song_ratings
where
user_id = %s and
@williamjacksn
williamjacksn / bitlocker-status.vbs
Created November 14, 2011 15:13
BitLocker Status VBScript
' BitLocker Status Script by William Jackson (w@austin.utexas.edu)
' Useful as an Absolute Manage Custom Information Field (CIF)
cif = ""
Set s = CreateObject("WScript.Shell")
Set e = s.Exec("manage-bde -status")
Set status = e.StdOut
Do While status.AtEndOfStream <> True
@williamjacksn
williamjacksn / rw_all_albums.sql
Created August 18, 2011 18:48
Rainwave SQL / All albums with number of songs and total song length
select
rw_albums.sid,
album_name,
count(song_id) as num_songs,
sum(song_secondslong) as total_song_length
from
rw_albums
join
rw_songs using (album_id)
where
@williamjacksn
williamjacksn / rw_high_rated_songs_favourites.sql
Created June 22, 2011 18:39
Rainwave SQL / High-rated songs and whether they are favourites
select
rw_songs.sid,
album_name,
song_title,
song_rating,
case when f.user_id = 9575 then true else false end as fav
from
rw_songratings
join
rw_songs using (song_id)
@williamjacksn
williamjacksn / rw_top_songs_by_request.sql
Created May 20, 2011 14:47
Rainwave SQL / Top songs by requests
select
song_title,
album_name,
song_totalrequests,
song_rating_avg,
rw_songs.sid
from
rw_songs
join
rw_albums using (album_id)
@williamjacksn
williamjacksn / app_compliance.ps1
Created May 12, 2011 18:50
Application Detection and Compliance with PowerShell
$app_name = "*flash player*"
$app_ver = "10.3.183.5"
$reg_uninstall_keys = "hklm:software\wow6432node\microsoft\windows\currentversion\uninstall", "hklm:\software\microsoft\windows\currentversion\uninstall"
[array]$compliant = (
$reg_uninstall_keys | foreach-object {
if (test-path $_) {
get-childitem $_ | get-itemproperty | select-object displayname, displayversion
}
}
) | where-object {$_.displayname -like $app_name -and $_.displayversion -eq $application_version}