This file contains 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
# Name of your app. | |
APP="mosaicshapes" | |
# The path of your app to sign. | |
APP_PATH="/Users/dean/Desktop/m/mosaicshapes.app" | |
# The path to the location you want to put the signed package. | |
RESULT_PATH="/Users/dean/Desktop/$APP.pkg" | |
# The name of certificates you requested. | |
APP_KEY="3rd Party Mac Developer Application: [Redacted]" | |
INSTALLER_KEY="3rd Party Mac Developer Installer: [Redacted]" | |
#APP_KEY=”Developer ID Application: [redacted]” |
This file contains 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
def get_slope(img_seg): | |
x,y = np.where(img_seg==True) | |
slope,_ = np.polyfit(x,y,1) | |
return -1*slope |
This file contains 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
def average_color(image): | |
w,h = image.size | |
x0,y0 = (0,0) | |
x1,y1 = (w,h) | |
r,g,b = 0,0,0 | |
area = w*h | |
for x in range(x0, x1): | |
for y in range(y0, y1): |
This file contains 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
DEG30 = 30/360. | |
def adjacent_colors((r, g, b), d=DEG30): # Assumption: r, g, b in [0, 255] | |
r, g, b = map(lambda x: x/255., [r, g, b]) # Convert to [0, 1] | |
h, l, s = colorsys.rgb_to_hls(r, g, b) # RGB -> HLS | |
h = [(h+d) % 1 for d in (-d, d)] # Rotation by d | |
adjacent = [map(lambda x: int(round(x*255)), colorsys.hls_to_rgb(hi, l, s)) | |
for hi in h] # H'LS -> new RGB | |
adjacent[0] = tuple(adjacent[0]) |
This file contains 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
def luminance(r,g,b): | |
return math.sqrt(0.299 * math.pow(r,2) + 0.587 * math.pow(g,2) + 0.114 * math.pow(b,2)) | |
def tint_to_lum(color, lum): | |
r,g,b = color | |
nR,nG,nB = r,g,b | |
while True: | |
tint_factor = .005 | |
nR = nR + (255 - nR) * tint_factor |
This file contains 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
2 easy steps: | |
1) echo -n | openssl s_client -connect AD_SERVER:AD_SERVER_PORT | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ldapserver.pem | |
2) keytool -import -trustcacerts -file ldapserver.pem -alias ALIAS_GOES_HERE -keystore /Users/.../Apps/jxplorer-3.3.1-osx/jxplorer-3.3.1.app/Contents/Resources/security/cacerts | |
OR | |
Via JXPlorer UI, go to menu Security -> Trusted Servers and CAs. Import the new ldapserver.pem file. Default password "changeit" |
This file contains 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: webserver | |
namespace: webserver | |
spec: | |
ports: | |
- port: 80 | |
targetPort: 3000 | |
protocol: TCP |
This file contains 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
apiVersion: certmanager.k8s.io/v1alpha1 | |
kind: Certificate | |
metadata: | |
name: webserver-tls-prod | |
spec: | |
secretName: webserver-tls-prod | |
dnsNames: | |
- mosaic.skiptomyliu.com | |
acme: | |
config: |
This file contains 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
apiVersion: certmanager.k8s.io/v1alpha1 | |
kind: ClusterIssuer | |
metadata: | |
name: letsencrypt-prod | |
spec: | |
acme: | |
# The ACME server URL | |
server: https://acme-v02.api.letsencrypt.org/directory | |
# Email address used for ACME registration | |
email: [your_email address] |
This file contains 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: echoserver | |
namespace: echoserver | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: |
OlderNewer