Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

79 total results found

Sample Database Dummy Data

MS SQL Snippets/Scripts

Create /********************************************************************************/ /* */ /* Kroenke and Auer - Database Processing (14th Edition) Chapters 10A */ /* */ /* The View Ridge Gallery (VRG_CH10A_PQ)...

Drop Table

MS SQL Snippets/Scripts

Code: -- Drops (to be removed) USE Database1; DROP TABLE Computer; DROP TABLE User; DROP TABLE Incident; DROP TABLE Vendor; DROP TRIGGER Insert_Computer_Trigger; DELETE FROM Incident WHERE caseNumber = 2 AND runningNumber = 2;  

Inheritance

Python Snippets/Scripts

class Person(object): # Constructor def __init__(self, name): self.name = name # To get name def getName(self): return self.name # To check if this person is an employee def isEmployee(self): re...

Create SQLite DB from Wikipedia

Python Snippets/Scripts

Create an SQLite DB based on the British Monarch Family Tree.https://en.wikipedia.org/w/index.php?title=Family_tree_of_British_monarchs&oldid=1043575587  ## set up tables: british_monarch_family_tree import sqlite3 conn = sqlite3.connect('british_monarch_fa...

Set max row for dataframe output

Python Snippets/Scripts Pandas

# max row to display dataframe set to 7 import pandas as pd pd.set_option('display.max_rows', 7)  

Combine df with concat

Python Snippets/Scripts Pandas

# Combine all dataframe with concat frame_format = [df_f0_f1, df_f1_f2, df_f2_f3, df_f3_f4, df_f4_f5] df_all = pd.concat(frame_format, sort = False)  

Create histogram from df

Python Snippets/Scripts Pandas

df_trace_person_count sample:   trace id no of unique person 0 TRACE_PERSON_0000000003 16 1 TRACE_PERSON_0000000005 20 2 TRACE_PERSON_0000000011 5 ... ... ... 313 TRACE_PERSON_0000000995 20 314 TRACE_PERSON...

Windows Server Audit Policy

Windows System Administrator Group Policy

Backup To backup existing auditing settings: auditpol /backup /file:C:\Temp\Audit.txt Restore To restore the auditing settings: auditpol /restore /file:C:\Temp\Audit.txt Display Settings To check the auditing settings: auditpol /get /category:* Clear ...

Folder Directory to ISO file Script

PowerShell Snippets/Scripts

Change the following:Line 80 -> Source DirectoryLine 81 -> Output File function New-IsoFile { [CmdletBinding(DefaultParameterSetName='Source')]Param( [parameter(Position=1,Mandatory=$true,ValueFromPipeline=$true, ParameterSetName='Source')]$Sour...

GPO WMI Filters

Windows System Administrator Group Policy

Hostname Filter Select * From Win32_ComputerSystem Where Name = "ComputerName" Windows 2019 Domain Controller Filter SELECT * FROM Win32_OperatingSystem WHERE Version LIKE "10.0.17763" AND ProductType LIKE "2" Windows 2019 Member Server Filter  SELECT...

KMS Activation Script

Windows System Administrator Scripts

Save this at .bat file and run as admin @echo off :: For unattended mode, run the script with /u parameter. ::======================================================================================================================================== :...

Get AD User Last Logon and Last Logon AD Server Script

Windows System Administrator Scripts

Save this as .ps1 file and run as admin in the Domain Controller Import-Module ActiveDirectory function Get-ADUsersLastLogon() { $dateinfile = (Get-Date).AddMonths(-1).ToString('yyyy-MM') $domain = (Get-WmiObject -Namespace root\cimv2 -Class Win3...

Get AD Group Member List Script

Windows System Administrator Scripts

Save this as .ps1 file and run as admin in Domain Controller. Simple $groups = (Get-ADGroup -Filter * | Select name -ExpandProperty name) $table=@() $record=@{ "groupname" ="" "username"="" } foreach ($g in $groups){ $i = 0 $members...

Directory Tree Size Script

PowerShell Snippets/Scripts

Code: Function Get-DirectoryTreeSize { <# .SYNOPSIS This is used to get the file count, subdirectory count and folder size for the path specified. The output will show the current folder stats unless you specify the "AllItemsAndAllFolders" property. ...

Reset Local Account Script

Windows System Administrator Scripts

Change line 8 and 9. # Check if the script is running as an administrator if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Host "...

Offline WSUS Scan Script

Windows System Administrator Scripts

Step 1 - Download Wsusscan2.cab file Download Wsusscn2.cab from official MS website and save it in C:\temp\wsusscn2.cab. Step 2 - Run offline script Save this as offlinescan.vbs file and run "cscript offlinescan.vbs" as admin. Set UpdateSession = CreateObj...

Edit ZFS max cache RAM size

Proxmox

Edit to 2 GB echo "$[2 * 1024*1024*1024]" >/sys/module/zfs/parameters/zfs_arc_max

Deattach Onboard GPU to passthrough VM

Proxmox

echo 1 > /sys/bus/pci/devices/0000:26:00.0/remove echo 1 > /sys/bus/pci/rescan  

Convert vhd to qcow2

Proxmox

qemu-img convert -O qcow2 disk0.vhd disk0.qcow2  

Edit LXC Configuration File

Proxmox

nano /etc/pve/lxc/101.conf