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 / shallow_update_git.md
Created March 6, 2017 18:24
Fix for Remote rejected shallow update not allowed after changing Git remote URL

Some Time there is a shallow update not allowed issue in your cloned GIT repo.

This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add origin <path-to-old-remote> After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow origin And now you should be able to push into your new remote repository.

@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 / .htaccess
Last active May 27, 2021 20:15
Apache .htaccess Rule for enhanced caching of Content.
RewriteEngine on
# Domain Redirect
# ACQUIA PROD ONLY Redirect All Variation to jnjinstitute.com & in SSL
RewriteCond %{HTTPS} !on
RewriteCond %{ENV:AH_SITE_ENVIRONMENT} prod [NC] # Remove this line if you hosting provider is not acquia
RewriteCond %{HTTP_HOST} ^domain1\.net [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.domain3\.com

Keybase proof

I hereby claim:

  • I am gobinathm on github.
  • I am gobinathm (https://keybase.io/gobinathm) on keybase.
  • I have a public key whose fingerprint is 192A 13BC C41E 4C70 C711 7B3F 107F FD59 24F6 05B6

To claim this, I am signing this object:

@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 }}