Skip to content

Instantly share code, notes, and snippets.

View nnearobot's full-sized avatar

Rimma Maksiutova nnearobot

View GitHub Profile
@TheSherlockHomie
TheSherlockHomie / RenewExpiredGPGkey.md
Created January 3, 2021 16:36
Updating expired GPG keys and backing them up 🔑🔐💻

Updating expired GPG keys and their backup 🔑🔐💻

I use a GPG key to sign my git commits.

An error like this one might be a sign of an expired GPG key.

error: gpg failed to sign the data fatal: failed to write commit object
@airtower-luna
airtower-luna / sha256check.py
Created August 20, 2020 16:44
Example of how to verify an SHA-256 checksum file using Python
#!/usr/bin/python3
# Example of how to verify an SHA-256 checksum file using Python.
# Usage: python sha256check.py sha256sum.txt
import hashlib
import re
import sys
# This regular expression matches a line containing a hexadecimal
# hash, spaces, and a filename. Parentheses create capturing groups.
r = re.compile(r'(^[0-9A-Fa-f]+)\s+(\S.*)$')
@krisleech
krisleech / renew-gpgkey.md
Last active April 22, 2024 20:13
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@SLonger
SLonger / multipart_upload.go
Last active December 27, 2023 16:27 — forked from mattetti/multipart_upload.go
Example of doing a multipart upload in Go (golang) , client create http request instead of html form.
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@kamermans
kamermans / sessionclean
Created August 13, 2014 00:08
Replacement PHP session cleaner for Ubuntu (place inside /usr/lib/php5/)
#!/bin/sh
# check if file-based sessions are enabled
file_storage=$(/usr/lib/php5/sessionstorage | grep '^files$' -c)
if [ "$file_storage" = "0" ]; then
exit 0
fi
# first find all used files and touch them (hope it's not massive amount of files)