Skip to content

Instantly share code, notes, and snippets.

Jeremy Morgan JeremyMorgan

Block or report user

Report or block JeremyMorgan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View open5000.sh
firewall-cmd --zone=public --add-port=5000/tcp --permanent
firewall-cmd --reload
iptables-save | grep 5000
@JeremyMorgan
JeremyMorgan / cpuinfo.txt
Created Oct 19, 2019
CPU Info for test machine
View cpuinfo.txt
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
stepping : 3
microcode : 0x27
cpu MHz : 3591.867
cache size : 8192 KB
physical id : 0
@JeremyMorgan
JeremyMorgan / getfolder.ps1
Created Mar 9, 2019
Get Folder by Application Name in IIS
View getfolder.ps1
[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
$siteName = "Default Web Site"
$vApp = "/HV"
$serverManager = New-Object Microsoft.Web.Administration.ServerManager
$site = $serverManager.Sites | where { $_.Name -eq $siteName }
$rootApp = $site.Applications | where { $_.Path -eq $vApp }
@JeremyMorgan
JeremyMorgan / installweb.bat
Created Oct 1, 2018
Quick batch file to install IIS if it's not installed
View installweb.bat
@ECHO OFF
dism /online /get-featureinfo /featurename:IIS-WebServer | find "State : Disabled" > nul
if %ERRORLEVEL% == 0 (
echo "IIS Web Server is not installed"
dism /online /enable-feature /featurename:IIS-WebServer /all
)
dism /online /get-featureinfo /featurename:IIS-WebServer | find "State"
@JeremyMorgan
JeremyMorgan / RunEveryMinute.cs
Created Aug 23, 2018
Run a method every minute
View RunEveryMinute.cs
Timer t = new Timer(60000) {AutoReset = true};
t.Elapsed += new System.Timers.ElapsedEventHandler(DoSomeStuff);
t.Start();
private void DoSomeStuff(object sender, ElapsedEventArgs e)
{
// do something
}
@JeremyMorgan
JeremyMorgan / builder.bat
Created Mar 24, 2017
Batch file for building VS projects
View builder.bat
@echo off
call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
:start
echo Build Start: %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%.%TIME:~9,2%
%WINDIR%\Microsoft.NET\Framework\%FrameworkVersion%\msbuild.exe (.msbuildfile) (params)
:end
echo Build Completed: %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%.%TIME:~9,2%
@JeremyMorgan
JeremyMorgan / enableremotedesktopazure.ps1
Created Aug 17, 2016
Enable Remote Desktop in Azure
View enableremotedesktopazure.ps1
#ConvertTo-SecureString -String "yourpassword" -AsPlainText -Force | ConvertFrom-SecureString | Set-Content "password.txt"
$servicename = "yourcloudservice"
$username = "remotedesktopuser"
$securepassword = Get-Content -Path "password.txt" | ConvertTo-SecureString
$expiry = $(Get-Date).AddDays(1)
$credential = New-Object System.Management.Automation.PSCredential $username,$securepassword
Set-AzureServiceRemoteDesktopExtension -ServiceName $servicename -Credential $credential -Expiration $expiry
@JeremyMorgan
JeremyMorgan / addmimesiis7.ps1
Created Jul 20, 2016
Script to add mime types for IIS 7
View addmimesiis7.ps1
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /-"[fileExtension='.eot']"
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.eot',mimeType='application/vnd.ms-fontobject']"
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /-"[fileExtension='.ttf']"
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.ttf',mimeType='application/octet-stream']"
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /-"[fileExtension='.svg']"
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.svg',mimeType='image/svg+xml']"
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /-"[fileExtension='.woff']"
@JeremyMorgan
JeremyMorgan / getassemblies.cs
Created Dec 14, 2015
Get real location of assemblies
View getassemblies.cs
string[] assemblyLocations = GetAssemblyLocation(new string[] { "System.Web.dll", "System.dll", "EntityFramework.dll" });
private string[] GetAssemblyLocation(string[] assemblyNames)
{
string[] locations = new string[assemblyNames.Length];
for (int loop = 0; loop <= assemblyNames.Length - 1; loop++)
{
locations[loop] = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && a.ManifestModule.Name == assemblyNames[loop]).Select(a => a.Location).FirstOrDefault();
}
View gist:2d2aa023b21a14c22970
describe('homeController', function () {
beforeEach(module('revokinatorApp'));
beforeEach(module('Revokinator.Home.Controller'));
var $controller;
beforeEach(inject(function (_$controller_) {
// The injector unwraps the underscores (_) from around the parameter names when matching
$controller = _$controller_;
You can’t perform that action at this time.