Skip to content

Instantly share code, notes, and snippets.

View marcelosantos's full-sized avatar

Marcelo Santos marcelosantos

View GitHub Profile
@marcelosantos
marcelosantos / Install-OpenJDK8.md
Last active November 23, 2016 15:22
Installing OpenJDK 8 on Debian Jessie

Steps to install OpenJDK 8 on Debian Jessie:

Edit /etc/apt/sources.list and add these lines (you may ignore line with #)

Adding the line below to you source list file from

# JDK 8
deb http://ftp.de.debian.org/debian jessie-backports main

Update repos

@marcelosantos
marcelosantos / aplicar-permissoes.sh
Last active December 1, 2016 17:37
Script para aplicar permissões em arquivos e diretórios
# Script para aplicar permissões em arquivos e diretórios
echo "755 em diretorios"
find $1 -type d -exec chmod 755 {} \;
echo "644 nos arquivos"
find $1 -type f -exec chmod 644 {} \;
@marcelosantos
marcelosantos / Repo-Git-With-Two-Origin.md
Last active May 15, 2017 13:10
Adicionando dois origin para o mesmo repositório git

So let's add a new remote called all that we'll reference later when pushing to multiple repositories:

$ git remote add all git://original/repo.git
$ git remote -v
all git://original/repo.git (fetch)               <-- ADDED
all git://original/repo.git (push)                <-- ADDED
origin  git://original/repo.git (fetch)
origin  git://original/repo.git (push)
$ git config -l | grep '^remote\.all'

remote.all.url=git://original/repo.git <-- ADDED

To change the author only for the last commit:

git commit --amend --author 'Author Name <author.name@mail.com>' --no-edit

Suppose you only want to change the author for the last N commits:

git rebase -i HEAD~4 -x "git commit --amend --author 'Author Name <author.name@mail.com>' --no-edit"

NOTES

How to: Delete a remote Git tag

You probably won't need to do this often (if ever at all) but just in case, here is how to delete a tag from a remote Git repository.

If you have a tag named 'tag_example' then you would just do this:

git tag -d tag_example

Sending changes to remote

@marcelosantos
marcelosantos / fix-encoding-utf8-during-maven-compilation.md
Last active May 16, 2023 10:14
Fix encoding utf8 during maven compilation

Configure the maven-compiler-plugin to use the same character encoding that your source files are encoded in (e.g):

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
        <source>1.8</source> <!-- jdk version --> 
 1.8 
@marcelosantos
marcelosantos / Jenkins-Start.md
Last active May 21, 2018 19:54
Comando para executar o jenkins em uma porta especifica.

Executando o jenkins na porta 8180

java -jar jenkins.war --httpPort=8180

@marcelosantos
marcelosantos / git-remove-all-files-from-repo.sh
Created January 16, 2017 13:00
git: recursively remove all files from a repo
Recursively remove all files of filetype .foo from the repo:
git filter-branch --tree-filter 'git rm -r -f --ignore-unmatch *.foo' HEAD