This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Modified version of https://blog.sqlauthority.com/2017/03/12/get-status-running-backup-restore-sql-server-interview-question-week-113/ | |
Author: Laim McKenzie | |
Available from https://gist.github.com/laim | |
Copyright (c) 2021 laim.scot | |
*/ | |
SELECT r.session_id AS [Session_Id] | |
,r.command AS [command] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Laim McKenzie | |
Date: 30-04-2021 | |
Updated: 07-05-2021 | |
https://laim.scot | |
*/ | |
/* Create temp table to populate with data */ | |
CREATE TABLE #sp_who2 | |
( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> | |
<channel> | |
<title>{{ site.name | xml_escape }}</title> | |
<description>{{ site.description | xml_escape }}</description> | |
<link>{{ site.url }}</link> | |
<atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" /> | |
{% for post in site.posts limit:10 %} | |
<item> | |
<title>{{ post.title }}</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Take the database offline before restoring | |
ALTER DATABASE [DatabaseName] | |
SET OFFLINE WITH ROLLBACK IMMEDIATE | |
-- Restore the database | |
RESTORE DATABASE DatabaseName FROM DISK = '\\FileServer\directory\servername\database\database_backup.bak' | |
-- Bring it back online, this should be automatic but just incase. | |
ALTER DATABASE [DatabaseName] | |
SET ONLINE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
strName = "." 'Computer name, if local just use a period. | |
Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strName & "\root\cimv2") | |
For Each obj in objWMI.ExecQuery ("Select * from Win32_SystemEnclosure") | |
For Each strChassisType in obj.ChassisTypes | |
Wscript.Echo strChassisType | |
Next | |
Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user = "laim"; | |
$key = ""; | |
$type = "history"; //history or watching | |
// You need to register an API app here https://trakt.tv/oauth/applications to get the API Key (ClientID) | |
function traktAPI($user, $key, $type) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://api.trakt.tv/users/$user/$type"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: monospace; | |
background-color: #1d1f21; | |
color: #FFF; | |
} | |
a:link { | |
text-decoration:none; | |
color:#CC3300; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports YourApp.Registry | |
Public Class frmMain | |
Private Sub btnRegGet_Click(sender As Object, e As EventArgs) Handles btnRegGet.Click | |
Try | |
lbKeys.Items.Clear() | |
For Each i In getKeys("SOFTWARE\Google") | |
lbKeys.Items.Add(i.ToString) | |
Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function SearchEnabled() { | |
if(document.getElementById("ext_search_txt").value==="") { | |
document.getElementById('ext_search').disabled = true; | |
} else { | |
document.getElementById('ext_search').disabled = false; | |
} | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require("../include/configuration.php"); | |
require("../include/helper.php"); | |
require("../include/db/conn.php"); | |
require("../include/db/func.php"); | |
$home = new MyHomeBoardPHP($pdo); | |
if(isset($_GET['action']) && isset($_GET['id']) && isset($_GET['type'])){ | |
$type = htmlentities($_GET['type']); |