Skip to content

Instantly share code, notes, and snippets.

View erdii's full-sized avatar
🪤

Josh Gwosdz erdii

🪤
View GitHub Profile
@erdii
erdii / ensure_pip
Last active July 18, 2020 22:11
import functions
ensure_pip() {
pip show "$1" > /dev/null || pip install "$1"
}
@erdii
erdii / README.md
Last active March 28, 2020 23:53
vlan interface with NetworkManager on Ubuntu Desktop 19.10

generate uuid

uuidgen -r

rights and location

# /etc/NetworkManager/system-connections $ ls -l vlan20
-rw------- 1 root root 145 Mär 28 18:27 vlan20
@erdii
erdii / aws.yaml
Last active March 22, 2021 18:20
allow an entity to: log into ecr and push images intp a specific repo, then create/update a task-definition, and then create/update a service in a specific ecs cluster
# place into .github/workflows/aws
# This workflow will build and push a new container image to Amazon ECR,
# and then will deploy a new task definition to Amazon ECS, on every push
# to the master branch.
#
# To use this workflow, you will need to complete the following set-up steps:
#
# 1. Create an ECR repository to store your images.
# For example: `aws ecr create-repository --repository-name my-ecr-repo --region us-east-2`.
# Replace the value of `ECR_REPOSITORY` in the workflow below with your repository's name.
@erdii
erdii / node-cache_clone-engine-bench.js
Created October 25, 2019 17:28
just something for demonstration
const NodeCache = require("node-cache");
const obj = {
_id: "5c7e533ce75227089bd93bbb",
texts: [
{ keywords: ["hi", "there"], language: "FR", title: "Art", description: "" },
{ keywords: [], language: "EN", title: "Art", description: "" },
],
extension: "jpg",
fileDate: "2019-03-18T17:38:52.553Z",
@erdii
erdii / copy_elasticsearch_index_to_other_server.sh
Last active December 28, 2022 10:43
Copy an elasticsearch index definition (settings and mapping - no data) to another server
# copy index definition
INDEX_NAME="my_index"
curl -X GET "http://source-server:9200/$INDEX_NAME" | curl -X PUT "http://destination-server:9200/$INDEX_NAME" -d @-
# copy mapping for "my_doc_type"
DOC_TYPE="my_doc_type"
curl -X GET "http://source-server:9200/$INDEX_NAME/_mapping" | jq .$INDEX_NAME.mappings.$DOC_TYPE | curl -X PUT "http://destination-server:9200/$INDEX_NAME/_mapping/$DOC_TYPE" -d @-
@erdii
erdii / nginx_sni_upstream.conf
Last active February 13, 2019 10:42
nginx proxy request to HTTPS SNI upstream
location /api {
# enable SNI
proxy_ssl_server_name on;
# you MUST set the host header seperately for SNI to work
proxy_set_header Host my-api.example.com;
# proxy requests to upstream server
proxy_pass https://my-api.example.com;
}
@erdii
erdii / global_ssh_agent.sh
Created July 14, 2018 18:35
global ssh-agent on ubuntu 16.04 with gnome 3 and systemd
# create a user service for our ssh-agent
mkdir -p .config/systemd/user/
cat > .config/systemd/user/ssh-agent.service <<EOF
[Unit]
Description=SSH key agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
@erdii
erdii / install_vcenter_vcsa.md
Last active September 4, 2019 10:47
Install vCenter Server Appliance 6.5 without hash mismatch error!

Install VCSA 6.5 without hash mismatch error!

requirements

  • esxi host
  • dns or ip for both - esx and vcenter
  • correct time settings (ntp automates this, can be enabled on the esx-host)
  • use vcsa-cli installer (the iso contains vcsa-cli for win/lin/mac os)
  • "skipManifestCheck": "true" because of reasons (the installer repeatedly failed to verify integrity hashes of the created vm)
  • "os.password" and "sso.password" HAVE to pass vmware's pw rules PLUS their dictionary! (verification will pass with a pw in their dictionary but setup will not be able to complete! - we stumbled across this by pure chance after trying for 2 whole days!)
@erdii
erdii / setup_my_dev_mac.sh
Last active May 10, 2019 07:42
initial setup for my development mac - including goodies such as: local .test-domains, nginx, password-safe, docker, vpn-client, keybase, markdown-editor, vscode and more
#!/bin/bash
set -e
SCREENSHOT_PATH="~/Pictures/Screenshots"
printf "save screenshots in $SCREENSHOT_PATH\n"
mkdir $SCREENSHOT_PATH && cd $SCREENSHOT_PATH && defaults write com.apple.screencapture location $(pwd)
printf "install homebrew!\n"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@erdii
erdii / howToModifyOvaFile.md
Created January 11, 2018 10:02 — forked from goodjob1114/howToModifyOvaFile.md
how to modify .ova file on linux/Mac using terminal....export vm (OVF 1.0) from virtualbox, then modify some tag and hash value for import vm to ESXi

extract ova files from an archive

$ tar -xvf vmName.ova

modify ovf for some invalid tag

$ vi vmName.ovf