This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dask.distributed import Client, progress | |
client = Client(threads_per_worker=8, n_workers=2) | |
client | |
import urllib | |
import requests | |
import aiohttp | |
from pprint import pprint | |
import dask | |
import dask.dataframe as dd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select /*+ 2 buckets */ ora_hash(last_name,1) the_hash, last_name from customers where rownum <= 10; | |
THE_HASH LAST_NAME | |
---------- -------------------------------------------------- | |
1 Brown | |
0 Riddell | |
0 Lawrence | |
1 Bartlett | |
1 Kenny | |
0 Williams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import requests | |
import aiohttp | |
from pprint import pprint | |
# disable SSL warnings | |
import urllib3 | |
urllib3.disable_warnings() | |
#df = dd.read_csv(filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE TYPE clob_rec AS OBJECT ( | |
num_characters number, | |
the_clob clob | |
); | |
CREATE OR REPLACE TYPE clob_tbl AS TABLE OF clob_rec; | |
select * FROM TABLE(clob_tbl_fn(30000)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SPLUNK_HOST=localhost | |
HEC_PORT=8088 | |
HEC_TOKEN=ba8e11d0-0a1f-4f41-a5c6-c660e8655b02 | |
HEC_PROTOCOL=http | |
file_name=`hostname`"_"$(date '+%Y-%m-%d_%H.%M.%S')".json" | |
host_name=`hostname` | |
epoc_time=`date +%s` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function docker_exec { | |
name="${1?needs one argument}" | |
containerId=$(docker ps | awk -v app="$name" '$2 ~ app{print $1}') | |
if [[ -n "$containerId" ]]; then | |
docker exec -it $containerId bash | |
else | |
echo "No docker container with name: $name is running" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_container_id { | |
name="${1?needs one argument}" | |
containerId=$(docker ps | awk -v app="$name" '$2 ~ app{print $1}') | |
if [[ -n "$containerId" ]]; then | |
echo ${containerId} | |
else | |
echo "No docker container with name: $name is running" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function docker_exec { | |
name="${1?needs one argument}" | |
containerId=$(docker ps | awk -v app="$name" '$2 ~ app{print $1}') | |
if [[ -n "$containerId" ]]; then | |
docker exec -it $containerId bash | |
else | |
echo "No docker container with name: $name is running" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT regexp_replace(xml3,'(.+),.+$','{\1}',1,1,'n') xml4 | |
FROM | |
(SELECT regexp_replace(xml2,'<(\w+)>(.+)</\1>','"\1" : "\2",',1,0,'n') xml3 | |
FROM | |
(SELECT regexp_replace(xml,'(^.+<ROW>)(.*)(</ROW>.*)','\2',1,1,'n') xml2 | |
FROM | |
(SELECT dbms_xmlgen.getXML('SELECT * from soe.customers where rownum=1') xml | |
FROM dual | |
) | |
) |
NewerOlder