Skip to content

Instantly share code, notes, and snippets.

@sowe
sowe / mongodbUtilitis.js
Last active December 17, 2015 22:58
MongoDB utilitis for PDI (Pentaho Data Integration)
function toDate (ts){
try{
if(! isNullAndUndefined(ts)){
var ps = mongoEvaluation(ts).$date;
var firstsplit = ps.split("T");
var date = firstsplit[0];
var time = firstsplit[1];
var datesplit = date.split("-");
var timesplit = time.split(":");
var secondsplit = timesplit[2].split(".");
package dynamic;
public class CustomDynamicSchema extends FilterDynamicSchemaProcessor implements DynamicSchemaProcessor {
public String username;
public SessionService sessionService;
@Autowired
public void setSessionService(SessionService sessionService){
this.sessionService = sessionService;
//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);
@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'=')
@sowe
sowe / basic_1nd_command.job
Created November 5, 2015 17:12
azkban josb
type=command
command=echo "basic_1st_command.job"
@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;
#!/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 / 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;
@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 / 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