Skip to content

Instantly share code, notes, and snippets.

View belenaj's full-sized avatar

Jorge belenaj

View GitHub Profile
// ...
def endDate = new Date().clearTime() // today
def startDate = endDate - 30
def newDateParsed
startDate.upto(endDate) {
newDateParsed = it.format("yyyy-MM-dd")
println(newDateParsed)
@belenaj
belenaj / docker-run-root.sh
Created February 28, 2019 16:31
Run docker with shell as root
docker run -u 0 -it myImage:tag bash
IMPORT INTO mytable
FROM LOCAL SECURE CSV
FILE /file.csv
(1, 2 FORMAT = 'YYYY-MM-DD', 3..12)
ENCODING = 'ASCII'
ROW SEPARATOR = 'LF'
SKIP = 1;
COMMIT;
SELECT *
FROM customer
WHERE country = '${VAR_COUNTRY}'
@belenaj
belenaj / Sql-utils
Last active June 14, 2018 12:05
Dynamic SQL statement to replace the path of one or more Oracle Directories || #directory #oracle #sql
.
@belenaj
belenaj / split-file.md
Last active September 9, 2020 09:05
[How to split a file by size but keeping full lines] #bash #file
@belenaj
belenaj / size-aws-bucket.md
Last active June 7, 2018 11:56
How to get the size of an Amazon S3 bucket

s4cmd is the fastest way I've found (a command-line utility written in Python):

pip install s4cmd

Now to calculate the entire bucket size using multiple threads:

s4cmd du -r s3://bucket-name

@belenaj
belenaj / createBigXML.sh
Created April 6, 2018 10:32
Creates a XML Dummy File of with a specific number of rows in the body. Includes header and footer
#!/bin/bash
iterations=100000
fileName=myFile.xml
# header
echo "<?xml version="1.0" encoding="UTF-8"?>
<file>
<veryBig>
<wantedTag>Hello World</wantedTag>
@belenaj
belenaj / remove-orphaned-raw-images.py
Created December 9, 2017 09:22 — forked from pklaus/remove-orphaned-raw-images.py
Do you own a DSLR? If so, do you transfer your images to your computer, then look at the JPEGs and delete the crappy ones? If you do, your RAW images may be leftover. This Python script helps you cleaning up your image folders after deleting unwanted JPEGs. See http://blog.philippklaus.de/2012/12/cleaning-leftover-raw-images-after-selecting-imag…
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
Written on 2012-12-12 by Philipp Klaus <philipp.l.klaus →AT→ web.de>.
Check <https://gist.github.com/4271012> for newer versions.
Also check <https://gist.github.com/3155743> for a tool to
rename JPEGs according to their EXIF shot time.
"""