Skip to content

Instantly share code, notes, and snippets.


K8sCat k8scat

View GitHub Profile
oseme-techguy /
Last active Aug 4, 2022
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
paolocarrasco /
Last active Aug 19, 2022
How to understand the `gpg failed to sign the data` problem in git


You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object


simbo1905 /
Last active Apr 26, 2022 — forked from vt0r/
Build/install instructions for GnuPG 2.2.x on Centos 7 and similar distros (formerly for 2.1.x)

GnuPG 2.2.x Build Instructions

Below are my build instructions for GnuPG 2.2.9, released on July 12th, 2018. These instructions are built for a headless Centos 7 LTS server (specificaly the openshift/base-centos7 docker image).

You use the below install script to install GnuPG 2.2.x by running the following commands:

# if you are root in a docker image:
curl -OL "" && bash ./
# else if you need to sudo to do the installs:
toschneck /
Last active Jun 3, 2022
Install Docker and Docker-Compose bash completion
#!/usr/bin/env bash
set -e
echo "install docker bash completion"
curl -L$(docker version --format '{{.Server.Version}}')/contrib/completion/bash/docker -o /etc/bash_completion.d/docker
echo "install docker-compose bash completion"
curl -L$(docker-compose version --short)/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
echo ".... done!"
byrnedo / ComputeHmac256.go
Created Sep 12, 2016
Compute a hmac for a message in golang
View ComputeHmac256.go
func ComputeHmac256(message string, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
return base64.StdEncoding.EncodeToString(h.Sum(nil))
myusuf3 /
Created Nov 3, 2014
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
sergiotapia / images_dimensions.go
Last active Jul 9, 2021
Golang - Getting the dimensions of an image. jpg, jpeg, png
View images_dimensions.go
package main
import (
_ "image/jpeg"
_ "image/png"
View ACM学习计划
现在网上有许多题库,大多是可以在线评测,所以叫做Online Judge。除了USACO是为IOI准备外,其余几乎全部是大学的ACM竞赛题库。
klb3713 /
Created Jul 25, 2013
# -*- coding: utf-8 -*-
__author__ = 'klb3713'
import threading, time, httplib
HOST = ""; #主机地址 例如192.168.1.101
PORT = 8001 #端口
URI = "/api/huohuaId2Url" #相对地址,加参数防止缓存,否则可能会返回304
TOTAL = 0 #总数
SUCC = 0 #响应成功数
FAIL = 0 #响应失败数
jamesstout /
Last active Jul 12, 2021
add tz param to to get the time in your location. Some testing done.
# -*- coding: utf-8 -*-
import alfred
import calendar
import time
import math
from delorean import utcnow, parse, epoch
# global var to see if user
# has a time offset