Skip to content

Instantly share code, notes, and snippets.

View rvencu's full-sized avatar

Richard Vencu rvencu

View GitHub Profile
@rvencu
rvencu / cah_stats_spark.py
Created July 16, 2021 20:05 — forked from rom1504/a_cah_to_parquet_pyspark.md
cah_stats_spark.py
'''
Compute some stats on cah collection
First get the files with:
lynx -dump -hiddenlinks=listonly -nonumbers http://the-eye.eu/eleuther_staging/cah/ | grep cah | grep .csv > cah.csv
aria2c --dir=shards --auto-file-renaming=false --continue=true -i cah.csv -x 16 -s 16 -j 100
Takes a few minutes to run
Then pip install pyspark
Then run this file. It also takes a few minutes
'''
@rvencu
rvencu / call_history.sql
Created September 23, 2020 09:24
SQL command to retrieve call history from 3CX database
select C.*, PS.caller_number as Caller, PD.caller_number as Destination from cl_calls C
JOIN cl_segments S ON C.id = S.call_id
JOIN cl_party_info PS ON PS.id = S.src_part_id
JOIN cl_party_info PD ON PD.id = S.dst_part_id
where S.seq_order = 1
<#
Script to update new items for an exported/imported form
Must replace all exported form fields IDs with imported form fields IDs - copy the ForEach-Object line as necessary
Must replace old form id with new form id
insert latest exported xml
specify the date from which new items are to be imported
run the script
import the updated.xml file into the target site
#>
$filetoimport = 'clinicaivory-lakeview.formidable.2018-07-28.xml'