Skip to content

Instantly share code, notes, and snippets.

Jeremy Baker jbaker10

View GitHub Profile
View add_users_to_slack_group.py
import os
import csv
import json
import requests
from requests.auth import HTTPBasicAuth
user_emails = []
with open("/Users/jeremy.baker/Desktop/Members_03jtnz0s2flbciv_04122019_184656.csv", "r") as f:
csv_reader = csv.reader(f, delimiter=',')
@jbaker10
jbaker10 / gsuite_to_ad_sync.py
Created Oct 14, 2019
Code to help sync user 's from G Suite to Active Directory
View gsuite_to_ad_sync.py
# MIT License
# Copyright (c) 2019 Jeremy Baker
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
View google_group_conditionals.py
import yaml
from itertools import islice
user = {
"email": "jeremy.baker@domain.com",
"department": "Sales",
"title": "Senior Account Executive",
"location": "New York",
"salesRegion": "Americas",
"costCenter": "Enterprise Sales",
@jbaker10
jbaker10 / show_prompt.ps1
Created Aug 26, 2019
Show prompt in Windows 10
View show_prompt.ps1
Add-Type -AssemblyName PresentationCore,PresentationFramework
$ButtonType = [System.Windows.MessageBoxButton]::YesNo
$MessageboxTitle = “AppGate Upgrade Notice”
$Messageboxbody = “Corp IT needs to upgrade the AppGate client on your device. This upgrade will quit any running sessions of AppGate and may take a few minutes to complete. Are you ready to proceed?”
$MessageIcon = [System.Windows.MessageBoxImage]::Warning
$decision = [System.Windows.MessageBox]::Show($Messageboxbody,$MessageboxTitle,$ButtonType,$messageicon)
$decision
View rollback_workday.py
import json
import time
from httplib2 import Http
from apiclient import discovery, errors
from datadog import initialize, api
from datetime import datetime
from oauth2client.service_account import ServiceAccountCredentials
View GetZoom.ps1
########
## Edit the variables below as necessary
$url = "http://zoom.us/client/latest/ZoomInstallerFull.msi"
$output = "C:\Temp\Zoom.msi"
########
try {
## Kill the process if running
"Trying to quit the application if running"
Stop-Process -Name Zoom* -Force
View enroll_in_airwatch.ps1
$url = "https://storage.googleapis.com/getwsone-com-prod/downloads/AirwatchAgent.msi"
$output = "C:\Temp\AirWatchAgent.msi"
"Checking if temp dir exists, creating if not"
$path = "C:\Temp"
if(!(Test-Path -Path $path)){
"Creating temp directory"
New-Item -ItemType directory -Path $path
}
View promote_to_admin.ps1
"Getting currently logged in user"
$user = '{0}\{1}' -f $env:USERDOMAIN, $env:USERNAME
"Working with user account: " + $user
$user_members = Get-LocalGroupMember -Group Administrators
if ($user_members.Name -like $user) {
$user + " is already a member of the Administrators group"
}
View GetSlack.ps1
$path = "C:\Temp"
if(!(Test-Path -Path $path)){
"Creating C:\Temp"
New-Item -ItemType directory -Path $path
}
$url = "http://slack.com/ssb/download-win64-msi"
$output = "C:\Temp\slack.msi"
View fs_due_date_updater.py
#!/usr/bin/python
'''
A script to automate changing the Due Date of a ticket in FreshService
based on the "Start Date" entered into a Service Request. It will currently
only make the change to tickets that are assigned to the "Onboarding"
group, and those that have been recently updated (within the last hour).
It requires the "requests" library to be installed, which can be installed
by running "sudo easy_install requests".
'''
You can’t perform that action at this time.