Skip to content

Instantly share code, notes, and snippets.

View jhenriquez's full-sized avatar

Julio Henriquez jhenriquez

  • Santo Domingo
View GitHub Profile
@timReynolds
timReynolds / File
Created September 20, 2018 08:48
IFormFile to Stream example
using System.IO;
namespace VestaProperty.Core.File
{
public class File
{
public File()
{
this.Content = (Stream) new MemoryStream();
}
@ajinabraham
ajinabraham / sign.js
Last active January 11, 2023 15:44
Node.js Digital Signature - Sign
//Create Private Key with OpenSSL
//openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -pkeyopt rsa_keygen_pubexp:3 -out privateKey.pem
//Generate Public Key to be used at the client side (Mobile)
//openssl pkey -in privateKey.pem -out publicKey.pem -pubout
const crypto = require('crypto')
const fs = require('fs')
const private_key = fs.readFileSync('digital_sign/privateKey.pem', 'utf-8')
//File to be signed
const package = fs.readFileSync('webpackage.zip')
@mgoodness
mgoodness / k8s-svc-annotations.md
Last active September 7, 2024 16:25
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
module TM
module Commands
class LastTask
def initialize(provider_handler, formatter, attributes = '')
@provider_handler = provider_handler
@formatter = formatter
@attributes = attributes.extend(TM::StringExtensions).to_hash
end
require_relative '../../spec_helper'
describe TM::Commands::LastTask do
include_context 'task_commands_context' do
before(:each) do
taskmapper.should_receive(project).with({}).and_return(project)
end
context :execute do
subject do
@bradland
bradland / ssh-known-hosts-mgmt.sh
Last active April 4, 2023 21:21
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com