Skip to content

Instantly share code, notes, and snippets.

View hurrifan1's full-sized avatar
🌇

Austin Spivey hurrifan1

🌇
View GitHub Profile
TMPDIR="/gisdata/temp/"
UNZIPTOOL=unzip
WGETTOOL="/usr/bin/wget"
export PGBIN=/usr/lib/postgresql/14/bin
export PGPORT=5432
export PGHOST=localhost
export PGUSER=$1
export PGPASSWORD=$2
export PGDATABASE=osm
PSQL=${PGBIN}/psql
@hurrifan1
hurrifan1 / mapping-1.yaml
Last active November 7, 2022 16:07
New mapping file for OSM import, includes infrastructure elements
tags:
load_all: true
tables:
power:
columns:
- name: osm_id
type: id
- name: geometry
type: geometry
- key: name
@hurrifan1
hurrifan1 / mapping.yaml
Created October 28, 2022 13:16
Mapping YAML file for OSM import
areas:
area_tags: [building, landuse, leisure, natural, aeroway]
linear_tags: [highway, barrier]
generalized_tables:
landusages_gen0:
source: landusages_gen1
sql_filter: ST_Area(geometry)>500000.000000
tolerance: 200.0
landusages_gen1:
source: landusages
@hurrifan1
hurrifan1 / Open app from QMC.js
Last active October 15, 2022 16:58
JavaScript bookmarklet for opening an app in a new tab when that app is highlighted in the QMC
(async function run() {
/**
* Here we check to make sure we're on the Apps page of the QMC.
* If we aren't on the Apps page, we exit the script with an
* error message.
*/
if (window.location.pathname.includes("/qmc/apps") != true) {
let msg = "Only use this in the QMC!";
console.log("####", msg);
alert(msg);
@hurrifan1
hurrifan1 / Stop-Start Qlik Services with PowerShell.ps1
Created April 27, 2021 20:24
Stop/Start Qlik Services with PowerShell
<# Start/Stop Qlik services in correct order:
1. Qlik Sense Repository Database (QRD)
2. Qlik Sense logging service
3. Qlik Sense Service Dispatcher (QSD)
4. Qlik Sense Repository Service (QRS)
...and in no particular order...
5. Qlik Sense Proxy Service (QPS)
6. Qlik Sense Engine Service (QES)
7. Qlik Sense Scheduler Service (QSS)
8. Qlik Sense Printing Service (QPR)
<#
# Migrate data connections
# ========================
#
# Requirements:
# - Qlik CLI tool (🔗 - https://github.com/qlik-oss/qlik-cli)
# - The ID of the data connection to migrate
#
# Steps:
# 1. Login to origin Qlik env.
@hurrifan1
hurrifan1 / Update DataTransfer load script.ps1
Last active March 18, 2022 14:29
Update DataTransfer load script
# Update DataTransfer load script
# Location of datasets.json file
$ds_path = "C:\ProgramData\Qlik\DataTransfer\DataUpload\storage\datasets.json"
# Get file contents as PSObject
$ds = Get-Content $ds_path | ConvertFrom-Json -Depth 20
# Narrow to relevant data connection
$aws_con = $ds | ? { $_.name -eq "AWS SQL Server test 1" }
/* REST error retry loop */
/* - This script will try to execute a subroutine 3 times before it finally fails. */
Set ErrorMode = 0;
SUB MySub
LIB CONNECT TO 'Server test';
[MyTable]:
SQL SELECT
@hurrifan1
hurrifan1 / Creating link and date tables in Qlik Sense.qvs
Created February 24, 2022 17:08
Creating link and date tables in Qlik Sense
@hurrifan1
hurrifan1 / AssignNPrintingRoles.ps1
Created December 16, 2021 14:41
Assign nPrinting roles with nPrinting CLI using PowerShell
<#
# # # # Assign nPrinting roles with nPrinting CLI using PowerShell # # # #
- Created by: Austin Spivey (aspivey@copleycg.com)
- Uses: https://github.com/QlikProfessionalServices/QlikNPrinting-CLI
- Last updated: 12/16/2021
-License: MIT
Copyright 2021 Austin Spivey (aspivey@copleycg.com)
#>