This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
here=$( cd "$( dirname "$0")" && /bin/pwd ) | |
docker build \ | |
--build-arg=http_proxy=http://192.168.99.1:3128 \ | |
--rm=true \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
name=$( basename "$0" .bash ) | |
set -e | |
set -x | |
docker run --rm --name "$name" -e http_proxy=http://192.168.99.1:3128 "$name":latest yum list "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$alias = 'jdoe' | |
$recipient = Get-Recipient $alias | |
$dn = $recipient.DistinguishedName | |
$filter = "Members -like ""$dn""" | |
Get-DistributionGroup -Filter $filter | |
<# Results: | |
Name DisplayName GroupType PrimarySmtpAddress | |
---- ----------- --------- ------------------ | |
Staff Staff Universal, SecurityEnabled staff@example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* See https://support.microsoft.com/en-us/kb/2807779 | |
* <blockquote> | |
* To create an X500 proxy address for the old | |
* LegacyExchangeDN attribute for the user, make the | |
* following changes based on the recipient address in | |
* the NDR: | |
* <ol> | |
* <li>Replace any underscore character (_) with a slash character (/).</li> | |
* <li>Replace "+20" with a blank space.</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# gist -r a055587699858a9b2980 | diff -u - update_various_packages | |
# gist -u a055587699858a9b2980 update_various_packages | |
set -e | |
_saved_path=$PATH | |
# brew doctor does not like pyenv: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, xmltodict, json | |
def xml2json(input=sys.stdin, output=sys.stdout): | |
json.dump(xmltodict.parse(input), output) | |
if __name__ == '__main__': | |
xml2json() |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION ST_Force_2D(GEOGRAPHY) | |
RETURNS GEOGRAPHY | |
AS 'SELECT ST_Force_2D($1::geometry)::GEOGRAPHY' | |
LANGUAGE SQL IMMUTABLE STRICT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name=box | |
cat "$name.gltf" \ | |
| jq -r 'leaf_paths | if .[length-1] == "uri" then join(".") else empty end' \ | |
| while read p ; do | |
cat "$name.gltf" \ | |
| jq -r ".$p" \ | |
| sed -e 's/^[^,]*,//' \ | |
| base64 -d \ | |
> "$name.$p.out" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Github API token, so that homebrew doesn't hit such a low rate limit | |
if [ -r ${HOME}/.github/api_token ] ; then | |
export HOMEBREW_GITHUB_API_TOKEN=$(< ${HOME}/.github/api_token) | |
fi | |
# Per-user python modules-installed executables | |
export PATH=${HOME}/Library/Python/$(python -c 'from sys import version_info as v; print(".".join(map(str,v[0:2])))')/bin${PATH+:${PATH}} | |
# Need a readlink that works like on linux |