This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"io" | |
"net/http" | |
"net/http/httptrace" | |
"net/http/httputil" | |
"net/url" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
google = { | |
source = "hashicorp/google" | |
version = "~> 4.52" | |
} | |
} | |
} | |
variable "project_id" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "socket" | |
class ConnectionProxy | |
def initialize(remote_host, remote_port, listen_port) | |
@max_threads = 32 | |
@threads = [] | |
@server_sockets = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# NPM_0_6_12=~/.nvm/v0.6.12/bin/npm NPM_0_6_8=~/.nvm/v0.6.8/bin/npm ./npm-install-problem.sh | |
# Install module with npm from node v0.6.12 and then use npm from node v0.6.8 to rebuild it and see it fail | |
# + exit code is 0 with the force option even on failure | |
# Npm saves install information in package.json so next time npm build is run on package with different configuration it may fail | |
$NPM_0_6_12 install bcrypt@0.7.2 | |
cd ./node_modules/bcrypt | |
# package.json was updated with scripts -> install that looks like "node-gyp rebuild" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy with preserve updates metadata of file and if file that symlink points to has not been copied yet it fails | |
require "fileutils" | |
`mkdir ./src` | |
`touch ./src/foo` | |
# Important that symlink name goes before source name in alphabetical order (bar points to foo) | |
`ln -s ./src/foo bar` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open('/tmp/f','w'){|f| f << 'sekrit'} | |
f = open('/tmp/f') | |
exec("ruby -e 'p IO.open(#{f.fileno}).read'") | |
# Prints 'sekrit' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
NewerOlder