Skip to content

Instantly share code, notes, and snippets.

View agonen's full-sized avatar
🏠
Working from home

agonen

🏠
Working from home
View GitHub Profile
@agonen
agonen / bobp-python.md
Created January 19, 2017 14:10 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@agonen
agonen / choco.txt
Created February 28, 2016 07:59
list of choco install pacakges
7zip 15.14
7zip.install 15.14
autohotkey 1.1.23.01
autohotkey.install 1.1.23.01
autohotkey.portable 1.1.23.01
chocolatey 0.9.9.11
ChocolateyGUI 0.13.2
ConEmu 16.2.22.0
curl 7.28.1
ditto 3.21.30.0
@agonen
agonen / examples
Created September 9, 2014 00:41
python scripts lets
d = datetime.date(1992,1,1)
i = 1
delta = datetime.timedelta(days=30)
while d <= datetime.date(1998,11,1):
print("subpartition sitem",i," values less than (to_date('", d.strftime("%Y-%m-%d"), "','YYYY-MM-DD')),", sep="")
d += delta
i += 1
@agonen
agonen / googledrive
Last active August 29, 2015 14:05 — forked from mhawksey/gist:1658408
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@agonen
agonen / tips.sql
Last active January 26, 2020 15:37
oracle pl\sql ,sql tips
exec DBMS_PARALLEL_EXECUTE.DROP_TASK('mytask');
exec DBMS_PARALLEL_EXECUTE.CREATE_TASK ('mytask');
exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('mytask', 'BOND', 'BOND_ACTIVE_LIST', true, 100);
-- make sure the the sql statment in parameter 2 is correct (no error will return if the sql is not correct
exec DBMS_PARALLEL_EXECUTE.RUN_TASK('mytask', 'begin for i in (select * from bond_active_list where rowid between :start_id AND :end_id) loop datafeed_mgr.InsertHistBondDateRange(i.BOND_ID) ; end loop; end;', DBMS_SQL.NATIVE,parallel_level => 10);
time -p curl --header "j_username:yyy" --header "j_password:xxxx" http://fe.p.prod.primo.saas.exlibrisgroup.com:1701/cer/data/METADATA/PNX/prquest
@agonen
agonen / print_table.sql
Created May 19, 2014 16:16
print_table.sql
-- taken from http://orasql.org/2013/04/02/sqlplus-tips-2/
-- show output
set termout on
-- but without echo
set echo off
-- without newpage on start:
set embedded on
-- scrolling control
set pause on
-- two lines between rows:
#!/bin/bash
set -e
. CONFIG
#create swap file
sudo dd if=/dev/zero of=/swapfile bs=1024 count=256k
sudo mkswap /swapfile
sudo swapon /swapfile
# Satisfy the prerequisites for Oracle 11g and install the binaries
@agonen
agonen / query.sql
Last active August 29, 2015 13:58
data guard
alter system set db_create_online_log_dest_1='+DATA_EM01' scope=both sid='*';
alter system set db_create_online_log_dest_2='+SHALOMBBX' scope=both sid='*';
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 4;
alter database drop logfile group 5;
alter database drop logfile group 6;
alter database drop logfile group 7;
@agonen
agonen / awk gits
Last active August 29, 2015 13:58
generate unique number
##load data
#!/bin/bash
for i in {2..100}; do
echo gerante data $i
time -p awk -v val=$i 'BEGIN{n=val*1000000}$1=n++' FS=, OFS=, /ebs/tmpdata/tranactions.csv >/run/csv/tranactions.csv
echo load data $i
time -p /home/ubuntu/MonetDB-11.18.0/bin/mclient -d p32 -s "COPY 1000000 OFFSET 2 RECORDS INTO transactions FROM ('/run/csv/tranactions.csv') USING DELIMITERS ',','\n','\"';"
done