Skip to content

Instantly share code, notes, and snippets.

View phillijw's full-sized avatar
🐌
Reading the yellow pages

Joe Phillips phillijw

🐌
Reading the yellow pages
View GitHub Profile

Keybase proof

I hereby claim:

  • I am phillijw on github.
  • I am phillijw (https://keybase.io/phillijw) on keybase.
  • I have a public key ASBElBox4fA5TZOcjmXddhopv9KWO9JDWxTqiHw2jkTXIwo

To claim this, I am signing this object:

<PropertyGroup>
<EnvConfig>$(EnvConfig)</EnvConfig>
<EnvConfig Condition=" '$(EnvConfig)' == '' ">Local</EnvConfig>
</PropertyGroup>
...
<Content Include="Web.Production.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Test.config">
<DependentUpon>Web.config</DependentUpon>
@phillijw
phillijw / build.cmd
Created February 16, 2017 19:41
An example of how you might write a simple build script with msbuild compatible with C# 6
@echo off
"C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" ../MEDIC.Web.csproj /t:rebuild;package /p:Configuration=Release /p:EnvConfig="Production"
if errorlevel 1 goto errorDone
echo Build successful
robocopy ../bin/ ../obj/Release/Package/PackageTmp/ Web.config
echo Copied transformed Web.config
@phillijw
phillijw / gist:7bd65f26803e1f4dc5f881285816d1e3
Created April 8, 2017 02:50
Williams Top-Vent Gravity Wall Furnace won't turn on (Model 2509622A)
Problem: Burners won't light even though pilot stays lit
Solution: Reset the vent-limit switch (it turns burners off when it gets too hot)
I have a Williams brand wall furnace that was recently installed. Lately it has been not kicking on automatically when the temperature drops. I've scoured the internet and noticed that other people have had the same issue. The pilot is lit, the thermostat is set properly, but it still does not kick on. At first I thought this was due to a loose connection but ultimately what I noticed is that at the top of the unit behind the side vents, there is a "vent-limit switch". This is essentially a switch that turns the burners off if it overheats. The pilot remains lit when this happens. There is a tiny red button that you need to push to reset this switch each time this happens. Luckily you can fit a letter opener or something thin between the side vent slats to reset this button if this happens. The odd thing is that this seems to happen when we lower the temperature so the fu
@phillijw
phillijw / gist:679cf0d9af6dee41d23c3fc4b839c15f
Last active May 25, 2017 15:38
simple async/await example
Console.WriteLine(DateTime.Now);
//This block takes 1 second to run because all 5 tasks are running simultaneously
{
var a = Task.Delay(1000);
var b = Task.Delay(1000);
var c = Task.Delay(1000);
var d = Task.Delay(1000);
var e = Task.Delay(1000);
@phillijw
phillijw / gist:d520f1c3fe10b348dd1b9fb94803a5ca
Last active February 2, 2019 21:09
Setup for Wansview K2 cam in Zoneminder
Zoneminder setup for webcams:
Wansview K2 =================
Source Type: Ffmpeg
Source Path: rtsp://user:password@ipaddress:554/live/ch0
Remote Method: TCP
Shengzen X Series =================
IDatabase db = redis.GetDatabase();
IBatch batch = db.CreateBatch();
foreach (var filename in filenames)
{
tasks.Add(batch.SortedSetAddAsync("files", filename, 0));
}
batch.Execute();
@phillijw
phillijw / gist:8a3239be74847ab166d2585231edff94
Created January 20, 2018 23:53
Setting up plex in a docker container
Goal: Set up Plex for my LAN inside a docker container. I am not using or relying on the plex.tv website at all. This
is all local to my network. Plex updates happen through the web interface. I'm not sure how I'm going to handle
the docker image updates yet or if I will even worry about it.
First, set up a ramdisk (type=tmpfs; I used 4GB but smaller is fine probably) to use for transcoding. This allows plex to
transcode files without reading and writing constantly from your SSD or other disk drive. This lets it do it all in
memory instead. I mounted this at /mnt/ramdisk and then set it up in my fstab so it persists through reboots.
Second, make sure you have docker installed ya big dummy.
@phillijw
phillijw / gist:904e2f965f2a249cf5cbbe7eb5e3d290
Created January 21, 2018 00:59
Setting up home-assistant in a docker container
docker run \
-d \
--name="home-assistant" \
-v /home/phillijw/docker/home-assistant/config:/config \
-v /etc/localtime:/etc/localtime:ro \
--net=host \
--restart always \
homeassistant/home-assistant
@phillijw
phillijw / gist:f28f02474cf1313a2cbb8d1055de513c
Created March 3, 2018 19:39
zzz in .net DateTime ToString formatter
{
var utcEpoch = DateTime.Parse("1970-01-01", CultureInfo.InvariantCulture,
DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
Console.WriteLine(utcEpoch.Kind);
Console.WriteLine(utcEpoch.ToString("o"));
Console.WriteLine(utcEpoch.ToString("zzz"));
}
Console.WriteLine("-----------");
{
var utcEpoch = DateTime.Parse("1970-01-01", CultureInfo.InvariantCulture,