Skip to content

Instantly share code, notes, and snippets.

View diegofcornejo's full-sized avatar
🪄
randomtechguy

Diego Cornejo diegofcornejo

🪄
randomtechguy
View GitHub Profile
@thimslugga
thimslugga / 01-setup_docker_al2023.md
Last active April 16, 2024 15:35
Setup Docker and docker-compose on Amazon Linux 2023

Setup Docker on Amazon Linux 2023

Steps to Install and Setup Docker on Amazon Linux 2023

Install the packages

Install the following packages, which are good to have installed:

sudo dnf install --allowerasing -y dnf-plugins-core \
@fazt
fazt / TaskContract.sol
Created July 8, 2021 23:30
A CRUD Tasks contract
pragma solidity ^0.8.6;
contract TaskCrud {
struct Task {
uint id;
string name;
string description;
}
@Alkarex
Alkarex / decodeAxioma.js
Last active March 4, 2024 11:53
Node-RED function to decode Axioma water meter payloads.
/* jshint esversion:6, bitwise:false, node:true, strict:true */
/* globals msg */
"use strict";
/**
* Node-RED function to decode Axioma water meter payloads.
* Example assuming that msg.req.body contains an HTTP POST callback from The Things Networks.
*/
function statusAxiomaShort(s) {
const messages = [];
@tovbinm
tovbinm / fauna-graphql-relations.gql
Last active March 6, 2022 14:38
FaunaDB Relations: GraphQL schemas, mutations and resulting documents
****************************************************************************
**** FaunaDB Relations: GraphQL schemas, mutations and resulting documents *
****************************************************************************
**** One to One Relation ***************************************************
SCHEMA:
type User { name: String! car: Car }
type Car { plate: String! owner: User }
MUTATION:
mutation Create {
createUser(data: {
@nemani
nemani / download_all_lambda_functions.sh
Last active March 27, 2024 12:10
Download All Lambda Functions
# Parallelly download all aws-lambda functions
# Assumes you have ran `aws configure` and have output-mode as "text"
# Works with "aws-cli/1.16.72 Python/3.6.7 Linux/4.15.0-42-generic botocore/1.12.62"
download_code () {
local OUTPUT=$1
aws lambda get-function --function-name $OUTPUT --query 'Code.Location' | xargs wget -O ./lambda_functions/$OUTPUT.zip
}
mkdir -p lambda_functions
@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@tanaikech
tanaikech / submit.md
Created May 20, 2018 04:44
Create Folder Tree of Google Drive using Node.js

Create Folder Tree of Google Drive using Node.js

This is a sample script for retrieving a folder tree using Node.js. In this sample, you can set the top of folder for the folder tree. In generally, the folder tree is created by retrieving folders from the top folder in order. For example, when Google Apps Script is used, the script becomes like this. But when Drive API is used for this situation, if there are a lot of folders in the top folder, a lot of APIs are required to be called. So in this sample, I have tried to create the folder tree by a small number of API calls as possible.

In this sample, in order to be easy to understand the flow, I used Quickstart for Node.js. When you use this sample script, at first, please check the document of Quickstart. And I confirmed that this sample worked at googleapis v30.0.0.

Flow :

  1. Retrieve all folders in Google Drive.

If .DS_Store was never added to your git repository, simply add it to your .gitignore file.

If you don't have one, create a file called

.gitignore

In your the root directory of your app and simply write

@jpswade
jpswade / devops_best_practices.md
Last active May 3, 2024 11:49
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active May 4, 2024 18:30
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings