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
SERVER="dc1.us.yourcompany.com" | |
DN="CN=aUserLogin,OU=SomeOrgUnit,OU=AnotherOrgUnit,DC=dc1,DC=us,DC=yourcompany,DC=com" | |
PASSWORD="aUserLoginsPassword" | |
OU="ou=AnotherOrgUnit,dc=us,dc=yourcompany,dc=com" | |
ldapsearch -h "$SERVER" -p 389 \ | |
-x -D "$DN" -w "$PASSWORD" \ | |
-t -s sub -b "$OU" "(&(objectClass=user)(sAMAccountName=anotherUserLogin))" "thumbnailPhoto" | |
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
source 'http://rubygems.org' | |
gem 'rspec' |
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
# For instance, which users had the most occurrences of their name in logfile auth.log? | |
$ date; grep --only-matching "member=[^ ]*" auth.log | sort | uniq --count | sort -rn| head -8 | |
# grep -o, --only-matching -- Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line. | |
# uniq -c, --count -- Prefix lines by number of occurrences | |
# sort -rn, --reverse ... -n, --numeric-sort | |
Mon May 9 22:09:34 UTC 2016 | |
223163 member=some-user |
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 | |
# Cronic v2 - cron job report wrapper | |
# Copyright 2007 Chuck Houpt | |
CRONIC_LOG=${CRONIC_LOG:-/sitelogs/cronic/cronic.$LOGNAME.log} | |
CRONIC_LOCK=${CRONIC_LOCK:-/tmp/cronic.$LOGNAME.lock} | |
trim() { echo $1; } |
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
require 'httparty' | |
def outside_temp_f zip | |
# Only read the temp every ten minutes, or if no current-temperature-file established. | |
# | |
curr_temperature_fname = 'current-temperature-file' | |
if File.exists? curr_temperature_fname | |
age_in_seconds = DateTime.now.to_time.to_i - File.stat(curr_temperature_fname).mtime.to_time.to_i | |
# Is file less than ten minutes old? |
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
# | |
# $ token=my-personal-access-token bundle exec ruby repos_for_org.rb my-username some-org | |
# | |
require 'httparty' # Probly want a Gemfile for these | |
require 'json' | |
token = ENV['token'] | |
repo_fullnames = [] |
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
https://stackoverflow.com/questions/24698188/flatten-a-json-document-using-jq | |
I want to transform this... | |
{ | |
"Research Data Management": [ | |
{ | |
"id": 2597547, | |
"title": "Data Engineer, Research Data Management" | |
}, | |
{ |
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
Wed Jan 25 20:55:43 UTC 2023 |