Skip to content

Instantly share code, notes, and snippets.

@pjaudiomv
pjaudiomv / GetLangs.php
Last active September 18, 2022 02:39
Get BMLT Server Langs
<?php
$ret = null;
$uri = 'https://latest.aws.bmlt.app/main_server/client_interface/json/?switcher=GetServerInfo';
$data = file_get_contents($uri);
if ($data) {
$ret = array();
@pjaudiomv
pjaudiomv / timezones.php
Last active September 18, 2022 03:39
Get All Timezones PHP
<?php
$timezones_array = DateTimeZone::listIdentifiers();
foreach ($timezones_array as $tzItem) {
echo $tzItem . "\n";
}
@pjaudiomv
pjaudiomv / bmlt2kml.php
Last active May 6, 2023 18:55
bmlt2kml.php
<?php
/*
bmlt2kml.php
This file converts a JSON BMLT GetSearchResults query to KML
To use run `php bmlt2kml.php` or place on your webserver and
specify a query param with a url encoded bmlt query url.
https://domain.com/bmlt2kml.php?query=https%3A%2F%2Flatest.aws.bmlt.app%2Fmain_server%2Fclient_interface%2Fjson%2F%3Fswitcher%3DGetSearchResults%26services%3D1010%26weekdays%3D2
*/
$cli_query = null;
@pjaudiomv
pjaudiomv / bmlt2csv.php
Created September 9, 2022 20:52
bmlt2csv.php
<?php
/*
bmlt2csv.php
This file converts a JSON BMLT GetSearchResults query to a CSV
To use run `php bmlt2csv.php` or place on your webserver and
specify a query param with a url encoded bmlt query url.
https://domain.com/bmlt2csv.php?query=https%3A%2F%2Flatest.aws.bmlt.app%2Fmain_server%2Fclient_interface%2Fjson%2F%3Fswitcher%3DGetSearchResults%26services%3D1010%26weekdays%3D2
*/
$cli_query = null;
@pjaudiomv
pjaudiomv / bmlt-json-2-kml.php
Created September 8, 2022 19:11
BMLT JSON 2 KML
<?php
$bmlt_server = "https://latest.aws.bmlt.app/main_server";
$search_query = "&services=1010&weekdays=2";
$query_url = urldecode($bmlt_server . "/client_interface/json/?switcher=GetSearchResults" . $search_query);
$result = '';
if (str_contains($query_url, "/client_interface/json/?switcher=GetSearchResults")) {
$meetings = file_get_contents($query_url);
$meetings = json_decode($meetings, true);
@pjaudiomv
pjaudiomv / github_ssh_keys.tf
Created August 26, 2022 01:48
GitHub User SSH Keys
data "http" "users" {
for_each = toset(var.github_users)
url = "https://api.github.com/users/${each.value}/keys"
request_headers = {
Accept = "application/json"
}
}
variable "github_users" {
@pjaudiomv
pjaudiomv / gist:254c36db2575706167f4445409e32ab8
Created July 11, 2022 19:47
Convert boto3 tags to a dict
tags = [
{'Key': 'Environment', 'Value': 'staging'},
{'Key': 'Name', 'Value': 'STAGING TOOLS'}
]
tag_dict = {tag['Key']: tag['Value'] for tag in tags}
# {
# "Environment": "staging",
# "Name": "STAGING TOOLS"
@pjaudiomv
pjaudiomv / meetings-by-venue-type.php
Last active April 11, 2021 04:42
BMLT Get Meetings By Venue Type
<?php
$root_server = "https://my.root-server.org/main_server";
$meetings = json_decode(file_get_contents("$root_server/client_interface/json/?switcher=GetSearchResults"), true);
$console_color = true;
$tempvirtual = 0;
$virtual = 0;
$inperson = 0;
@pjaudiomv
pjaudiomv / bmlt-emails.php
Created February 21, 2021 05:14
Get All Emails from BMLT Server (Requires Authentication)
<?php
$root_server = "https://my.root-server.org/main_server";
$bmlt_login_id = "";
$bmlt_login_password = "";
$login = get("$root_server/local_server/server_admin/json.php?c_comdef_admin_login=$bmlt_login_id&c_comdef_admin_password=$bmlt_login_password&admin_action=login");
$meetings = json_decode(get("$root_server/client_interface/json/?switcher=GetSearchResults&data_field_key=contact_email_1,contact_email_2,email_contact"), true);
$service_bodies = json_decode(get("$root_server/client_interface/json/?switcher=GetServiceBodies"), true);
@pjaudiomv
pjaudiomv / lambda-debug
Last active November 24, 2020 04:06
lambda-debug
2020-11-24T03:45:37.195Z [DEBUG] plugin.terraform-provider-aws_v3.17.0_x5: 2020/11/24 03:45:37 [DEBUG] [aws-sdk-go] DEBUG: Validate Response lambda/GetFunctionCodeSigningConfig failed, attempt 0/25, error AccessDeniedException:
2020-11-24T03:45:37.195Z [DEBUG] plugin.terraform-provider-aws_v3.17.0_x5: status code: 403, request id: 219fsd-ff81-4ba4-a7dc-58zasb9289
2020/11/24 03:45:37 [ERROR] eval: *terraform.EvalRefresh, err: error getting Lambda Function (test-lambda) code signing config AccessDeniedException:
status code: 403, request id: 2sfg74-ff81-4ba4-a7dc-58dgf5b9289
2020/11/24 03:45:37 [ERROR] eval: *terraform.EvalSequence, err: error getting Lambda Function (test-lambda) code signing config AccessDeniedException:
status code: 403, request id: 21sgf4-ff81-4ba4-a7dcgdf0805b9289
2020/11/24 03:45:37 [DEBUG] [aws-sdk-go] {}