Skip to content

Instantly share code, notes, and snippets.

View drewrothstein's full-sized avatar

Drew Rothstein drewrothstein

View GitHub Profile
@drewrothstein
drewrothstein / console
Last active March 6, 2020 06:19
Google Service Account Setup
drew@mini ~ $ gcloud --project aws-bill-analyzer iam service-accounts create billanalyzerkeys
Created service account [billanalyzerkeys].
drew@mini ~ $ gcloud --project aws-bill-analyzer iam service-accounts keys create key.json \
--iam-account billanalyzerkeys@aws-bill-analyzer.iam.gserviceaccount.com
created key [...] of type [json] as [key.json] for [billanalyzerkeys@aws-bill-analyzer.iam.gserviceaccount.com]
drew@mini ~ $ gcloud --project aws-bill-analyzer kms keyrings create billanalyzer --location global
ERROR: (gcloud.kms.keyrings.create) FAILED_PRECONDITION: Google Cloud KMS API has not been used in this project before, or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudkms.googleapis.com/overview?project=... then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
@drewrothstein
drewrothstein / expo.json
Created January 21, 2019 18:24
Expo: Firebase Console `json`
{
"project_info": {
"project_number": "1234567890",
"firebase_url": "https://yourapp.firebaseio.com",
"project_id": "yourapp",
"storage_bucket": "yourapp.appspot.com"
},
"client": [
{
"client_info": {
@drewrothstein
drewrothstein / expo.json
Created January 21, 2019 18:22
Expo: Google Developer Console `json`
{
"installed": {
"client_id": "1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com",
"project_id": "yourapp",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"redirect_uris": [
"urn:ietf:wg:oauth:2.0:oob",
"http://localhost"
@drewrothstein
drewrothstein / expo.plist
Created January 21, 2019 18:20
Expo: Firebase Console `plist`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>ca-app-pub-1234567890/1234567890</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>ca-app-pub-1234567890/1234567890</string>
<key>CLIENT_ID</key>
<string>1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com</string>
@drewrothstein
drewrothstein / expo.plist
Created January 21, 2019 18:17
Expo: Google Developer Console `plist`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.1234567890-abcdefghijklmnopqrstuvwxyz</string>
<key>PLIST_VERSION</key>
<string>1</string>
@drewrothstein
drewrothstein / stringdefs
Created May 23, 2018 15:40
ETL_IM_STUPID
ETL_IM_STUPID Eudora does not support enough of the Translation Services API for this.
@drewrothstein
drewrothstein / trans.c-util.c
Created May 23, 2018 15:36
TO_UPP_OR_NOT_TO_UPP
#define TO_UPP_OR_NOT_TO_UPP(proc) (HaveOSX() ? proc : proc##UPP)
...
/************************************************************************
* HaveOSX - are we running Mac OS X or bettter
************************************************************************/
Boolean HaveOSX(void)
{
return GetOSVersion() >= 0x1000;
@drewrothstein
drewrothstein / StringDefs.h-pop.c
Created May 23, 2018 15:25
kerberos: meaningless
#define KERBEROS_FAKE_PASS 9620 /*meaningless*/ //Meaningless argument to Kerberos password
...
#ifdef TWO
if (kerb4)
GetRString(args,KERBEROS_FAKE_PASS);
else
#endif
PCopy(args,(*CurPers)->password);
//-------------------------------------------------------------------------
// DemoExpired
//
// This routine is called every time we wish to make sure this demo version as not yet
// expired.
//
// Depending on the code returned by TimeStampValid, the demo may have expired.
// If the current date is past the demo expiration date, or if the current date
// is _before_ the date the demo was first run, then the demo has expired.
//-------------------------------------------------------------------------
/**********************************************************************
* Code to prevent virus scanners and other stupid software from
* screwing us up when we're decoding IMAP messages.
*
* IMAP downloads its messages to a temp file in the spool folder.
* During idle time, Eudora goes through the Spool folder looking
* for these temp files. When one is found, the messages are decoded
* and placed in the proper IMAP mailbox. The temp file is then erased
*
* Now the bad part: certain virus scanners like Norton AnitVirus