Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env sh
#
# A script to test
# * the creation of a CW20 contract
# * the creation of a CW4 contract
# * the staking of CW20 tokens in the CW4 contract
CW20_CONTRACT_NAME=cw20_base.wasm
CW20_CONTRACT_URL=https://github.com/CosmWasm/cw-plus/releases/download/v0.13.4/cw20_base.wasm
CW4_CONTRACT_NAME=cw4_stake.wasm
wasm.execute(
&vault_address,
&deposit_msg,
&[Coin {
amount: deposit_amount,
denom: base_token.to_string(),
}],
&signer,
)
.unwrap();
@shapeshed
shapeshed / aws-cf-logs
Last active September 12, 2022 09:10
Fetch AWS Cloudfront Logs, decompress, combine into a single file and remove comments
#!/usr/bin/env bash
BUCKET=$1
CWD=$(pwd)
if [[ -n $1 ]]; then
aws s3 sync s3://$BUCKET/cf-logs .
cat *.gz > combined.log.gz
find $CWD ! -name 'combined.log.gz' -name '*.gz' -type f -exec rm -f {} +
gzip -d combined.log.gz
@shapeshed
shapeshed / gist:1016201
Created June 9, 2011 06:46
sshd_config
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 7654
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
#!/usr/bin/env bash
shopt -s nullglob globstar
typeit=0
if [[ $1 == "--type" ]]; then
typeit=1
shift
fi
@shapeshed
shapeshed / unicorn
Created September 16, 2011 10:12
Unicorn / Monit setup
#!/bin/sh
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/path/to/your/app/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENVIRONMENT=production
@shapeshed
shapeshed / twit_twurl.sh
Created June 4, 2010 12:21
Tweet from the command line using twurl & OAuth
################################
#!/usr/bin/env bash
# File: twit_twurl.sh
# Description: Tweet from the command line using twurl & OAuth
#
# Copyright 2010 George Ornbo (Shape Shed)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@shapeshed
shapeshed / exp_permissions.sh
Created August 26, 2009 10:28
Correctly sets permissions for a new ExpressionEngine site
#!/bin/bash
# File: exp_permissions.sh
# Description: Sets permssions on a ExpressionEngine install
#
# Copyright 2009 George Ornbo (Shape Shed)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@shapeshed
shapeshed / nginx_rails_3_1
Created October 10, 2011 19:13
Nginx Config for Rails 3.1 with Unicorn and Asset Pipeline
upstream app {
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.app.com;
rewrite ^/(.*) http://app.com/$1 permanent;
}
server {
@shapeshed
shapeshed / monit.conf
Created November 12, 2010 10:21
Upstart script for monit on Ubuntu 10.04
# This is an event.d (upstart) script to keep monit running.
# To install disable the old way of doing things:
#
# /etc/init.d/monit stop && update-rc.d -f monit remove
#
# then put this script here:
#
# /etc/init/monit.conf
#
# and reload upstart configuration: