Skip to content

Instantly share code, notes, and snippets.

View adilsoncarvalho's full-sized avatar

Adilson Carvalho adilsoncarvalho

View GitHub Profile
@bahadiraraz
bahadiraraz / Git_Commit_Freeze_Solution.md
Last active October 31, 2025 05:15
Git Commit Freeze Due to GPG Lock Issues (Solution)

Git Commit Freeze Due to GPG Lock Issues

If you encounter a problem where you cannot commit changes in Git – neither through the terminal nor via the GitHub Desktop application – the issue might be a freeze during the Git commit process. This is often caused by GPG lock issues. Below is a concise and step-by-step guide to resolve this problem.

Solution Steps

1. Check for GPG Lock Messages

Open your terminal and try to perform a GPG operation (like signing a test message). If you see repeated messages like gpg: waiting for lock (held by [process_id]) ..., it indicates a lock issue.

@marcocarvalho
marcocarvalho / youtube_unsubscribe.js
Last active November 5, 2020 20:27
Mass unsubscribe from youtube channel subscriptions using whitelist
const whitelist = ['Cancelar inscrição de Kurzgesagt – In a Nutshell.',
'Cancelar inscrição de 3D Geek Show - Impressão 3D.',
'Cancelar inscrição de ABANAorg.',
'Cancelar inscrição de Adam Savage’s Tested.',
'Cancelar inscrição de Adilson Carvalho.',
'Cancelar inscrição de Alec Steele.',
'Cancelar inscrição de Alexandre Benchimol.',
'Cancelar inscrição de Alexandre Bigunas.',
'Cancelar inscrição de Aquele Flau [OFICIAL].',
'Cancelar inscrição de Atila Iamarino.',
@goldeneggg
goldeneggg / ci.yml
Last active September 4, 2023 19:49
Rails 6 API Development and GitHub Actions CI with Docker (.github/workflows/ci.yml)
on:
push:
branches:
- master
paths-ignore:
- '**/*.md'
- 'LICENSE'
pull_request:
paths-ignore:
- '**/*.md'
@goldeneggg
goldeneggg / Dockerfile
Last active January 30, 2021 13:17
Rails 6 API Development and GitHub Actions CI with Docker (Dockerfile)
ARG ARG_RUBY_VERSION
FROM ruby:${ARG_RUBY_VERSION}-alpine3.11
# hadolint ignore=DL3008,DL3018
RUN apk update && \
apk add --update --no-cache \
build-base \
bash \
curl \
@andrevrochasilva
andrevrochasilva / cloudfn.js
Last active December 9, 2023 19:03
Codes used to make the POC with dataflow, cloud functions and BigQuery
const { google } = require('googleapis');
const dataflow = google.dataflow('v1b3');
const TEMPLATE_BUCKET = `your-bucket`;
module.exports.kickOffDataflow = async (event, event_description) => { // Check if the file was put in 'input/' folder
if (!event['id'].includes('/input/')){
return
}
const input = 'gs://' + event['id'].split('/').slice(0, -1).join('/')
const jobName = `citiesonbigquery`;
const tmpLocation = `gs://${TEMPLATE_BUCKET}/tmp`;
@magnetikonline
magnetikonline / README.md
Last active September 8, 2025 15:25
Add user ssh-agent as daemon to Ubuntu 18.04LTS server.

Add user ssh-agent as daemon to Ubuntu 18.04LTS server

Create a new systemd user unit, which starts ssh-agent upon login to server. Will remain resident until the final session for the user has logged out.

Steps

  • Create /etc/systemd/user/ssh-agent.service.

  • Run the following commands (under your user account, not root) to install the systemd unit and start:

@vyper
vyper / Dockerfile
Created September 23, 2016 19:34
Dockerfile to generate protos
FROM ruby:2.3.0-alpine
ENV PROTOBUF_VERSION 3.0.2
RUN apk add --update build-base autoconf automake libtool git perl && \
curl --location --silent --output /tmp/protobuf.tar.gz https://github.com/google/protobuf/archive/v$PROTOBUF_VERSION.tar.gz && \
tar xfz /tmp/protobuf.tar.gz -C /tmp/ && \
cd /tmp/protobuf-$PROTOBUF_VERSION && \
./autogen.sh && \
./configure --prefix=/usr && \
user nobody;
worker_processes 1;
#pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active October 6, 2025 20:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@mraible
mraible / gsutil-upload.sh
Last active September 30, 2020 22:47
Upload optimized assets to Google Cloud Storage
# Rsync to remove old files
gsutil -m rsync -x '.git*' -c -d -r dist gs://bucket/
# Upload and gzip HTML, CSS and JavaScript
gsutil -m cp -z "html,css,js" -r dist/** gs://bucket/
# Set expires headers (6 months) on JS and CSS assets
gsutil -m setmeta -h "Cache-Control: public, max-age=15552000" gs://bucket/assets/**
# Make sure there's no expiration headers on HTML files