Skip to content

Instantly share code, notes, and snippets.

View jackfiallos's full-sized avatar
👾
experienced developer

Jack Fiallos jackfiallos

👾
experienced developer
View GitHub Profile
@jackfiallos
jackfiallos / api.tsx
Created March 27, 2021 14:32
React Native token, refresh token and OTP handling options
import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
import { API_URL } from 'react-native-dotenv';
import { IError } from '../interfaces/generic';
import { ISession } from '../interfaces/network';
// these are methods to store, remove or get the token from the localstorage
import { getCredentials, performLogin, performLogout } from './auth';
import NavigationService from './NavigationService';
let isRefreshing = false;
@jackfiallos
jackfiallos / multiple_ssh_setting.md
Created June 25, 2020 15:15 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@jackfiallos
jackfiallos / multiple_ssh_setting.md
Created June 25, 2020 15:15 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@jackfiallos
jackfiallos / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.

@jackfiallos
jackfiallos / force truncate
Created June 12, 2020 21:40
force truncate tables innoDB
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table $table_name;
SET FOREIGN_KEY_CHECKS = 1;
@jackfiallos
jackfiallos / gist:42259a97daeeba4bbfac253c41277b86
Created June 8, 2020 06:52
Install redmine plugins (DMSF)
sudo apt-get install xapian-omega ruby-xapian libxapian-dev xpdf poppler-utils antiword unzip catdoc libwpd-tools \
libwps-tools gzip unrtf catdvi djview djview3 uuid uuid-dev xz-utils libemail-outlook-message-perl
cd /opt/redmine/plugins/
sudo wget https://github.com/danmunn/redmine_dmsf/archive/master.zip
sudo mv master.zip redmine_dmsf.zip
sudo unzip redmine_dmsf.zip
sudo rm redmine_dmsf.zip
sudo passenger-config restart-app
sudo service nginx restart
sudo rabbitmqctl list_connections pid port state user vhost recv_cnt send_cnt send_pend name \
| grep -vP 'Listing|pid' \
| awk '{print "rabbitmqctl close_connection \"" $1 "\" \"manually closing idle connection\"" }' \
| sudo sh
@jackfiallos
jackfiallos / stripe.typings.d.ts
Created August 19, 2019 10:01
StripeJS type definitions
// Type definitions for stripe elements
// Project: https://stripe.com/docs/elements/reference
// Definitions by: Tony Ranieri
// Definitions:
interface StripeFactory {
new (apiKey: string): Stripe;
}
interface Stripe {
@jackfiallos
jackfiallos / laravellocal.md
Created May 12, 2019 12:42 — forked from hootlex/laravellocal.md
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
@jackfiallos
jackfiallos / Readme.md
Last active July 30, 2024 14:20
Import SSL Comodo cert to AWS Certificate Manager

Install your Comodo Certificates to Amazon AWS

Comodo, the leading Internet Security Provider offers Free Antivirus, SSL Certificate and other Internet Security related products with complete protection. In this post I will walk you through the setup of SSL in Amazon CloudFront (the process is common to all Amazon services)

AWS need that all your certificates are in PEM format. They are two main of encoding certificate:

DER: is a binary encoding of a certificate. Typically these use the file extension of .crt or .cert.

PEM: is a Base64 encoding of a certificate represented in ASCII therefore it is readable as a block of text. This is very useful as you can open it in a text editor work with the data more easily. Comodo certificate are delivered in DER format .crt, so we need to convert them to PEM.