Skip to content

Instantly share code, notes, and snippets.

View alissonperez's full-sized avatar

Alisson R. Perez alissonperez

  • São Paulo, SP, Brasil
View GitHub Profile
@alissonperez
alissonperez / gist:10a17496d63caca36fcdb1c2d8a636ac
Last active October 22, 2022 15:23 — forked from mayoff/gist:1138816
AppleScript to make Google Chrome Canary open/reload a URL
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *)
tell application "Google Chrome Canary"
activate
set i to 0
repeat with w in (windows) -- loop over each window
set j to 1 -- tabs are not zeroeth
repeat with t in (tabs of w) -- loop over each tab
if title of t starts with "Meet:" then
set (active tab index of w) to j -- set Meet tab to active
set index of w to 1 -- set window with Meet tab to active

Keybase proof

I hereby claim:

  • I am alissonperez on github.
  • I am alissonrperez (https://keybase.io/alissonrperez) on keybase.
  • I have a public key whose fingerprint is 2172 F752 816A 0123 4D9F 123B 2506 9817 F5D2 5CE7

To claim this, I am signing this object:

@alissonperez
alissonperez / main.go
Last active March 5, 2021 12:45
JWT Go - RSA generation and validation example
// Generate keys (based in https://gist.github.com/nghiaht/224f7fe04ea591c6d2fddbee6c173379)
// Gen private keys:
// openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
// Gen public keys:
// openssl rsa -pubout -in private.pem -out public_key.pem
package main
@alissonperez
alissonperez / mp.py
Created February 4, 2019 20:57
multiprocessing
#!/usr/bin/env python
import consumer
import os
import sys
import signal
import logging
from config import Config
from multiprocessing import Process
# Install python (gcloud sdk), make and certificates (gcloud)
apk add --update make ca-certificates openssl python gettext
update-ca-certificates
# Installing GCLOUD SDK
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
tar zxvf google-cloud-sdk.tar.gz && ./google-cloud-sdk/install.sh --usage-reporting=false --path-update=true
google-cloud-sdk/bin/gcloud --quiet components update
echo $GCLOUD_SERVICE_KEY | base64 -d > ${HOME}/gcloud-service-key.json
google-cloud-sdk/bin/gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
@alissonperez
alissonperez / .gitlab-ci.yml
Created May 4, 2018 21:25 — forked from foklepoint/.gitlab-ci.yml
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@alissonperez
alissonperez / gist:a63cd755cb0291f6cad2b6ec29500937
Created November 23, 2016 05:07
Python - Logging - Example dictConfig
{
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
},
'handlers': {
'default': {
@alissonperez
alissonperez / keybase.md
Created July 15, 2016 14:15
keybase.md

Keybase proof

I hereby claim:

  • I am alissonperez on github.
  • I am alissonperez (https://keybase.io/alissonperez) on keybase.
  • I have a public key whose fingerprint is C578 5C6F F1FB 6B5F 8015 2A2B 80AB 17AC 7705 824B

To claim this, I am signing this object:

No /etc/fstab, mudar a versão de 3 para 4:

# Note o parâmetro 'vers=4' no fim da linha
99.99.99.99:/path/para/o/ambiente/99 /montagem/local/99 nfs rw,rsize=32768,wsize=32768,timeo=14,intr,sync,vers=4

No /etc/idmapd.conf, incluir a linha Domain = corp.folha.com.br abaixo da linha # Domain = localdomain, ficando assim:

@alissonperez
alissonperez / bash_ps1
Last active August 29, 2015 14:16 — forked from cmsouza/bash_ps1
# no seu bashrc
source ~/.bash-gitprompt.sh #<--- https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
PS1='\[\033]0;\u@\h:\W\007\]`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;37m\ ]\h\[\033[01;34m\] \w\[\033[35m\]$(__git_ps1 " %s") \[\033[01;36m\]$\[\033[00m\] '
# no do root
PS1='\[\033]0;\u@\h:\W\007\]`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[00;31m\]\u@\h\[\033[01;34m\] \w\[\033[35m\] \[\033[01;31m\]#\[\033[00m\] '
# nas vms
PS1='\[\033]0;\u@\h:\W\007\]`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;33m\]\u@\h\[\033[01;34m\] \w\[\033[35m\] \[\033[01;30m\]$\[\033[00m\] '