Skip to content

Instantly share code, notes, and snippets.

View VDigitall's full-sized avatar
🏠
Working from home

Vitalii Martyniak VDigitall

🏠
Working from home
  • Quintagroup
  • Lviv, Ukraine
View GitHub Profile
@VDigitall
VDigitall / README.md
Created March 5, 2021 11:23 — forked from paolocarrasco/README.md
How to understand the `gpg failed to sign the data` problem

Problem

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

Debug

@VDigitall
VDigitall / dec.py
Created November 1, 2019 11:45 — forked from nmarley/dec.py
AWS KMS encryption/decryption using Python/Boto3
import boto3
import base64
if __name__ == '__main__':
session = boto3.session.Session()
kms = session.client('kms')
encrypted_password = 'AQECAHjgTiiE7TYRGp5Irf8jQ3HzlaQaHGYgsUJDaavnHcFm0gAAAGswaQYJKoZIhvcNAQcGoFwwWgIBADBVBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDwxVQuG0oVwpkU7nQIBEIAoVGk1/wpserb+GVUOzE7PiL/Nr9fTDFKZfpKpF0ip2ct4B2q0Wn6ZZw=='
binary_data = base64.b64decode(encrypted_password)
@VDigitall
VDigitall / nord.json
Last active September 18, 2019 06:40
Nord colorscheme for shell `powerline/colorschemes/shell/nord.json`
{
"name": "Default color scheme for shell prompts",
"groups": {
"hostname": {
"fg": "brightyellow",
"bg": "nord:orange",
"attrs": []
},
"environment": {
"fg": "white",
@VDigitall
VDigitall / nord.json
Created September 8, 2019 12:01
Nord powerline colorsheme
{
"name": "Nord",
"groups": {
"information:additional": { "fg": "nord:gray0", "bg": "nord:black0", "attrs": [] },
"information:regular": { "fg": "nord:gray0", "bg": "nord:black0", "attrs": ["bold"] },
"information:highlighted": { "fg": "white", "bg": "nord:black2", "attrs": [] },
"information:priority": { "fg": "brightyellow", "bg": "mediumorange", "attrs": [] },
"warning:regular": { "fg": "white", "bg": "brightred", "attrs": ["bold"] },
"critical:failure": { "fg": "white", "bg": "darkestred", "attrs": [] },
"critical:success": { "fg": "white", "bg": "darkestgreen", "attrs": [] },
@VDigitall
VDigitall / colors.json
Created September 8, 2019 11:53
Powerline colors.json
{
"colors": {
"black": 16,
"white": 231,
"green": 2,
"darkestgreen": 22,
"darkgreen": 28,
"mediumgreen": 70,
"brightgreen": 148,
@VDigitall
VDigitall / script.sh
Created October 25, 2018 12:33 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@VDigitall
VDigitall / 1_pdf.py
Created October 2, 2018 10:45 — forked from philfreo/1_pdf.py
Three ways to make a PDF from HTML in Python (preferred is weasyprint or phantomjs)
def render_pdf_weasyprint(html):
from weasyprint import HTML
pdf = HTML(string=html.encode('utf-8'))
return pdf.write_pdf()
def render_pdf_xhtml2pdf(html):
"""mimerender helper to render a PDF from HTML using xhtml2pdf.
Usage: http://philfreo.com/blog/render-a-pdf-from-html-using-xhtml2pdf-and-mimerender-in-flask/
"""

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@VDigitall
VDigitall / .pre-commit-config.yaml
Last active February 20, 2018 10:44
.pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: v1.2.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-added-large-files
- id: check-yaml
function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},