Skip to content

Instantly share code, notes, and snippets.

@sowe
sowe / rasterize.js
Created December 30, 2017 19:47
generate pdf
"use strict";
var page = require('webpage').create(),
system = require('system'),
address, output, size, pageWidth, pageHeight;
if (system.args.length < 3 || system.args.length > 5) {
console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]');
console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"');
console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px');
console.log(' "800px*600px" window, clipped to 800x600');
phantom.exit(1);
@sowe
sowe / BasicETLChack.sh
Last active December 12, 2017 18:25
Script para hacer una check basico a las etl
#!/bin/bash
set -e
set -u
readonly CAMELCASE='\b[A-Z]+(_[A-Z]+)*\b';
readonly SANKCASE='\b[A-Z]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\b';
FULL_OK="false"
function _console(){
@sowe
sowe / pentaho_backup.sh
Last active November 14, 2019 11:13
shell scrtip for backup and restore pentaho system
#!/bin/bash
# Maintain for @sowe Rafael Valenzuela <ravamo@gmail.com>
# redcloverbi.wordpress.com for more information
# basic backup and restore script for pentaho in Production enviroment doc
# https://help.pentaho.com/Documentation/6.1/0P0/000/020
# https://help.pentaho.com/Documentation/6.1/0P0/000/Backup_and_Restore_Pentaho_Repositories
set -e
set -u
@sowe
sowe / apache_status
Last active February 10, 2019 22:39
script apache status
#!/bin/bash
# https://i-heart-geek.blogspot.com.es/2011/10/top-command-line-tips-apache-access-log.html?m=1
# http://www.the-art-of-web.com/system/logs/
ip = ifconfig | awk '/inet addr/{print substr($2,6)}'
clear
while :
do
echo "1) Most Common 404s (Page Not Found)"
echo "2) Count requests by HTTP code"
echo "3) Largest Images"
@sowe
sowe / querys.sql
Last active April 8, 2016 20:51
Database creation and Samples Querys about Vertica Workshop
\set ON_ERROR_STOP on
--MEDIAN:
select * from allsales order by sales;
SELECT state, name, sales, MEDIAN(sales) OVER () AS
median FROM allsales order by state;
#!/bin/sh
#
# azkaban This shell script takes care of starting and stopping
# the azkaban
#
# Source function library
. /etc/rc.d/init.d/functions
@sowe
sowe / dafault
Created January 1, 2016 13:40
ngixn_tomcat_compres
#/etc/nginx/sites-enabled/default
server {
listen 80;
server_name redcloverbi.com;
root /etc/tomcat7/webapps/apple;
proxy_cache one;
location / {
proxy_set_header X-Forwarded-Host $host;
@sowe
sowe / basic_1nd_command.job
Created November 5, 2015 17:12
azkban josb
type=command
command=echo "basic_1st_command.job"
@sowe
sowe / hell_kichen.sh
Last active August 29, 2015 14:22
HellKichen Shell script to run a ETL process v1.2
#!/bin/bash
# The user's home directory
USER_HOME=$(eval echo ~${SUDO_USER})
FILE=${USER_HOME}/.kettel/kettle_config.properties
# time
NOW=$(date +"%d%m%Y_%H%M%S")
NOW_TIME=$(date +"%d/%m/%Y")" "$(date +"%H:%M:%S")
LOG=$NOW_$3.log
pdi=$(grep -i 'PATH_TO_DATA_INTEGRATION' $FILE | cut -f2 -d'=')
//Script here
var io =isUndefined (e(io),0).number;
var mp =isUndefined (e(mp),0).number;
var tmp;
eval("tmp = " + creatives);
var n =isUndefined (n,0);