Using ImageMagick:
convert picture.svg picture.png
Using qlmanage:
batch_size = 3 | |
l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | |
while l: | |
s = l[:batch_size] | |
print(s) | |
l = l[batch_size:] |
var _ = require('lodash'), | |
fs = require('fs'), | |
FormData = require('form-data'); | |
const PIPEDRIVE_API_TOKEN='REDACTED'; | |
function addFileToDeal(filePath, dealId) { | |
return new Promise((resolve, reject) => { | |
if (_.isNil(filePath) || filePath === '') { | |
reject(new Error('filePath must be set.')); |
'use strict'; | |
var Pipedrive = require('pipedrive'); | |
var pipedrive = new Pipedrive.Client(process.env.PIPEDRIVE_API_TOKEN, { strictMode: true }); | |
var params = { | |
"file_path": "/path/to/document.pdf", | |
"deal_id": 1 | |
}; | |
pipedrive.Files.add(params, (err, f) => { |
{ | |
"aggregations" : { | |
"avgSecondsBetweenClaims" : { "avg" : { "field" : "avgSecondsBetweenClaims" } } | |
} | |
} |
JSON=/Users/scott/src/geojson/us-states-20m.json
TARGET=data/prod-es/states.json
cat $JSON | jq -c '.features[] | { _index: "service-areas", _type: "state", _id: .properties.STATE , _source: { id: .properties.STATE, geoId: .properties.GEO_ID, serviceAreaType: "State", name: .properties.NAME, stateId: .properties.STATE, geometry: .geometry }}' > $TARGET
#!/bin/bash | |
# Create a new self-signed cert that is good for a year | |
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 | |
# Strip the passphrase from the cert | |
openssl rsa -in key.pem -out newkey.pem && mv newkey.pem key.pem |
#!/bin/sh | |
handler() { | |
echo "Caught SIGTERM signal" | |
exit $((15+128)) | |
} | |
i=0; | |
trap 'handler' SIGTERM | |
while [ $i -lt 600 ]; do |
#!/bin/bash | |
# see https://securityreliks.wordpress.com/2010/08/20/devtcp-as-a-weapon/ | |
echo "Waiting for ${HOST}:${PORT} to become available" | |
while : | |
do | |
(echo > /dev/tcp/${HOST}/${PORT}) >/dev/null 2>&1 | |
available=$? | |
if [[ $available -eq 0 ]]; then | |
echo "Service on ${HOST}:${PORT}" is available |