Skip to content

Instantly share code, notes, and snippets.

View mariash's full-sized avatar

Maria Shaldybin mariash

  • Cloud Foundry
  • San Francisco, CA
View GitHub Profile
@mariash
mariash / main.go
Last active January 16, 2024 21:18
Golang ReverseProxy race condition
package main
import (
"bytes"
"io"
"net/http"
"net/http/httptrace"
"net/http/httputil"
"net/url"
"time"
@mariash
mariash / ipv6-vm.tf
Created February 15, 2023 23:40
Spin up ubuntu 20.04 with ipv6 on GCP
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.52"
}
}
}
variable "project_id" {
diff --git a/agent/bootstrap.go b/agent/bootstrap.go
index 6e6a97f8..3944aa24 100644
--- a/agent/bootstrap.go
+++ b/agent/bootstrap.go
@@ -4,8 +4,10 @@ import (
"encoding/json"
"errors"
"fmt"
+ "os"
"path"
- name: warp-drive-deploy-cf-deployment
serial_groups: [warp-drive-cf-deployment]
plan:
- get: candidate-lock
passed: [candidate]
trigger: true
- in_parallel:
- get: deployments-diego
resource: warp-drive-config
- get: diego-release
@mariash
mariash / gist:3dbb3801ed763ac3f3176852d2e345cc
Created August 22, 2016 16:39
Simulate delayed and dropped packets on Linux
Emulating wide area network delays
This is the simplest example, it just adds a fixed amount of delay to all packets going out of the local Ethernet.
# tc qdisc add dev eth0 root netem delay 100ms
Now a simple ping test to host on the local network should show an increase of 100 milliseconds. The delay is limited by the clock resolution of the kernel (Hz). On most 2.4 systems, the system clock runs at 100 Hz which allows delays in increments of 10 ms. On 2.6, the value is a configuration parameter from 1000 to 100 Hz.
Later examples just change parameters without reloading the qdisc
Real wide area networks show variability so it is possible to add random variation.
@mariash
mariash / tcp_proxy
Created August 19, 2016 22:22
tcp_proxy
#!/usr/bin/env ruby
require "socket"
class ConnectionProxy
def initialize(remote_host, remote_port, listen_port)
@max_threads = 32
@threads = []
@server_sockets = {}
@mariash
mariash / test-release.sh
Last active August 29, 2015 14:24
consourse-loop
#!/usr/bin/env bash
source /etc/profile.d/chruby.sh
chruby 2.1.6
total_counter=0
success_counter=0
fail_counter=0
cd bosh-src
@mariash
mariash / main.go
Created June 23, 2015 14:17
Packages sharing the same dependency
package main
import (
"github.com/cloudfoundry/bosh-utils/retrystrategy"
"github.com/pivotal-golang/clock"
)
func main() {
clock.Clock
retrystrategy.Clock
@mariash
mariash / gist:d1964168411a67e9d867
Created November 4, 2014 05:12
Setting up port forwarding
https://github.com/cloudfoundry/bosh-lite/blob/master/templates/vagrant-aws.tpl#L63
@mariash
mariash / gist:9f14d8e87f180acc0b3b
Last active August 29, 2015 14:06
Rspec skip in before(:all) exits with 1

→ cat test_spec.rb

describe "hello" do
  before do
    skip "skipped"
  end
  it "works" do
  end
end