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
Netty started on port(s): 8080 | |
Started ApplicationKt in 7.113 seconds (JVM running for 9.353) |
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
(defn start-stream [] | |
(record :encoder :connect-to-camera (make-event-details ...)) | |
(manager/register :connect-to-camera | |
(sh/proc "ffmpeg" "-hide_banner" "-re" "-rtsp_transport" "tcp" "-i" | |
config/encoder-rtsp-endpoint | |
"-c:a" "aac" "-ar" "48000" "-b:a" "128k" | |
"-c:v" "h264" "-profile:v" "high" | |
"-g" "48" "-keyint_min" "48" "-sc_threshold" "0" "-b:v" "3072k" | |
"-maxrate" "3500k" "-vcodec" "libx264" "-bufsize" "3072k" | |
"-hls_time" "6" |
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
;; encoder.clj | |
(defstate encoder | |
:start (try | |
(start-stream) | |
(catch Exception e)) | |
;; error-handling here | |
:stop (stop-stream)) |
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
;; core.clj | |
(defn run-encoder [] | |
(mount/start #'state/s3 | |
#'state/db | |
#'encoder/encoder)) | |
(defn -main [& args] | |
(run-encoder)) |
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
;; vm.clj | |
(aws/invoke state/ec2 | |
{:op :RunInstances | |
:request {:InstanceType "c5d.2xlarge" | |
:MaxCount 1 | |
:MinCount 1 | |
:SubnetId "subnet-id" | |
:ImageId "ami-id" | |
:SecurityGroupIds ["sg-id"] |
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
import os | |
import pickle | |
import warnings | |
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from tensorflow.keras.callbacks import EarlyStopping | |
from tensorflow.keras.layers import Dense | |
from tensorflow.keras.layers import Dropout |
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
# pgTAP extension | |
comment = 'Unit testing for PostgreSQL' | |
default_version = '1.1.0' | |
module_pathname = '$libdir/pgtap' | |
requires = 'plpgsql' | |
relocatable = true | |
superuser = false |
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
[root@ip-172-31-19-212 certbot]# cat certbot-auto | |
#!/bin/sh | |
# | |
# Download and run the latest release version of the Certbot client. | |
# | |
# NOTE: THIS SCRIPT IS AUTO-GENERATED AND SELF-UPDATING | |
# | |
# IF YOU WANT TO EDIT IT LOCALLY, *ALWAYS* RUN YOUR COPY WITH THE | |
# "--no-self-upgrade" FLAG | |
# |
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
# Turn on the simulator screen capture | |
xcrun simctl io booted recordVideo ~/simulator.mov | |
# Convert the iPhone 6s screen shot into a gif: | |
ffmpeg -i ~/simulator.mov -vf scale=320:-1 -r 6 -f gif -y simulator.gif |
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
(defn pgobj->clj [^org.postgresql.util.PGobject pgobj] | |
(let [type (.getType pgobj) | |
value (.getValue pgobj)] | |
(case type | |
"json" (cheshire.core/parse-string value true) | |
"jsonb" (cheshire.core/parse-string value true) | |
"citext" (str value) | |
value))) | |
(extend-protocol next.jdbc.result-set/ReadableColumn |