Skip to content

Instantly share code, notes, and snippets.

AWSTemplateFormatVersion: 2010-09-09
Description: cloudformation template for minimal k8s cluster
Parameters:
KeyName:
ConstraintDescription: must be the name of an existing EC2 KeyPair.
Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
Type: AWS::EC2::KeyPair::KeyName
Ami:
Type: String
Default: ami-0440e5026412ff23f
@fracalo
fracalo / instancesK8s.yaml
Created July 24, 2022 09:10
cloudformation template for minimal k8s cluster
AWSTemplateFormatVersion: 2010-09-09
Description: cloudformation template for minimal k8s cluster
Parameters:
SSHLocation:
AllowedPattern: (\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})
ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
Default: 0.0.0.0/0
Description: The IP address range that can be used to SSH to the EC2 instances
MaxLength: '18'
MinLength: '9'
@fracalo
fracalo / index.js
Created May 1, 2022 17:25
using on to wrap createServer (nodejs)
import http from 'http'
import { on } from 'events'
const server = http.createServer()
const requests = on(server.listen(3000), 'request')
for await (let req of requests) {
console.log('req', req)
}
#!/bin/bash
usage(){
echo "usage: ./crypt.sh [open|close] <encrypted_dev>"
}
OP=$1
TARGET=$2
# we bail out in case no first argument is passed
@fracalo
fracalo / qemu-networking.md
Created February 1, 2019 09:35 — forked from extremecoders-re/qemu-networking.md
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@fracalo
fracalo / uploadLambda.sh
Created January 2, 2019 21:08
little script for uploading lambdas
#!/bin/bash
# the lambda function corresponds to dir name
lambdaName=${1%/}
cd $lambdaName
#remove the old zip file
rm ./index.zip
@fracalo
fracalo / typetrainer
Created June 10, 2018 10:31
a simple typing test game (with records)
#!/bin/bash
###########################################
# Utility functions
###########################################
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function write_sorted_results {
echo "$@" >> $script_dir/_typeTrainerResults
#!/bin/zsh
#need to be read from shell
# ex: . ./bin/my-agents.zsh
#
# create an array with all the keyfile in $HOME/.ssh
karr=()
sshdir="$HOME/.ssh"
for f in "$sshdir"/*; do
file=$(basename $f)
@fracalo
fracalo / index.js
Created May 16, 2016 12:48
requirebin sketch
var randomWords = require('random-words');
console.log(randomWords());
@fracalo
fracalo / sample-website.sh
Created January 11, 2016 16:21
simple script fo initializing an empty browser project
#!/bin/bash
# simple script fo initializing an empty browser project in current dir
# with -d= prefix you define the creation of a new folder in which the projects starts
# otherwise you'll populate the CWD with project folders and files.
# all other arguments are used for creation of a folder and a file named "app" with ext of FOLDER_NAME
# html file will be placed in the root and named index.html
# html argument can be omitted, it will be added by default
# typical use: