Skip to content

Instantly share code, notes, and snippets.

View Blackmist's full-sized avatar

Larry Franks Blackmist

  • Microsoft
  • Belmont, NC
View GitHub Profile
@Blackmist
Blackmist / pre-commit
Created May 13, 2021 14:52
git pre-commit hook to block commits that have URLs containing 'en-us'
#!/bin/sh
#
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
@Blackmist
Blackmist / add-cert-vpn-gateway.sh
Last active February 18, 2021 17:54
scripts for secure workspace
echo "updating VPN gateway with client IP pool and root cert"
az network vnet-gateway update -g $RG \
-n $GATEWAY \
--address-prefixes $VPN_CLIENT_ADDR \
-o none
# Upload the cert
az network vnet-gateway root-cert create -g $RG \
--gateway-name $GATEWAY \
-n 'rootcert' \
--public-cert-data rootcert.cer \
@Blackmist
Blackmist / stormextlib.sh
Created December 6, 2017 13:50
script to copy various jars to the extlib for Storm on HDInsight
#!/bin/bash -x
sudo cp -f /usr/hdp/current/hadoop-client/*.jar /usr/hdp/current/storm-client/extlib
sudo cp -f /usr/hdp/current/hadoop-client/lib/*.jar /usr/hdp/current/storm-client/extlib
sudo cp -f /usr/hdp/current/hadoop-hdfs-client/*.jar /usr/hdp/current/storm-client/extlib
sudo cp -f /usr/hdp/current/hadoop-hdfs-client/lib/*.jar /usr/hdp/current/storm-client/extlib
sudo cp -f /usr/hdp/current/storm-client/contrib/storm-hbase/storm-hbase*.jar /usr/hdp/current/storm-client/extlib
sudo cp -f /usr/hdp/current/phoenix-client/lib/phoenix*.jar /usr/hdp/current/storm-client/extlib
sudo cp -f /usr/hdp/current/hbase-client/lib/hbase*.jar /usr/hdp/current/storm-client/extlib
@Blackmist
Blackmist / bashexample.sh
Created June 5, 2017 13:42
Create and insert data into a Hive table using REST
# This example assumes you are using an HDInsight cluster.
# It was tested with HDInsight 3.5, but probably works on anything around/after that.
# the name of the HDInsight login account. Usually admin
LOGINNAME='admin'
PASSWORD='password for the login account'
# Just the name, not the FQDN
CLUSTERNAME='the name of your HDInsight cluster'
@Blackmist
Blackmist / gist:2ec2cd2f523fb41849d4
Created February 17, 2016 12:12 — forked from francoishill/gist:6483997
Media queries for mobile devices - Requires at least requires the meta viewport tag with content 'width=device-width'
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
/* PORTRAIT:
Windows Surface Pro*/
}
@media only screen and (max-width: 800px) and (orientation : portrait) {
/* PORTRAIT:
Acer Iconia Tab A100
@Blackmist
Blackmist / example.hql
Last active August 29, 2015 14:16
A Hive UDF in C# (for HDInsight)
add file wasb:///HiveUDF.exe;
SELECT TRANSFORM (clientid, devicemake, devicemodel)
USING 'HiveUDF.exe' AS
(clientid string, phoneLabel string, phoneHash string)
FROM hivesampletable
ORDER BY clientid LIMIT 50;
@Blackmist
Blackmist / web.config
Created September 15, 2014 14:10
custom web.config for IISNode, using ./bin/application as the entrypoint
<?xml version="1.0" encoding="utf-8"?>
<!--
This configuration file is required if iisnode is used to run node processes behind
IIS or IIS Express. For more information, visit:
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
-->
<configuration>
<system.webServer>
@Blackmist
Blackmist / 40-azuretable.html
Last active August 29, 2015 13:56
Node-Red output node for Windows Azure Table Storage.
<script type="text/x-red" data-template-name="azure table">
<div class="form-row">
<label for="node-input-tablename"><i class="icon-tasks"></i> Table</label>
<input type="text" id="node-input-tablename" placeholder="Table name">
</div>
<div class="form-row">
<label for="node-input-storageaccount"><i class="icon-tag"></i> Account</label>
<input type="text" id="node-input-storageaccount" placeholder="storage account">
</div>
<div class="form-row">
@Blackmist
Blackmist / gist:6701556
Created September 25, 2013 15:41
web.config for iisnode and ghost
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="index.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
<match url="iisnode" />
@Blackmist
Blackmist / gist:5586562
Created May 15, 2013 19:18
Sample .ftppass
{
"key1": {
"username": "website\\username",
"password": "website password"
}
}