Category: Code
This area of the site is dedicated to code snippets for quick and easy reference
PowerShell Set DNS Settings
This only works on Windows 8, 8.1, 10 as the Cmdlets Set-DnsClientServerAddress Get-DnsClientServerAddress are introduced in Windows 8. First get the interface name(s) you want to modify Change the code below to the interface you wish to change
List All Files In Folder
Reference: http://www.codingforums.com/post-a-php-snippet/71882-recursive-directory-listing-show-full-directory-structure.html
WordPress – List All Plugins
Place the following code on a file ex. ListAllPlugins.php and then navigate to http://yourdomain.com/ListAllPlugins.php This is a PowerShell script to automate some of the information
PowerShell Download Latest WordPress Plugin
This script will call out to a defined URL to check the version of a plugin and download the update if needed. To use:
PowerShell Special Folders
Named Special Folders: Desktop Programs Personal MyDocuments Favorites Startup Recent SendTo StartMenu MyMusic DesktopDirectory Templates ApplicationData LocalApplicationData InternetCache Cookies History CommonApplicationData System ProgramFiles MyPictures CommonProgramFiles
PowerShell Download File and Extract File
Grabbing code from Powershell Download Script and Powershell Extract Zip Files this script will download with the option of extracting the zip file. In PowerShell if you type the following you will get two examples of how to use the code.
WordPress Database Information
I plan to work more on this as it is rather nasty but as a work in progress notepad if you will this is the spot for now. GitHub: https://gist.github.com/dkittell/f9080101d66834910dfd
MySQL Server Information
SHOW STATUS provides server status information like Connections, Opened_tables, Bytes_received, Bytes_sent, etc. SHOW VARIABLES shows the values of MySQL system variables like time_zone, version, max_connections, etc. References: http://stackoverflow.com/questions/3939803/how-to-get-mysql-server-info-using-command-line
PowerShell Extract Zip Files
Reference: http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/