Skip to content

Instantly share code, notes, and snippets.

@kx9x
kx9x / !keeper_auto_task.js
Last active July 24, 2021 01:29
This gist shows an autotask that can be used with OpenZeppelin Defender on the free tier without relayer
// Settings edited by user
const YOUR_KEEP3R_ADDRESSS = "";
const YOUR_KEEP3R_PRIVATE_KEY = "";
// Code starts here
const { ethers } = require("ethers");
const privateKey = Buffer.from(YOUR_KEEP3R_PRIVATE_KEY, 'hex');
const UniswapSlidingWindow = "UniswapSlidingWindow";
const HegicPoolKeep3r = "HegicPoolKeep3r";
@nickjj
nickjj / cron-sendy-backup
Last active December 27, 2023 07:16
An example of creating a database backup and restore script for MySQL, MariaDB and PostgreSQL. It is focused on backing up and restoring a Sendy database (working example from https://www.youtube.com/watch?v=kbCytSYPh0E) but you can apply it for any database with slight modifications.
30 0 * * * root /usr/local/bin/sendy-backup > /dev/null 2>&1
@rgwozdz
rgwozdz / api-integration-testing.yml
Created September 21, 2016 03:17
Psuedo Ansible Playbook for API/DB integration testing - Mocha.js, Express.js, PostgreSQL
- name: Run DB/API integration test suite
hosts: localhost
become: True
become_method: sudo
tasks:
- name: Use PSQL to Close Postgres DB connection to the master database
become: True
become_user: postgres

Introduction to Magenta

We’re happy to announce Magenta, a project from the Google Brain team that asks: Can we use machine learning to create compelling art and music? If so, how? If not, why not?

Steps to setup Magenta

@fevangelou
fevangelou / default.vcl_PREFACE.md
Last active April 9, 2024 04:30
The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

Updated on December 15th, 2021

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites. It obviously depends on your use case.

@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

Mirabox notes

THE LOCATION OF THIS PAGE HAS MOVED!

The new location is https://github.com/psanford/mirabox. I've turned it into a full git repository so that it is easier for others to contribute. This gist will not be updated anymore and I won't be checking the comments. Please open an issue or a pull request on the git repo.

OLD CONTENT:

There's not a lot of good documentation about Globalscale Technology's [Mirabox][1] so this page is intended to document everything I know about it. My goal is to run a modern kernel and bootloader on the Mirabox.

@algal
algal / nginx-cors.conf
Created April 29, 2013 10:52
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#