Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
var https = require('https'); | |
var util = require('util'); | |
exports.handler = function(event, context) { | |
console.log(JSON.stringify(event, null, 2)); | |
console.log('From SNS:', event.Records[0].Sns.Message); | |
var postData = { | |
"channel": "#aws-sns", | |
"username": "AWS SNS via Lamda :: DevQa Cloud", |
class MyJob < ActiveJob::Base | |
queue_as :urgent | |
rescue_from(NoResultsError) do | |
retry_job wait: 5.minutes, queue: :default | |
end | |
def perform(*args) | |
MyService.call(*args) | |
end |
#!/usr/bin/env ruby | |
# List all the (known) operations on each AWS service API. This is | |
# incredibly useful for building well-restricted IAM access | |
# rules. With this list you can quickly see what "s3:Get*" matches, or | |
# just glance through and look for something that might be missing and | |
# breaking your app. | |
# I can't believe I had to write this myself. I'm pretty sure there | |
# are a lot of people out there with near-god-mode permission on IAM |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Setting up your own private and secure VPN", | |
"Mappings": { | |
"AWSInstanceType2Arch": { | |
"High.Speed.VPN-Paid": { | |
"InstanceType": "t2.medium" | |
}, | |
"Standard.VPN-Free": { | |
"InstanceType": "t2.micro" |
#!/bin/bash | |
export PGPASSWORD='password' | |
IFS=':' | |
echo '' | |
date '+%F %T' | |
for HOST in www.{foo,bar}.com; do |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
const net = require('net'); | |
const LISTENING_PORT = 443; | |
const HTTPS_PORT = 4443; | |
const SSH_PORT = 22; | |
var proxySwitch = function(connection) { | |
connection.once('data', function(buffer) { | |
// A TLS handshake record starts with byte 22. | |
if (buffer[0] === 22) { |
#!/bin/bash | |
for d in /sys/kernel/iommu_groups/*/devices/*; do | |
n=${d#*/iommu_groups/*}; n=${n%%/*} | |
printf 'IOMMU Group %s ' "$n" | |
lspci -nns "${d##*/}" | |
done |
use std::str; | |
fn main() { | |
// -- FROM: vec of chars -- | |
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
// to String | |
let string1: String = src1.iter().collect::<String>(); | |
// to str | |
let str1: &str = &src1.iter().collect::<String>(); | |
// to vec of byte |
Set of scripts to deploy locally, vault and configure TLS server and user certificates for testing TLS AUTH.
credit to @reard3n (https://github.com/reard3n) and @v6 (https://github.com/v6) for the gist this grew from
This was tested using Vagrant and Ubuntu