Skip to content

Instantly share code, notes, and snippets.

View ebruning's full-sized avatar

Ethan Bruning ebruning

View GitHub Profile
@styblope
styblope / docker-api-port.md
Last active November 5, 2024 10:16
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@ebruning
ebruning / docker-compose.yml
Last active December 5, 2016 19:26
nas build
# docker-compose up -d
sabnzbd:
image: "sabnzbd/sabnzbd"
container_name: "sabnzbd"
volumes:
- "/opt/appdata/sabnzbd:/datadir"
- "/mnt/volume01/movies:/movies"
- "/mnt/volume01/downloads:/downloads"
ports:
@jacobtomlinson
jacobtomlinson / freenas-disk-temp.py
Last active August 21, 2019 16:06
Get FreeNAS system temperatures in InfluxDB format
#!/usr/bin/env python
import os
import re
import subprocess
def cpuTemp(hostname):
sysctl = subprocess.Popen(['/sbin/sysctl', '-a'],stdout=subprocess.PIPE)
while True:
line = sysctl.stdout.readline()

Sublime Text Setup

NOTE: Your mileage may vary, depending on project, and/or perhaps you prefer a different IDE altogether.

The principles here are what we're shooting for, not necessarily that everything be used verbatim.

In the interest of automating code quality, and cutting down on the necessity for manual code reviews, we strongly urge each front-end developer to install these Sublime Text packages.

  • Babel
  • SublimeLinter
@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@soffes
soffes / Podfile
Created May 8, 2014 05:22
Pods used in Litely 1.0
platform :ios, '7.0'
# Core Data
pod 'SSDataKit', :git => 'https://github.com/soffes/SSDataKit', :commit => '60d432e734ae11e8cfedac8ac5f68c0ce8a1b9ba'
# On-disk & in-memory caching
pod 'SAMCache'
# Fast image view for Core Image
pod 'SAMCoreImageView', '0.1.3'
@mattt
mattt / UTTypeForImageData.m
Created March 27, 2014 23:19
A quick function for determining an image's file type by its first couple of bytes
@import MobileCoreServices;
static CFStringRef UTTypeForImageData(NSData *data) {
const unsigned char * bytes = [data bytes];
if (data.length >= 8) {
if (bytes[0] == 0x89 && bytes[1] == 0x50 && bytes[2] == 0x4E && bytes[3] == 0x47 && bytes[4] == 0x0D && bytes[5] == 0x0A && bytes[6] == 0x1A && bytes[7] == 0x0A) {
return kUTTypePNG;
}
}
@matthiasplappert
matthiasplappert / gist:9493050
Last active August 29, 2015 13:57
QuickLook Debugging for `UIView`
@interface UIView (MPAdditions)
@end
@implementation UIView (MPAdditions)
- (id)debugQuickLookObject {
if (self.bounds.size.width < 0.0f || self.bounds.size.height < 0.0f) {
return nil;
}
@chrismiles
chrismiles / reveal.py
Last active September 2, 2021 00:26
Lazy script to wrap Reveal lib load/start commands in one LLDB command.
""" File: reveal.py
Add to ~/.lldbinit:
command script import ~/.lldb-scripts/reveal.py
Q: Want to automatically load the Reveal lib on launch while debugging from Xcode?
A: In Xcode:
Add a Symbolic Breakpoint
Symbol: "UIApplicationMain"
Action: Debugger Command with value "reveal"