This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Custom service to work with products | |
/// </summary> | |
public interface IProductService | |
{ | |
IEnumerable<Product> GetAll(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
using Odin.MemberReport.Models; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Web.Http.Results; | |
using System.Web.Mvc; | |
using Odin.MemberReport.Utilities; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#OSX: Query when a password was last set | |
dscl . read /Users/<username> | grep --context=3 passwordLastSetTime | |
#OSX: Set password policy | |
#https://drpebcak.svbtle.com/managing-local-password-policy-with-pwpolicy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Not my code, but not sure where it came from. | |
using System; | |
using System.Net; | |
public static class IPAddressExtensions | |
{ | |
public static IPAddress GetBroadcastAddress(this IPAddress address, IPAddress subnetMask) | |
{ | |
byte[] ipAdressBytes = address.GetAddressBytes(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while read ip; do org=$(whois $ip | grep Organization); netname=$(whois $ip | grep netname); amey=$(whois $ip | grep -i amey); ent=$(whois $ip | grep -i enterprise); echo "$ip: $org -- $netname -- $amey -- $ent"; done < ipaddress.txt | |
#ipaddress.txt is a list of IP addresses to check | |
# | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$process = Get-Process -Id $pid | |
$process.PriorityClass = 'BelowNormal' | |
#$process.PriorityClass = 'Idle' | |
function GetOccurrenceInFile($1) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE [dbo].[iislog] | |
CREATE TABLE [dbo].[iislog] ( | |
[date] [varchar] (50) NULL, | |
[time] [varchar] (50) NULL , | |
[c-ip] [varchar] (50) NULL , | |
[cs-method] [varchar] (50) NULL , | |
[cs-uri-stem] [varchar] (255) NULL , | |
[cs-uri-query] [varchar] (2048) NULL , | |
[sc-status] [varchar] (50) NULL , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Source: https://support.microsoft.com/en-us/kb/296085 | |
-- Note: I hade to make some of the fields longer | |
CREATE TABLE [dbo].[tablename] ( | |
[date] [datetime] NULL, | |
[time] [datetime] NULL , | |
[c-ip] [varchar] (50) NULL , | |
[cs-method] [varchar] (50) NULL , | |
[cs-uri-stem] [varchar] (255) NULL , | |
[cs-uri-query] [varchar] (2048) NULL , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Blueprint Web Tech .hgignore file | |
# | |
# Thanks to Offroadcode for the inspiration | |
# | |
# CA, 11 March 2016 | |
# | |
# Offroadcode's Mercurial Ignore file | |
# visit /blog/2012/4/5/mercurial-ignore-file-for-umbraco/ for updates/additions | |
# Thanks! | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Convert meters per second to miles per hour | |
/// </summary> | |
/// <param name="metersPerSecond"></param> | |
/// <returns></returns> | |
private double ConvertMetersPerSecondIntoMilesPerHour(double metersPerSecond) | |
{ | |
//1 m/s = 2.23694 miles/hour | |
return metersPerSecond * 2.23694; | |
} |
NewerOlder