Skip to content

Instantly share code, notes, and snippets.

View clementlecorre's full-sized avatar
🤖
hhuhhh

Clément clementlecorre

🤖
hhuhhh
View GitHub Profile
@clementlecorre
clementlecorre / gpg-decrypt.go
Created May 19, 2021 10:11
Golang gpg decrypt (crypto/openpgp)
package gpg
import (
"bytes"
"encoding/base64"
"errors"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
"io/ioutil"
"os"
@clementlecorre
clementlecorre / gpg-encrypt.go
Last active May 19, 2021 10:10
Golang gpg encryption (crypto/openpgp)
package gpg
import (
"errors"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/packet"
"io"
"os"
"path/filepath"
@clementlecorre
clementlecorre / GitHubStarToRt-rss.sh
Created June 3, 2019 20:50
Import GitHub Star project to tiny tiny RSS via rest API
#!/bin/bash
#
# Script to import GitHub releases feed to tt rss
# Get Categories
# curl -s -X GET -d \
# "$(jq -n --arg sid $(curl -s -d '{"op":"login","user":"","password":""}' https://rss.domain.com/api/ | jq -r '.content.session_id') --arg op getCategories '{"sid": $sid, "op": $op}')"
# https://rss.domain.com/api/ | jq -r
# {
# "seq": 0,
@clementlecorre
clementlecorre / rmdir.go
Created February 28, 2018 16:07
Lazy directory removal with golang (ending with / signifies that it's a directory)
func RemoveDirectoryRecursively(dir string) error {
return os.RemoveAll(dir+"/")
}
@clementlecorre
clementlecorre / cleanup_node_modules.txt
Created February 25, 2018 15:05
Remove all node module folders recursively (Tip to easily gain disk space)
find . -name "node_modules" -exec rm -rf '{}' +
@clementlecorre
clementlecorre / README-Template.md
Created January 23, 2018 16:18 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@clementlecorre
clementlecorre / bash_color.sh
Created October 26, 2017 19:13
bash Color constants
# Color constants
COLOR_BLACK='\033[30m'
COLOR_BLACK_BOLD='\033[0;30;1m'
COLOR_RED='\033[31m'
COLOR_RED_BOLD='\033[0;31;1m'
COLOR_GREEN='\033[32m'
COLOR_GREEN_BOLD='\033[0;32;1m'
COLOR_YELLOW='\033[33m'
COLOR_YELLOW_BOLD='\033[0;33;1m'
COLOR_BLUE='\033[34m'
@clementlecorre
clementlecorre / argpars_bash.sh
Created October 26, 2017 15:20
Example for my bash argparse
#!/bin/bash
TIMEOUT=10
# Telegram bot User info bot Python
# search bot @myidbot
ID=0
TOKEN=0
function usage()
from pyVim import connect
from pyVmomi import vim, vmodl
import threading, os, sys
import atexit
import argparse
import getpass
def get_args():