Skip to content

Instantly share code, notes, and snippets.

View sandroacoelho's full-sized avatar

Sandro sandroacoelho

  • 15:50 (UTC)
View GitHub Profile
Docker
===========================
docker system prune -af
Kubernetes
===========================
Simple Java Mail is a mailing library with a super clean API. It's the easiest to use (Java) mailing library in the world.
This library relieves you of having to deal with low level API such as MimeMessage, fuzzy try catch constructions, inner classes and other nonsense. You just want to send an email!
But don't let looks deceive you, this library does everything: it is a robust, feature complete mailing library, yet it is small and lightweight (the core library clocking in at only 134kb).
@sandroacoelho
sandroacoelho / git.migrate
Created December 12, 2018 11:45 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@sandroacoelho
sandroacoelho / Dockerfile
Last active May 4, 2018 08:21
[Medium article] Working effectively with legacy code: a development environment approach
FROM java:8
RUN apt-get update && \
apt-get -y install maven git sudo && \
mkdir -p /home/developer && \
mkdir -p /etc/sudoers.d && \
adduser --quiet --disabled-password --shell /bin/bash --home /home/developer --gecos "User" developer && \
export uid=1000 gid=1000 && \
echo "developer:developer" | chpasswd && \
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
@sandroacoelho
sandroacoelho / create_md5.sh
Created February 18, 2018 14:29
Create MD5 recursively
#!/bin/bash
if [ $# -ne 1 ] ; then
echo "Usage $0 [directory]"
exit 1
fi
find $1 -name '*.md5' -delete
find $1 -type f -print0 | while IFS= read -r -d $'\0' file; do
(
@sandroacoelho
sandroacoelho / Git hub tags
Last active February 15, 2018 17:48
Deal with git tags
## Remove all remote tags
git tag -l | xargs -n 1 git push --delete origin
## Remove all local tags
git tag -d $(git tag)
## Resync all tags
@sandroacoelho
sandroacoelho / Jenkins
Last active June 20, 2019 03:26
Jenkins reset history
How to reset jobs in Jenkins
item = Jenkins.instance.getItemByFullName("your-job-name-here")
//THIS WILL REMOVE ALL BUILD HISTORY
item.builds.each() { build ->
build.delete()
}
item.updateNextBuildNumber(1)
@sandroacoelho
sandroacoelho / NIF.java
Created October 27, 2017 06:34
NIF Lib example
import org.nlp2rdf.NIF;
import org.nlp2rdf.bean.NIFBean;
import org.nlp2rdf.bean.NIFType;
import org.nlp2rdf.nif21.impl.NIF21;
import java.util.ArrayList;
import java.util.List;
public class NIF {
@sandroacoelho
sandroacoelho / awesome-kge.md
Created May 31, 2017 12:58 — forked from mommi84/awesome-kge.md
Awesome Knowledge Graph Embedding Approaches