Skip to content

Instantly share code, notes, and snippets.

require 'fileutils'
Dir['test/**.jpg'].each do |f|
dirname = File.dirname(f)
filename = File.basename(f)
new_filename = filename.gsub(/IMG_([0-9]+)/, "reU-")
puts "#{dirname}/#{filename} => #{dirname}/#{new_filename}"
FileUtils.mv "#{dirname}/#{filename}", "#{dirname}/#{new_filename}"
end
### Keybase proof
I hereby claim:
* I am ianneub on github.
* I am ianneub (https://keybase.io/ianneub) on keybase.
* I have a public key ASBfrquH1MPI5aGa9lKPxv9opwiggox8AeQHrGMUiNy2mQo
To claim this, I am signing this object:
{
"error": {
"context": null,
"message": "The Response content must be a string or object implementing __toString(), "boolean" given.",
"code": 500,
"trace": [
"0 /opt/dreamfactory/bootstrap/cache/compiled.php(15601): Symfony\\Component\\HttpFoundation\\Response->setContent(false)",
"1 /opt/dreamfactory/bootstrap/cache/compiled.php(15114): Illuminate\\Http\\Response->setContent(Array)",
"2 /opt/dreamfactory/bootstrap/cache/compiled.php(15123): Symfony\\Component\\HttpFoundation\\Response->__construct(Array, 200, Array)",
"3 /opt/dreamfactory/vendor/dreamfactory/df-core/src/Utility/ResponseFactory.php(155): Symfony\\Component\\HttpFoundation\\Response::create(Array, 200, Array)",
auth:
image: 'ianneub/google-auth-proxy:latest'
command: '-upstream="http://kibana:5601/" -cookie-secret="asdfasdf" -http-address=0.0.0.0:80 -cookie-expire=8h0m0s'
environment:
- EMAIL_LIST=jdoe@domain.com\nasdf@domain.com
- OAUTH2_PROXY_CLIENT_ID=asdf-asdf.apps.googleusercontent.com
- OAUTH2_PROXY_CLIENT_SECRET=asdfasdf
- 'VIRTUAL_HOST=https://kibana.domain.com'
expose:
- '80'
2015-09-03T22:23:11.688470157Z [fix-attrs.d] applying owners & permissions fixes...
2015-09-03T22:23:11.689396833Z [fix-attrs.d] 00-runscripts: applying...
2015-09-03T22:23:11.703805774Z [fix-attrs.d] 00-runscripts: exited 0.
2015-09-03T22:23:11.704387739Z [fix-attrs.d] done.
2015-09-03T22:23:11.704634468Z [cont-init.d] executing container initialization scripts...
2015-09-03T22:23:11.705508118Z [cont-init.d] dns_init.sh: executing...
2015-09-03T22:23:11.707549089Z DNS hacks, initial hosts generation.
2015-09-03T22:23:11.713697966Z Contents of dnsmasq-resolv.conf
2015-09-03T22:23:11.713719432Z -------------------
2015-09-03T22:23:11.714421162Z nameserver 10.1.0.2
@ianneub
ianneub / run.py
Last active August 29, 2015 14:24
Link current service to target service w/Tutum
import os
import tutum
import string
import logging
import copy
import re
# requests_log = logging.getLogger("python-tutum")
# requests_log.setLevel(logging.INFO)
@ianneub
ianneub / tutum.yml
Created May 29, 2015 22:47
Cleaned up YAML from the blog post: Log Searching and Analysis with Tutum and an ELK - http://blog.tutum.co/2015/05/26/log-searching-and-analysis-with-tutum-and-an-elk-2/
elasticsearch-data:
image: 'alpine'
command: '/bin/true'
volumes:
- '/data/elasticsearch:/usr/share/elasticsearch/data'
elasticsearch:
image: 'elasticsearch:1.5'
ports:
- '9200:9200'
@ianneub
ianneub / crate.yml
Created April 30, 2015 19:30
Tutum.co stack yaml to create a crate.io cluster
proxy:
image: tutum/haproxy
environment:
- BACKEND_PORT=4200
ports:
- "4200:80"
links:
- crate
roles:
- global
@ianneub
ianneub / dssh
Last active August 29, 2015 14:19 — forked from kareemk/dssh
#!/usr/bin/env ruby
require 'net/http'
require 'json'
raise "Invalid arguments: dssh [container-name] [command=/bin/bash]" if ARGV.length < 1
service_name = "#{ARGV[0]}"
ARGV[1] ||= "/bin/bash"
command = ARGV[1..-1].join(' ')
$ curl -sSL http://deis.io/deisctl/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2377k 100 2377k 0 0 1091k 0 0:00:02 0:00:02 --:--:-- 1092k
Verifying archive integrity... All good.
Uncompressing Deis Control Utility 100%
Refreshed deis-builder.service from v0.15.0
Refreshed deis-cache.service from v0.15.0
Refreshed deis-controller.service from v0.15.0
Refreshed deis-database.service from v0.15.0