This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Original Source: | |
# https://gist.github.com/ggrandes/72c2c1f41d28664cff2d73a5ad5c5d05 | |
# | |
# Sample Execution: | |
# nohup ./backup.sh vg1 root "--delete" 1>backup.log 2>&1 & tail -f backup.log | |
# Sample Params: | |
# vg1 root "--delete" | |
# vg1 kvm | |
LVM_VG="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Binary/Package Files # | |
bin | |
target | |
*.class | |
*.jar | |
*.war | |
*.ear | |
# Eclipse # | |
.metadata | |
.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Original Source: | |
# https://gist.github.com/ggrandes/c1765904e804db15b8c57d90299d006f | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -wT | |
# https://gist.github.com/ggrandes/df7151b9e2fca02da93acf44bedf7b43 | |
use strict; | |
my $op = ($ARGV[0] || ""); | |
my $text = ($ARGV[1] || ""); | |
if (length($text) < 1) { | |
print_usage(); | |
} elsif (($op eq "-e") || ($op eq "--encode")) { | |
print encode_rfc3548($text), "\n"; | |
} elsif (($op eq "-d") || ($op eq "--decode")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main(int argc, char *argv[]) | |
{ | |
char *line = NULL; | |
size_t len = 0; | |
ssize_t read; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Original Source: | |
# https://gist.github.com/ggrandes/09bc477ac20b8fcb0565d68b8aebe40e | |
# | |
date_log () { | |
printf '%(%Y-%m-%dT%H:%M:%S%z)T %s\n' -1 "$*" | |
} | |
recipients=(--trust-model always) | |
recipients+=(--keyring "./user.pub" --secret-keyring "./user.sec") | |
for i in user-*.pub; do { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original Source: | |
# https://gist.github.com/ggrandes/a57c401f1bad6bd0ffd87a557b7b5790 | |
# SIGN / VERIFY | |
openssl cms -sign -keyid -md sha256 -nodetach -binary -in /etc/passwd -signer user.crt -inkey user.key -out x.smime -outform SMIME | |
openssl cms -verify -CAfile ca.crt -in x.smime -inform SMIME | |
# ENCRYPT / DECRYPT | |
openssl cms -encrypt -keyid -aes-256-cbc -in /etc/passwd -binary -out x.smime -outform SMIME user.crt | |
openssl cms -decrypt -in x.smime -inform SMIME -recip user.crt -inkey user.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Original Source: | |
# https://gist.github.com/ggrandes/4a2cfef2fdf102420121 | |
# | |
sed 's/$/\r/' | curl -q -f -sS -m 180 --retry 3 \ | |
--url "smtp://mailhost:25" \ | |
--mail-from "[email protected]" \ | |
--mail-rcpt "[email protected]" \ | |
--user "[email protected]:password" \ | |
--upload-file /dev/stdin <<"END" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original Source: | |
# https://gist.github.com/ggrandes/2564f7815cfa6c2e9b61 | |
# Generate ECDSA Key-Pair | |
openssl ecparam -name secp521r1 -genkey -out test.key | |
openssl ec -pubout -in test.key -out test.pub | |
# Signature | |
openssl dgst -sha512 -sign test.key some-file.txt | openssl enc -a -e > some-file.txt.sign | |
# Verify | |
openssl enc -a -d < some-file.txt.sign | openssl dgst -sha512 -verify test.pub -signature /dev/stdin some-file.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Original Source: | |
# https://gist.github.com/ggrandes/4cf69a924ccbfcb1253c | |
# | |
# Generate Self-Signed certificates (not for production) | |
# Default Password por PKCS12 file is "changeit" | |
# Default Expire 5 years | |
EXPIRE_DAYS=${EXPIRE_DAYS:-$[365 * 5 + 1]} | |
usage () { | |
echo "$0 <client|server> <CN> <outputname>" |