Skip to content

Instantly share code, notes, and snippets.

@loonison123
loonison123 / blogEngineNetUpdatePasswordSql.sql
Created March 14, 2014 03:22
SQL script to change BlogEngine.Net password
-- The below hash is "admin". That is between the quotes, lower case - admin
update be_users set password = 'jGl25bVBBBW96Qi9Te4V37Fnqchz/Eu4qB9vKrRIqRg=' where userid = [[USERID OF TARGET USER]]
@loonison123
loonison123 / embeddedExampleForGist.htm
Last active August 29, 2015 13:57
Embedded link for a Gist
<script src="https://gist.github.com/loonison123/9541764.js"></script>
@loonison123
loonison123 / startAndSetStartupType.ps1
Created March 29, 2014 19:21
Starts the Wireless LAN Service and sets its start up type using powershell.
# Must be in administrator powershell
# Start the service
start-service wlansvc
# Change service startup type
set-service wlansvc -StartupType "Automatic"
@loonison123
loonison123 / importSolrDataFromCsv.bat
Created March 29, 2014 20:10
Import SOLR data from csv file
cd YOURURL\apache-solr\exampledocs
java -Dtype=text/csv -Durl=http://localhost:8983/solr/update -jar post.jar solr_data.txt
REM Delete all data in SOLR database posted via web or CURL
REM http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E
REM Finalize the deleting of SOLR database
REM http://localhost:8983/solr/update?stream.body=%3Ccommit/%3E
@loonison123
loonison123 / usefulPowerShellCommands_1.ps1
Last active July 23, 2017 03:51
Useful PowerShell Commands
# Get powershell version
$PSVersionTable.PSVersion
# Get .NET version source: http://stackoverflow.com/questions/3487265/powershell-to-return-versions-of-net-framework-on-a-machine
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version
# Get windows version
@loonison123
loonison123 / basicSoftwareSpecs_1.cs
Created April 7, 2014 00:12
My basic software specifications for code snippets
Machine machine = new Machine()
{
DotNetVersion: 4.5,
Windows Version: "Windows 8.1 Pro",
Powershell Version: 4.0
};
@loonison123
loonison123 / setWinServer12IpConfig.ps1
Created April 18, 2014 22:43
Disable and reconfigure a static IP address on Windows Server 2012 using powershell
# List all network adapters (Find the name)
Get-NetAdapter
# (Administrator) Disable an ethernet adapter (Won't prompt you to confirm)
Disable-NetAdapter -Name "Ethernet" -Confirm:$false
# If you want to view some IP information
Get-WmiObject -Class win32_networkadapterconfiguration -filter ipenabled=TRUE -computername .
# Set static IP
@loonison123
loonison123 / NuGetCmdlets.ps1
Created April 18, 2014 23:49
Common NuGet cmdlets
# Reinstall all packages
update-package -reinstall
# Reinstall an individual package
update-package -reinstall PACKAGENAME
@loonison123
loonison123 / audioServicePowerShellCommands.ps1
Created April 24, 2014 03:39
Set windows audio services to automatically start with PowerShell
# Get services related to audio
Get-Service | Where {$_.Name -match "audio"} | format-table -autosize
# Start the services
Get-Service | Where {$_.Name -match "audio"} | start-service
# Set the services startup types
Get-Service | Where {$_.Name -match "audio"} | set-service -StartupType "Automatic"
# Validate our startup changes (Should say- StartMode:Auto)
@loonison123
loonison123 / wirelessSetupServer12.ps1
Created April 25, 2014 23:57
Enable wireless on Windows Server 2012 R2
Install-WindowsFeature -Name "Wireless-Networking"
Restart-Computer
Start-Service wlansvc
Set-Service wlansvc -StartupType "Automatic"