Skip to content

Instantly share code, notes, and snippets.

View ralcorta's full-sized avatar
🚀
Runtime

Rodrigo Alcorta ralcorta

🚀
Runtime
View GitHub Profile
@ralcorta
ralcorta / openssl.md
Created July 5, 2022 01:18 — forked from Nathaniel100/openssl.md
Generate PKCS10 request

Generate a new private key and Certificate Signing Request

openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key

Generate a certificate signing request (CSR) for an existing private key

openssl req -out CSR.csr -key privateKey.key -new
@ralcorta
ralcorta / force-gh-push.sh
Last active June 15, 2022 18:16
Force push with ssh keys if deploy key is denied
# ERROR: Permission to user-group/project.git denied to deploy key
ssh-agent bash -c 'ssh-add ~/.ssh/ssh-private-key; git push'
@ralcorta
ralcorta / public.decorator.ts
Created June 15, 2020 07:10
Medium post: NesjJs Public endpoit with Global Auth - 2
import { SetMetadata } from "@nestjs/common";
export const Public = () => SetMetadata( "isPublic", true );
@ralcorta
ralcorta / auth-guard.ts
Last active June 15, 2020 07:06
Medium post: NesjJs Public endpoit with Global Auth - 1
import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common';
import { JwtAuthGuard } from './jwt-auth.guard';
import { Reflector } from '@nestjs/core';
import { Observable } from 'rxjs';
@Injectable()
export class AuthGuard extends JwtAuthGuard implements CanActivate {
public constructor(private readonly reflector: Reflector) { super() }
public canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
const isPublic = this.reflector.get<boolean>("isPublic", context.getHandler());
@ralcorta
ralcorta / git-change-origin.txt
Last active September 28, 2021 01:05
Change git repository
$ git remote rm origin
$ git remote add origin git@github.com:user/project.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@ralcorta
ralcorta / postman-deb.sh
Created December 5, 2019 17:22 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
ls Postman*.tar.gz > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
fi
curlExists=$(command -v curl)