Skip to content

Instantly share code, notes, and snippets.

@oshri-humanz
oshri-humanz / copyAWSEnv.js
Last active April 4, 2021 14:56
AWS copy environment variables using js console
// Copy from lambda
let str="";document.getElementsByClassName("awsui-table-row").forEach(e=>{str+=e.innerText.split("\t").join("=")+";"});
let dummy=document.createElement("textarea");
document.body.appendChild(dummy),dummy.value=str,dummy.select(),document.execCommand("copy"),document.body.removeChild(dummy);
// Copy from EBS
let str="";document.querySelectorAll('.properties-table tbody tr').forEach(e=>{
let row = e.querySelectorAll('td input');
if(row && row.length===2 && row[0].value!=='' && row[1].value!==''){
str+=row[0].value +"=" + row[1].value + ";"}});
@oshri-humanz
oshri-humanz / wordpress_rest_api_new_post.py
Created May 27, 2020 17:58
Wordpress REST API create new post with image/media attachment (upload) using python
import requests
import json
import base64
import os
import mimetypes
#### defs ####
user = os.environ.get("WORDPRESS_API_USER", "")
pythonapp = os.environ.get("WORDPRESS_API_KEY", "")
url = os.environ.get("WORDPRESS_API_ENDPOINT", "")