- https://www.docker.com/toolbox
docker-machine create --driver virtualbox dev
docker-machine env dev
(add values to~/.zshrc
)- e.g.
echo eval "$(docker-machine env dev)" >> ~/.zshrc
- e.g.
docker-machine ls
docker ps
(might need to re-source.zshrc
file; e.g.. ~/.zshrc
)docker run hello-world
docker-machine ip dev
docker-machine stop dev
docker-machine start dev
This file contains hidden or 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
sudo mount.vboxsf -o fmode=777,dmode=777,uid=1000,gid=1000 /sharename /vagrant |
This file contains hidden or 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
#List vms | |
VBoxManage list vms | |
#get status of time sync | |
VBoxManage getextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled | |
#NOTE: Make sure to restart the VM after changing these settings. | |
#disable time sync | |
VBoxManage setextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 1 |
This file contains hidden or 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 | |
# defone globals | |
LOOP_COUNT=20 | |
QUOTE_API_BASE_URL=https://lite.uat.travelguard.com/sml | |
TIME_NAME_LOOKUP=0 | |
TIME_APP_CONNECT=0 | |
TIME_CONNECT=0 | |
TIME_REDIRECT=0 |
This file contains hidden or 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 | |
# Stop all containers | |
docker stop $(docker ps -a -q) | |
# Delete all containers | |
docker container prune | |
# Delete all volumes | |
docker volume prune |
This file contains hidden or 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
<?php | |
/* | |
* This script will get country codes for a list of ips | |
*/ | |
$url = 'http://ip2country.hackers.lv/api/ip2country?ip='; | |
$ips = ['11.12.13.14']; | |
unlink('ip-country.csv'); | |
$file = fopen("ip-country.csv", "w") or die("Unable to open file!"); | |
This file contains hidden or 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
{ | |
"createdAt": "2017-12-20 06:13:11", | |
"updatedAt": "2017-12-20 06:13:31", | |
"status": 10, | |
"trackId": "e1a2ab6c-aea7-4fba-af02-0608d1f5abdc", | |
"customerId": "", | |
"storeId": 58, | |
"groupId": 2, | |
"products": [ | |
{ |
There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.
So, these are the different settings we are going to compare:
- Go HTTP standalone (as the control group)
- Nginx proxy to Go HTTP
- Nginx fastcgi to Go TCP FastCGI
- Nginx fastcgi to Go Unix Socket FastCGI
This file contains hidden or 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
func buildEmailInput(source, destination, subject, message string, | |
csvFile []byte) (*ses.SendRawEmailInput, error) { | |
buf := new(bytes.Buffer) | |
writer := multipart.NewWriter(buf) | |
// email main header: | |
h := make(textproto.MIMEHeader) | |
h.Set("From", source) |