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
docker run \
-d \
-e TZ=America/Chicago \
--shm-size=4096m \
-p 80:80 \
--name=zoneminder \
--restart unless-stopped \
quantumobject/docker-zoneminder
docker run \
--name=piwigo \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/docker/volumes/piwigo/config:/config \
-v /media/kingkong/backups/pictures:/photos \
-e TZ=America/Chicago \
-p 8980:80 \
-d \
--restart unless-stopped \
linuxserver/piwigo
docker run \
-p 139:139 \
-p 445:445 \
-e TZ=CST6CDT \
-v /media/kingkong:/mount/kingkong \
-d \
--name samba \
--restart unless-stopped \
dperson/samba \
-s "kingkong;/mount/kingkong"
@phillijw
phillijw / gist:1df0495cdd9b5c96148b3c2e74eb3d09
Last active January 18, 2019 04:30
Set up unifi controller in docker
docker run \
-d \
--name=unifi \
-v /var/lib/docker/volumes/unifi/config:/config \
-e PUID=1000 \
-e PGID=1000 \
-p 3478:3478/udp \
-p 10001:10001/udp \
-p 8080:8080 \
-p 8081:8081 \
@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,
@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: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.
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: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 =================
@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);