Skip to content

Instantly share code, notes, and snippets.

@evanphx
evanphx / gist:9361755
Created March 5, 2014 05:24
rubygems.org usage for March 4th
50.31.185.0/24 938700 network
64.90.32.0/24 665667 ip-64-90-32-0.dreamhost.com
74.201.198.0/24 657985 (unknown)
199.182.120.0/24 594236 (unknown)
173.247.96.0/24 467705 (unknown)
128.238.64.0/24 254235 (unknown)
212.164.232.0/24 251259 b-internet.212.164.232.0.nsk.rt.ru
147.243.10.0/24 242733 (unknown)
111.69.238.0/24 235282 0.238.69.111.dynamic.snap.net.nz
199.91.170.0/24 201058 (unknown)

Keybase proof

I hereby claim:

  • I am evanphx on github.
  • I am evanphx (https://keybase.io/evanphx) on keybase.
  • I have a public key whose fingerprint is EDFB D4B0 AFF8 4CBA 30F0 8B81 EAE4 8DA5 E365 F367

To claim this, I am signing this object:

def read(n)
start:
while true
offset = @buffer.current_offset
# If we can't update the offset, someone else did it at the same time,
# go again.
next if cas(&@buffer.current_offset, offset, offset+n)
# If the buffer contains all the data we need, return it!
def show
# puts "==================="
puts(File.readlines("/proc/self/status").grep(/^VmRSS/))
end
i = 0
big = (1024 ** 2)
p big
evan@mirror01:~$ traceroute 54.252.170.220
traceroute to 54.252.170.220 (54.252.170.220), 30 hops max, 60 byte packets
1 vsh0017.iad01.blueboxgrid.com (199.91.171.7) 0.075 ms 0.012 ms 0.011 ms
2 gi2-1.br01.iad01.bbgrp.net (199.91.168.9) 0.324 ms 0.375 ms 0.428 ms
3 xe-5-3-3.edge2.Washington1.Level3.net (4.79.22.125) 0.908 ms 0.907 ms 0.895 ms
4 vlan90.csw4.Washington1.Level3.net (4.69.149.254) 6.364 ms vlan80.csw3.Washington1.Level3.net (4.69.149.190) 6.206 ms vlan60.csw1.Washington1.Level3.net (4.69.149.62) 6.312 ms
5 ae-72-72.ebr2.Washington1.Level3.net (4.69.134.149) 6.473 ms ae-92-92.ebr2.Washington1.Level3.net (4.69.134.157) 6.963 ms ae-72-72.ebr2.Washington1.Level3.net (4.69.134.149) 6.452 ms
6 ae-48-48.ebr2.Washington12.Level3.net (4.69.202.62) 7.168 ms ae-45-45.ebr2.Washington12.Level3.net (4.69.143.222) 6.770 ms ae-38-38.ebr1.NewYork2.Level3.net (4.69.201.86) 6.399 ms
7 ae-47-47.ebr1.NewYork1.Level3.net (4.69.201.45) 6.063 ms ae-58-58.ebr1.NewYork1.Level3.net (4.69.20
@evanphx
evanphx / gist:28f486c67c30bc94efb7
Created July 18, 2014 19:31
packer amazon-ebs security group errors
zero :: config/packer> packer build -only=amazon-ebs vm.json
amazon-ebs output will be in this color.
==> amazon-ebs: Creating temporary keypair: packer 53c975ff-7621-655b-eecc-c0362fd9d8e2
==> amazon-ebs: Creating temporary security group for this instance...
==> amazon-ebs: Authorizing SSH access on the temporary security group...
==> amazon-ebs: Launching a source AWS instance...
==> amazon-ebs: Error launching source instance: The security group 'sg-d304b9b6' does not exist in VPC 'vpc-a14728ca' (InvalidGroup.NotFound)
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Deleting temporary keypair...
@evanphx
evanphx / gist:c1f90fec7a893178b462
Created August 7, 2014 18:12
Artifactory treating rubygems.org like a maven server
54.236.207.133 - - [07/Aug/2014:18:10:30 +0000] "HEAD /pd4ml/pd4ml_fonts/3.80/pd4ml_fonts-3.80-javadoc.jar HTTP/1.1" 404 0 "-" "Artifactory/3.2.2"
54.236.207.133 - - [07/Aug/2014:18:10:30 +0000] "HEAD /net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-javadoc.jar HTTP/1.1" 404 0 "-" "Artifactory/3.2.2"
54.236.207.133 - - [07/Aug/2014:18:10:30 +0000] "HEAD /org/apache/xmlgraphics/batik-ext/1.7/batik-ext-1.7-sources.jar HTTP/1.1" 404 0 "-" "Artifactory/3.2.2"
54.236.207.133 - - [07/Aug/2014:18:10:31 +0000] "HEAD /org/apache/xmlgraphics/batik-util/1.7/batik-util-1.7-sources.jar HTTP/1.1" 404 0 "-" "Artifactory/3.2.2"
54.236.207.133 - - [07/Aug/2014:18:10:31 +0000] "HEAD /org/apache/xmlgraphics/batik-util/1.7/batik-util-1.7-javadoc.jar HTTP/1.1" 404 0 "-" "Artifactory/3.2.2"
54.236.207.133 - - [07/Aug/2014:18:10:31 +0000] "HEAD /org/codehaus/woodstox/stax2-api/3.1.1/stax2-api-3.1.1-javadoc.jar HTTP/1.1" 404 0 "-" "Artifactory/3.2.2"
54.236.207.133 - - [07/Aug/2014:18:10:32 +0000] "HEAD /commons-httpclient/common
@evanphx
evanphx / important.rb
Created August 8, 2014 17:37
bitjockies draft order selection algorithm
urls = %w!
https://www.youtube.com/watch?v=lYIRO97dhII
https://www.youtube.com/watch?v=IM2MCCd-EnA
https://www.youtube.com/watch?v=LkCNJRfSZBU
https://www.youtube.com/watch?v=FtW7eaSvd6A
https://www.youtube.com/watch?v=sTSA_sWGM44
https://www.youtube.com/watch?v=21OH0wlkfbc
https://www.youtube.com/watch?v=e2jjCMgGOYw
https://www.youtube.com/watch?v=b2LseRItJb4
!
@evanphx
evanphx / gist:dba97762fda80610269f
Created August 13, 2014 18:28
gem_permadelete
#!/bin/sh
if [ -z "$1" ]; then
echo "gem_permdelete <gem name>"
exit 1
fi
echo "Connecting to rubygems.org..."
exec ssh -t -C app02.production.rubygems.org "cd /applications/rubygems/current && sudo -u deploy ./script/permadelete $1"
class TestMe
def run
3 + 4
end
end
TestMe.new.run