See also, http://libraryofalexandria.io/cgo/
cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.
So, Here collect materials.
See also, http://libraryofalexandria.io/cgo/
cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.
So, Here collect materials.
| #!/usr/bin/python | |
| import requests | |
| import os | |
| import boto.ec2 | |
| import sys | |
| import re | |
| build_url = os.environ['BUILD_URL'] | |
| jenkins_base_url = os.environ['JENKINS_URL'] |
| #!/usr/bin/env ruby | |
| # List all keys stored in memcache. | |
| # Forked from bkimble's gist https://gist.github.com/bkimble/1365005 | |
| # Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
| # Currently resides at https://gist.github.com/ginjo/aaa4a4395fcdbbad3d29 | |
| # | |
| # This fork separates the server query code from results presentation. | |
| # The primary function of this script is to return an array of hashes of | |
| # key items from any number of provided memcached servers. |
| function calculateDistance(rssi) { | |
| var txPower = -59 //hard coded power value. Usually ranges between -59 to -65 | |
| if (rssi == 0) { | |
| return -1.0; | |
| } | |
| var ratio = rssi*1.0/txPower; | |
| if (ratio < 1.0) { |
| # One side, change the address by a digit and reverse the outside ip addresses for the other side | |
| auto gre1 | |
| iface gre1 inet static | |
| address 10.10.10.10 # inside side a address | |
| netmask 255.255.255.0 | |
| pre-up ip tunnel add gre1 mode gre remote 173.230.145.76 local 173.230.147.224 #remote external ip local external ip | |
| post-down ip tunnel del gre1 |
| #!/usr/bin/env ruby | |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| output = {} | |
| s_json = JSON.parse(Net::HTTP.get_response(URI.parse('http://localhost:8500/v1/catalog/services')).body) | |
| services = s_json.keys.reject{|k| k == 'consul'} | |
| services.each do |srv| |
Being a cheapass student, I couldn't resist to try to win a free entrance to [Area41 Security Conference][3] (don't mix with Alcoholics Anonymous Area 41 in Nebraska) after spotting @gandro23 retweet about the conference and the challenge.
The challenge starts after downloading and extracting a [binary][1]. A quick look
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| def archive_to_bytes(archive): | |
| def to_seconds(s): | |
| SECONDS_IN_A = { | |
| 's': 1, | |
| 'm': 1 * 60, | |
| 'h': 1 * 60 * 60, |
| # In Chef, when a resource is defined all its variables are evaluated during | |
| # compile time and the execution of the resource takes place in converge phase. | |
| # So if the value of a particular attribute is changed in converge | |
| # (and not in compile) the resource will be executed with the old value. | |
| # Example problem: | |
| # Let's consider this situation where there are two steps involved in a recipe | |
| # Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed | |
| # in converge phase | |
| # Step 2 is a Chef resource that makes use of the node attribute that was |
| #!/bin/bash | |
| if [ "$1" == "-h" ]; then | |
| cat <<END | |
| AWS AutoScaling Termination Helper: | |
| terminate an instance in an auto scaling group | |
| Usage: $0 {group-name} | |
| END |