Skip to content

Instantly share code, notes, and snippets.

View gobinathm's full-sized avatar
💻
I may be slow to respond.

Gobinath Mallaiyan gobinathm

💻
I may be slow to respond.
View GitHub Profile
@gobinathm
gobinathm / 1-setup.md
Created September 14, 2023 17:05 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS

Methods of Signing with a GPG Key on MacOS

Last updated September 21, 2022

This Gist explains how to do this using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

There has been a number of comments on this gist regarding some issues around the pinentry-program and M1 Macs. I've finally gotten a chance to try things out on an M1 and I've updated the documentation in 2-using-gpg.md to reflect my findings.

@gobinathm
gobinathm / bitbucket-pipelines.yml
Created April 29, 2021 00:21 — forked from shaypal5/bitbucket-pipelines.yml
Bitbucket status badges
image: python:3.8.3
# pipeline stages definitions
test: &test
step:
name: test
caches:
- pip
script:
- python --version
@gobinathm
gobinathm / generate-ssh-key.sh
Created February 22, 2021 22:00 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@gobinathm
gobinathm / git-auto-sign-commits.sh
Created February 22, 2021 21:56 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@gobinathm
gobinathm / UserLogin.php
Created February 18, 2021 08:56 — forked from sebas5384/UserLogin.php
Drupal GraphQL Cookie Login
<?php
namespace Drupal\graphql_cookie\Plugin\GraphQL\Mutations;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\graphql\Plugin\GraphQL\Mutations\MutationPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\graphql\GraphQL\Execution\ResolveContext;
use GraphQL\Type\Definition\ResolveInfo;
@gobinathm
gobinathm / file.twig
Created February 18, 2021 08:53
Drupal 8/9 - TWIG get file url in node template
{# Get Fully Qualified URL #}
{{ file_url(node.field_file.entity.uri.value) }}
{# Get URL of multi file field #}
{{ node.field_file['#items'].entity.uri.value }}
{# Get URL of single file field #}
{{ node.field_file.entity.uri.value }}
@gobinathm
gobinathm / git_alter.sh
Created December 22, 2020 02:37
Amend last git commit different author & change authored / commited date
GIT_COMMITTER_DATE="Sat May 16 13:31:51 2020 -0500" git commit --amend --no-edit --date "Sat May 16 13:31:51 2020 -0500" --author="Name <email@users.noreply.github.com>"
@gobinathm
gobinathm / docker-destroy-all.sh
Created June 4, 2020 05:25 — forked from srmklive/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
sudo docker stop $(sudo docker ps -a -q)
# Delete all containers
sudo docker rm $(sudo docker ps -a -q)
# Delete all images
sudo docker rmi $(sudo docker images -q)
# Deleta all volumes
sudo docker volume prune -f
# Delete docker networks
@gobinathm
gobinathm / docker-destroy-all.sh
Created June 4, 2020 04:50 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers