Program runs using 2.6.9 without any dependencies:
#!/user/bin/env python
"""
An example python 2.6 script which takes arguments and logs to console/file.
"""
import logging
function MakeNegative() { | |
var spreadsheet = SpreadsheetApp.getActive(); | |
var activeRange = spreadsheet.getActiveRange(); | |
var values = activeRange.getValues(); | |
values.forEach(function(row, rowId) { | |
row.forEach(function(col, colId) { | |
values[rowId][colId] = Math.abs(values[rowId][colId]) * -1; | |
}); | |
}); |
# Profile setup instructions: http://www.howtogeek.com/50236/customizing-your-powershell-profile/ | |
# Create inside WindowsPowerShell folder | |
echo "Profile loaded from $profile" | |
#cd C:\git | |
# Set environment variables | |
#$env:MAVEN_OPTS = "-Xmx512m" | |
#$env:MAVEN_VERSION = "3.3.9" | |
#$env:JAVA_HOME = "C:\Program Files\Java\jdk1.8.0_92" | |
#$env:M2_HOME = "C:\Apps\apache-maven-$($env:MAVEN_VERSION)" |
FNR > 6 { | |
print $1 | |
} |
#!/bin/bash | |
PARENT_DIR=$1 | |
if [ -z "${PARENT_DIR}" ]; then | |
echo Missing 1 parameter for HDFS parent directory | |
exit 1 | |
fi | |
hdfs dfs -ls ${PARENT_DIR} | awk '{ print $8}' | sed '/^\s*$/d' > dirs.txt | |
echo ' DIR_COUNT FILE_COUNT CONTENT_SIZE PATHNAME' | |
while read dir; do | |
hdfs dfs -count -h $dir |
# Get-EvengLog doesn't quite work I guess: | |
# https://stackoverflow.com/questions/31396903/get-eventlog-valid-message-missing-for-some-event-log-sources# | |
# Get-EventLog Application -EntryType Error -Source "DistributedCOM" | |
# The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID | |
#$logs = Get-EventLog -LogName "System" -EntryType Error -Source "DCOM" -Newest 1 -Message "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID*" | |
# 2 is error | |
# 3 is warning | |
$EVT_MSG = "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID" | |
# Search for System event log ERROR entries starting with the specified EVT_MSG | |
$logEntry = Get-WinEvent -FilterHashTable @{LogName='System'; Level=2} | Where-Object { $_.Message -like "$EVT_MSG*" } | Select-Object -First 1 |
SSH_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initialising new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null | |
/usr/bin/ssh-add; | |
} |
#!/bin/bash | |
# Run a groovy script | |
# argument should be path to .groovy file | |
HIVEDIR="/usr/hdp/current/hive-client/lib" | |
# Include log4j properties in the classpath so we can do logging | |
JAVACP="log4j.properties" | |
# Need groovy-all jar to run groovy scripts | |
JAVACP="$JAVACP:$HIVEDIR/groovy-all-2.1.6.jar" | |
JAVACP="$JAVACP:$HIVEDIR/log4j-1.2.16.jar" | |
java -cp $JAVACP groovy.ui.GroovyMain $1 |
# ------------------------------------------------------------------------ | |
# | |
# NAME: CreatePartitions.ps1 | |
# AUTHOR: Kit Menke | |
# DATE: 2016-05-13 | |
# | |
# COMMENTS: | |
# Create SSAS partions for a table in a tabular model. | |
# Must be run with sqlps. | |
# |