Skip to content

Instantly share code, notes, and snippets.

View ccondry's full-sized avatar

Coty Condry ccondry

  • Cisco Systems
  • Texas
View GitHub Profile
{
"470": {
"firstname": "John",
"lastname": "Smith",
"userid": 470,
"email": "[email protected]",
"username": "johnsmith",
},
"350": {
"firstname": "Chris",
@ccondry
ccondry / ctrlkey.js
Created May 2, 2016 22:07
Detect keypress for keyboard combination CTRL + any key.
/*
Originally from http://www.gmarwaha.com/blog/2009/06/16/ctrl-key-combination-simple-jquery-plugin/
*/
$.ctrl = function(key, callback, args) {
$(document).keydown(function(e) {
if(!args) args=[]; // IE barks when args is null
if(e.keyCode == key.charCodeAt(0) && e.ctrlKey) {
callback.apply(this, args);
return false;
}
function addToGroup(client, dn) {
var groupDn = "CN=MyGroup,OU=groups,DC=mydomain,DC=com";
var change = new ldap.Change({
operation: 'add',
modification: {
member: [dn]
}
});
client.modify(groupDn, change, function(err, res) {
@ccondry
ccondry / nginx-load-balance.conf
Created May 9, 2019 16:04
nginx proxy load balance config
/etc/nginx/nginx.conf, inside http section:
# load balance web requests to cs-manager and cs-manager-2
upstream csmanager {
ip_hash;
server 198.19.253.32;
server 198.19.253.49;
}
@ccondry
ccondry / close-ece-activities.md
Created December 4, 2019 20:26
Close open or stuck ECE activities

Close open or stuck ECE activities

  1. Find the open activity IDs by running this SQL query against the ECE eGActiveDb database in MSSQL Management Studio:
SELECT * FROM egpl_casemgmt_activity 
WHERE activity_status !=9000 
AND assigned_to= (SELECT user_id FROM egpl_user WHERE user_name LIKE 'georgmcc')
@ccondry
ccondry / sleep.js
Created December 6, 2019 17:45
async sleep for JavaScript
function sleep (ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
@ccondry
ccondry / ldaps-log.sh
Created January 8, 2020 16:50
reveal ldaps certificate information
#!/bin/sh
openssl s_client -connect servername:636
@ccondry
ccondry / update-adfs-trust.ps1
Created January 14, 2020 16:32
update AD FS relying party trust certificate
Update-AdfsRelyingPartyTrust -MetadataFile C:\Temp\sp.xml -TargetName cuic1.dcloud.cisco.com
@ccondry
ccondry / get-public-ip.sh
Created January 23, 2020 19:08
get public IP
#!/bin/sh
dig +short myip.opendns.com @resolver1.opendns.com
# or use the following:
# dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
@ccondry
ccondry / open-campaign-logs.bat
Created March 16, 2020 16:06
dump CCE process log to text file and open text file
cdlog pcce la
dumplog /o /hr 1 CampaignManager
CampaignManager.txt