Skip to content

Instantly share code, notes, and snippets.

@artbikes
artbikes / send2s3.sh
Created May 14, 2020 13:55 — forked from UnixSage/send2s3.sh
Simple shell script that uses curl to send a file to s3. Useful when you do not want to load the awscli for a simple job. May have to adjust mime types according to need.
#!/bin/sh
if [ $# -ne 1 ] ; then
echo "Need File Name"
exit
fi
s3AccessKey="##ACCESS##"
s3SecretKey="##SECRET##"
s3Bucket="data.example.com"
@artbikes
artbikes / traefik-compose
Created April 16, 2020 18:20 — forked from ivankatliarchuk/traefik-compose
traefik 2 with docker-compose
version: '3.7'
networks:
traefik:
external: true
volumes:
db_data:
secrets:

Loading :advanced Code into an Unmodified WROVER running Espruino

You can load ClojureScript :advanced code directly into an ESP32 WROVER running Espruino for execution upon boot, by creating a binary and flashing it to the JavaScript "boot ROM" area. This has the same effect as when loading code via the Espruino Web IDE, in the "Direct to Flash (execute code at boot)" mode, but flashing is much quicker and more reliable.

Note: To do this, you'll need an ESP32 WROVER with SPI PSRAM, as opposed to just a WROOM, as the ClojureScript in this example uses more RAM than is available in the WROOM.

Create :advanced Code

Here is a small program that uses enough to pull in data structures, etc, leading to nearly 100 KiB:

#!/bin/sh
#
# This script deploys the given manifest,
# tracks the deployment, and rolls back on failure.
#
# First execute this with "myapp.yaml" and then try it with "myapp.failing.yaml"
#
MANIFEST_PATH=$1
DEPLOYMENT_NAME=myapp
@artbikes
artbikes / user-data.txt
Created October 24, 2019 22:20 — forked from RichardBronosky/user-data.txt
Chef Bootstrapping an EC2 instance immediately and handsfree using cloud-init user-data
#cloud-config
#
# This is an example file to automatically install chef-client and run a
# list of recipes when the instance boots for the first time.
# Make sure that this file is valid yaml before starting instances.
# It should be passed as user-data when starting the instance.
#
# This example assumes the instance is 16.04 (xenial)
@artbikes
artbikes / cleanup-ami.py
Created October 21, 2019 14:59 — forked from marvinpinto/cleanup-ami.py
Python script to clean up and update the Jenkins AMIs after a successful Packer run
#!/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']
@artbikes
artbikes / README.md
Created October 8, 2019 16:37 — forked from shortjared/README.md
If you have ever wanted to grab a marketplace AMI (ex: OpenVPN) you'll know that the process is painful. This solves the pain.

Usage

  • You will need to first make sure you have subscribed to the marketplace product
  • Get the AMI of the marketplace
  • Copy the script to machine
  • awsume (or otherwise authorize) to AWS
  • chmod the script to be executable if needed chmod +x marketplace-ami-encryptor.sh

Usage ./marketplace-ami-encryptor.sh {region} {ami} {name}
Example: ./marketplace-ami-encryptor.sh us-east-1 ami-f6eed4e0 OpenVPN

@artbikes
artbikes / Dockerfile
Created May 9, 2019 22:50 — forked from lenalebt/Dockerfile
Installing Taskwarrior in Kubernetes
FROM ubuntu:18.04
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y taskd
CMD taskd server
@artbikes
artbikes / game-voter.patch
Created September 9, 2018 18:06
Patching Adam Petersen's `retro-games.lisp` into `game-voter.lisp`
--- old/retro-games.lisp 2011-06-14 00:08:07.000000000 -0400
+++ new/retro-games.lisp 2011-06-14 00:07:33.000000000 -0400
@@ -1,21 +1,24 @@
(in-package :cl-user)
-(defpackage :retro-games
- (:use :cl :cl-who :hunchentoot :parenscript :elephant))
+(defpackage :game-voter
+ (:use :cl :cl-who :hunchentoot :parenscript :elephant)
+ (:import-from :css-lite :css)