Skip to content

Instantly share code, notes, and snippets.

View Ajeo's full-sized avatar
🎯
Focusing

Ajeo Ajeo

🎯
Focusing
  • Santiago, Chile
  • X @ajeo
View GitHub Profile
@Ajeo
Ajeo / env.py
Created January 5, 2022 01:47 — forked from moraisaugusto/env.py
SqlAlchemy + Alembic + DYNACONF +SSL enabled
from __future__ import with_statement
import sys,os
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
@Ajeo
Ajeo / multiple-repository-and-identities-git-configuration.md
Created April 16, 2021 18:39 — forked from bgauduch/multiple-repository-and-identities-git-configuration.md
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
import { GraphQLScalarType } from "graphql";
import { Kind } from "graphql/language";
export default {
Date: new GraphQLScalarType({
name: "Date",
description: "Date custom scalar type",
parseValue(value) {
return new Date(value); // value from the client
},
@Ajeo
Ajeo / IAMCredentials.json
Created April 22, 2019 17:24 — forked from ServerlessBot/IAMCredentials.json
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@Ajeo
Ajeo / vgg.py
Created January 3, 2019 02:15
This script will demonstrate how to use a pretrained model, in PyTorch, to make predictions.
"""
This script will demonstrate how to use a pretrained model, in PyTorch,
to make predictions. Specifically, we will be using VGG16 with a cat
image.
References used to make this script:
PyTorch pretrained models doc:
http://pytorch.org/docs/master/torchvision/models.html
PyTorch image transforms example:
http://pytorch.org/tutorials/beginner/data_loading_tutorial.html#transforms
@Ajeo
Ajeo / ssl_puma.sh
Created September 20, 2018 23:32 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@Ajeo
Ajeo / osx_install.sh
Created April 4, 2018 20:50 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@Ajeo
Ajeo / mongodb-s3-backup.sh
Created December 20, 2017 23:21 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh