Skip to content

Instantly share code, notes, and snippets.

View ggrandes's full-sized avatar
🛠️
I may be slow to respond.

G.Grandes ggrandes

🛠️
I may be slow to respond.
  • Spain
  • 10:44 (UTC +02:00)
View GitHub Profile
@ggrandes
ggrandes / openssl-rsa-signature.sh
Created March 3, 2014 13:37
OpenSSL RSA file Signature / Verify
# Generate RSA Key-Pair
openssl genrsa -out test.key 2048
openssl rsa -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
@ggrandes
ggrandes / prompt.sh
Last active November 26, 2019 19:48
Linux Colored Prompt
#!/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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ggrandes
ggrandes / markdown-bootstrap.pl
Last active November 26, 2019 19:48
Extract files and scripts from Markdown CodeBlocks for Bootstraping
#!/usr/bin/perl -wT
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ggrandes
ggrandes / certlink.sh
Created February 25, 2014 16:07
OpenSSL X.509 Certificate Linking / Verify
@ggrandes
ggrandes / self-signed-cert-generator.sh
Last active November 26, 2019 19:47
Self-Signed X.509 Certificates (Server/Client/Mail) with OpenSSL - Linux
#!/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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ggrandes
ggrandes / tomcat7-deploy.sh
Last active March 6, 2022 16:52
Automatic Deploy of Apache Tomcat (7.0.x; DEPRECATED; EOL 31/03/2021) and Log4J (1.2.x) (Linux)
#!/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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ggrandes
ggrandes / main.c
Created November 10, 2013 16:05
typical main.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char *argv[]) {
printf("hello world\n");
exit(EXIT_SUCCESS);
}
@ggrandes
ggrandes / pom.xml
Last active December 27, 2015 22:29
typical pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>bomb</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>bomb</name>
<dependencies>
<dependency>
@ggrandes
ggrandes / LICENSE
Last active April 25, 2017 13:46
Apache 2.0 License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@ggrandes
ggrandes / log4j.properties
Created November 10, 2013 15:15
typical java log config (log4j / logback)
log4j.rootLogger=INFO, CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} %p %c %m%n