Advanced Search
Search Results
61 total results found
Sample Database Dummy Data
Create /********************************************************************************/ /* */ /* Kroenke and Auer - Database Processing (14th Edition) Chapters 10A */ /* */ /* The View Ridge Gallery (VRG_CH10A_PQ)...
Drop Table
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
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
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
# max row to display dataframe set to 7 import pandas as pd pd.set_option('display.max_rows', 7)
Combine df with concat
# 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
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
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
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
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
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
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
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
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
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
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
Edit to 2 GB echo "$[2 * 1024*1024*1024]" >/sys/module/zfs/parameters/zfs_arc_max
Deattach Onboard GPU to passthrough VM
echo 1 > /sys/bus/pci/devices/0000:26:00.0/remove echo 1 > /sys/bus/pci/rescan
Convert vhd to qcow2
qemu-img convert -O qcow2 disk0.vhd disk0.qcow2
Edit LXC Configuration File
nano /etc/pve/lxc/101.conf