Skip to content

Instantly share code, notes, and snippets.

View jasonhildebrand's full-sized avatar

Jason Hildebrand jasonhildebrand

View GitHub Profile
@jasonhildebrand
jasonhildebrand / ssh-update-key
Created August 31, 2022 17:06
Update the ssh key in authorized_keys file on remote server, adding a new preferred key and removing a deprecated one
#!/bin/bash
# The use case is that I have an 1024-bit RSA key which I have used for many years to access many remote servers.
# I want to stop using it (don't load it into my ssh-agent), and instead use my new ED25519 key.
# I need a convenient way to update the authorized_keys file on a remote server.
# This solution is tested and working on Ubuntu 20.04 host
# It works on many distributions/versions of remote servers, including Ubuntu 16.04/18.04/22.04 and CentOS 7.9.
# Instructions:
@jasonhildebrand
jasonhildebrand / freshdesk-sso.py
Last active January 8, 2023 05:45 — forked from pbertera/freshdesk-sso.py
Freshdesk Single sign-on in Python
import time
import hashlib
import hmac
import urllib
def get_sso_url(email, name, base_url, key, redirect_url=None, phone=None, company=None):
"""This function returns the Freshdesk SSO URL.
email - the name of the user you are logging in to freshdesk. Does not need an existing account in freshdesk,
as it will be created on-the-fly if necessary.