Skip to content

Instantly share code, notes, and snippets.

View levi-turner's full-sized avatar

Levi Turner levi-turner

  • Qlik
  • Boston, MA
View GitHub Profile
@hrbrmstr
hrbrmstr / qualys.R
Last active October 11, 2017 20:15
get the Qualys SSL Labs rating for a domain+cert
library(RCurl)
library(XML)
library(plyr)
#' get the Qualys SSL Labs rating for a domain+cert
#'
#' @param site domain to test SSL configuration of
#' @param ip address of \code{site} (will resolve it and take\cr
#' first response if not specified, but that may not always work as you expect)
#' @param hide.results ["on"|"off"] should the results show up in the SSL Labs history (default "on")
set RecCount = 500000000; // Number of records to generate
Data:
load
chr(round(25 * rand() + 65)) & chr(round(25 * rand() + 65)) & chr(round(25 * rand() + 65)) as Customer, // Customer name between AAA and ZZZ
chr(round(25 * rand() + 65)) as Product, // Product name between A and Z
round(3 * Rand() + 2008) as Year, // Year between 2008 and 2011
round(1000000 * Rand()) as Actual, // Actual Revenue between 0 and 1,000,000
round(1000000 * Rand()) as Target // Target Revenue between 0 and 1,000,000
autogenerate(RecCount);
@IronistM
IronistM / dynamically_changing_SQL_statement.qvs
Created November 11, 2013 10:42
This code sets variables to define a time period (previous calendar month) dynamically changing the SQL statement sent to source
let vLastMonth = Year(AddMonths(now(),-1)) & '-' & num(month(addmonths(now(),-1)),'00') & '-01';
// This gets the first of the previous month
let vThisMonth = Year(now()) & '-' & num(month(now()),'00') & '-01';
// This gets the first of the current month
ODBC CONNECT TO MyDSN; // Change to your database
LOAD *;
SQL SELECT