Skip to content

Instantly share code, notes, and snippets.

@lita
lita / fix_git_remote_origins.sh
Created February 27, 2018 18:45
Fix remote origins
set -e
for f in *; do
if [[ -d $f ]]; then
echo $f;
cd $f;
git remote get-url origin | grep -q '^https://' && git remote set-url origin "$(git remote get-url origin | sed 's|https://github.com/|[email protected]:|')" && echo 'updated!';
cd ..;
fi
done
@lita
lita / timestamps.py
Last active March 16, 2018 00:28
Python Timestamp shit
import datetime
past_limit_date = datetime.datetime.now() + datetime.timedelta(-7)
prod_ts = 1521028848183
prod_ds = datetime.utcfromtimestamp(prod_ts/1000)
@lita
lita / update_curl.sh
Last active April 18, 2020 02:10
How to update curl to a later version
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.69.1.tar.bz2
@lita
lita / config_dump.json
Created August 16, 2020 22:58
Example dump with vanilla enovy
root@accounts-d6969df4b-kflzx:/# curl 0:9901/config_dump
{
"configs": [
{
"@type": "type.googleapis.com/envoy.admin.v3.BootstrapConfigDump",
"bootstrap": {
"node": {
"hidden_envoy_deprecated_build_version": "923c4111bb48405ac96ef050c4f59ebbad3d7761/1.14.4/Clean/RELEASE/BoringSSL",
"user_agent_name": "envoy",
"user_agent_build_version": {
@lita
lita / istio_config_dump.json
Created August 17, 2020 00:27
Istio's Config Dump
{
"configs": [
{
"@type": "type.googleapis.com/envoy.admin.v2alpha.BootstrapConfigDump",
"bootstrap": {
"node": {
"id": "sidecar~10.52.4.8~productpage-v1-6c6c87ffff-mvmbd.default~default.svc.cluster.local",
"cluster": "productpage.default",
"metadata": {
"ISTIO_PROXY_SHA": "istio-proxy:5f5d621c9fd0b68e12c8e1b95db849588fbdc475",
@lita
lita / istio_config_dump.json
Created August 17, 2020 00:27
Istio's Config Dump
{
"configs": [
{
"@type": "type.googleapis.com/envoy.admin.v2alpha.BootstrapConfigDump",
"bootstrap": {
"node": {
"id": "sidecar~10.52.4.8~productpage-v1-6c6c87ffff-mvmbd.default~default.svc.cluster.local",
"cluster": "productpage.default",
"metadata": {
"ISTIO_PROXY_SHA": "istio-proxy:5f5d621c9fd0b68e12c8e1b95db849588fbdc475",