Original goal:
- open a web page and automate the process of selecting "export to PDF..." from that page.
Resources that helped significantly:
Assistance from this article: https://www.liquidweb.com/kb/how-to-install-docker-on-centos-8/ | |
============================= | |
Introduction | |
============================= | |
Red Hat and Docker broke up which means you can't just install Docker in CentOS or RHEL 8 and expect it to work. | |
In fact if you follow the docker instructions to install, you *will* get some of docker installed but when you try to start the service it will bomb. | |
So how do we get around this? Trick yum (or dfn) into thinking we're running release 7. Then install Docker and Docker Compose. | |
============================= | |
Procedure |
Original goal:
Resources that helped significantly:
FROM node:10.16.3-alpine | |
# Golang From: https://github.com/docker-library/golang/blob/master/1.12/alpine3.10/Dockerfile | |
RUN apk add --no-cache \ | |
ca-certificates | |
# set up nsswitch.conf for Go's "netgo" implementation | |
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 | |
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf | |
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf |
from py2neo import Graph, Node, Relationship | |
graph = Graph( | |
host="alpha.graph.domain.co", | |
auth=('neo4j', 'thePassword-butBetter') | |
) | |
url="https://py2neo.org/v4/database.html#py2neo.database.Graph.delete_all" | |
a = Node("Type", url=url) | |
graph.merge(a, "Website", "url") |
import boto3 | |
def creation_table_scaling(table_name: str, key_name: str, key_type: str, max_read_capacity: int, max_write_capacity: int): | |
""" | |
Create table dynamodb and make it scale then wait for it to be created | |
Args: | |
table_name (str): the name of the table to create | |
key_name (str): the name of the key, and main attribute of the table | |
key_type (str): the data type for the attribute, S for string, N for number, B for binary | |
max_read_capacity(int) : Max nb of read per minute |
FROM ruby:2.4-alpine3.7 | |
# Install dependencies: | |
# - build-base: To ensure certain gems can be compiled | |
# - nodejs: Compile assets | |
# - postgresql-dev postgresql-client: Communicate with postgres through the postgres gem | |
# - libxslt-dev libxml2-dev: Nokogiri native dependencies | |
# - imagemagick: for image processing | |
RUN apk --update add build-base nodejs tzdata postgresql-dev postgresql-client libxslt-dev libxml2-dev imagemagick |
This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.
While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.
This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.
I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/
in my Dockerfiles, and also work from
isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/
.
At the end of the day, vendoring (and committing vendor/
) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:
#!/usr/bin/python | |
# Credit to frogor for the objc | |
from Foundation import NSBundle | |
import json | |
import objc | |
import os | |
import plistlib | |
import subprocess |
FFMPEG '-i', file, '-c:v', 'libopenjpeg', "jpeg2000\\" + name + ".jp2"\ | |
Convert image to jpeg2000 | |
ffmpeg -i in.png -c:v libopenjpeg out.jp2 | |
Hex Edit out.jp2 | |
ffmpeg -i in.jp2 -c:v png out.png | |
General Edit | |
ffmpeg -i input.avi -c:v mpeg2video -g 999 -q:v 1 output.avi | |
*edit in avidemux/whatever* |