Skip to content

Instantly share code, notes, and snippets.

View ccondry's full-sized avatar

Coty Condry ccondry

  • Cisco Systems
  • Texas
View GitHub Profile
@ccondry
ccondry / node-fetch-ignore-cert.js
Created February 1, 2021 20:34
disable SSL cert checking for 1 request
const fetch = require('node-fetch');
const https = require('https');
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
});
const response = await fetch(url, {
method: 'POST',
headers: headers,
@ccondry
ccondry / update-tls.txt
Created December 15, 2020 19:19
enable TLS 1.1 and 1.2 on Windows Server 2008 R2
check supported protocols on LDAP: "nmap -p 636 --script +ssl-enum-ciphers ad1.dcloud.cisco.com"
info from https://community.progress.com/s/article/How-to-Enable-TLS-1-1-TLS-1-2-on-Windows-Server-2008-R2
create new keys "TLS 1.1" and "TLS 1.2" under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols
create new keys "Client" and "Server" under both new TLS keys
create DWORD value "DisabledByDefault" = 0 under each Client and Server folder (so 4 times)
create DWORD value "Enabled" = 1 under each Client and Server folder (so 4 times)
@ccondry
ccondry / sleep.js
Last active December 14, 2020 18:26
sleep function for javascript ES6
function sleep (milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
@ccondry
ccondry / change-visudo-editor.sh
Created December 11, 2020 17:49
change visudo default editor
sudo update-alternatives --config editor
@ccondry
ccondry / webex-authorized-devices.txt
Created December 11, 2020 00:14
authorized devices and integrations for Cisco / webex account
https://idbroker.webex.com/idb/profile#/tokens
@ccondry
ccondry / sliter-io-gamepad.js
Created December 1, 2020 16:20
enable gamepad support on slither.io game. works with PS4 and similar controllers.
javascript:!function(){if("getGamepads"in navigator){var t=function(){var e=navigator.getGamepads()[0];if(e){var a=e.axes[0],i=e.axes[1];Math.sqrt(a*a+i*i)<.1&&(a=i=0),xm=100*a,ym=100*i,setAcceleration(e.buttons[0].value);var n=mc.getContext("2d");n.save(),n.beginPath(),n.strokeStyle=e.buttons[0].value?"white":"lightGreen",n.arc(xm+mc.width/2,ym+mc.height/2,8,0,2*Math.PI),n.stroke(),n.restore()}window.requestAnimationFrame(t)};t()}}(); void(0);
@ccondry
ccondry / use-test.sh
Last active November 25, 2020 00:38
use test branch
# go to demo-ui project
cd /opt/dcloud/demo-ui
# reset permissions to administrator user
chown -R administrator:administrator *
chown -R administrator:administrator .git/*
# go to demo-api project
cd ../demo-api
# reset permissions to administrator user
chown -R administrator:administrator *
chown -R administrator:administrator .git/*
@ccondry
ccondry / inscription.razor
Created November 7, 2020 04:58
UO Razor script for inscription
!Loop
Assistant.Macros.IfAction|1|1|70
Assistant.Macros.HotKeyAction|0|Restock Agent-1
Assistant.Macros.AbsoluteTargetAction|0|0|1149617594|930|2341|18|3651
Assistant.Macros.PauseAction|00:00:03.5000000
Assistant.Macros.DoubleClickTypeAction|4031|True
Assistant.Macros.WaitForGumpAction|949095101|False|300
Assistant.Macros.GumpResponseAction|9|0|0
Assistant.Macros.PauseAction|00:00:05.1500000
Assistant.Macros.HotKeyAction|0|Organizer Agent-1
@ccondry
ccondry / install-yarn.sh
Created October 28, 2020 17:46
install yarn
# as root
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
apt update
apt install yarn
@ccondry
ccondry / browserDownloadText.js
Created October 28, 2020 02:11
make the browser download a plaintext file instead of rendering it
<a href="data:text/plain;charset=utf-8,encodeURIComponent(text)" download="all.zip">
function downloadText (text) {
// create anchor
element = document.createElement('a')
// set the href to URI-encoded plaintext data
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text))
// set the filename the browser will use as default when starting download
element.setAttribute('download', 'myfile.txt')
// keep the element hidden when placed into body
element.style.display = 'none'