Skip to content

Instantly share code, notes, and snippets.

View islomar's full-sized avatar

Isidro López islomar

View GitHub Profile
@islomar
islomar / CreateRemoteGitHubRepositoryFromCli
Last active August 29, 2015 13:55
Using Github's API to create repositories from the command-line
http://robinwinslow.co.uk/2013/06/07/create-github-repositories-from-the-command-line/
# replace USER and REPO with real values
# but *not* the "/user/" in the GitHub URL
$ curl -u 'USER' https://api.github.com/user/repos -d '{"name":"REPO"}'
# you will be prompted for your password
$ git remote add origin git@GitHub.com:USER/REPO.git
Create alias in git:
git config --global alias.gh-create '!sh -c "curl -u \"islomar\" https://api.github.com/user/repos -d \"{\\\"name\\\":\\\"$1\\\"}\" && git remote add origin git@github.com:islomar/$1.git" -'
@islomar
islomar / CreateDependencyDiagrams
Created February 10, 2014 09:15
Create dependency diagrams of modules
mvn org.kuali.maven.plugins:graph-maven-plugin:1.2.3:dependencies -Dgraph.includes=com.islomar*:*:*,es.islomar*:*:* -Dgraph.hide=test compile
@islomar
islomar / MavenCLIWithColor
Created February 28, 2014 08:17
Show Maven CLI with color
# Colorize Maven Output
# Colors reference: http://en.wikipedia.org/wiki/ANSI_escape_code
color_maven() {
$M2_HOME/bin/mvn $* | sed \
-e 's/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/^[[32;1mTests run: \1^[[0m, Failures: ^[[31;1m\2^[[0m, Errors: ^[[33;1m\3^[[0m, Skipped: ^[[34;1m\4^[[0m/g' \
-e 's/\(\[INFO\] \-[-]*$\)/^[[36;1m\1^[[0m/g' \
-e 's/\(\[INFO\] Building.*\)/^[[36;1m\1^[[0m/g' \
-e 's/\(.*WARN.*\)/^[[33;1m\1^[[0m/g' \
-e 's/\(.*ERROR.*\)/^[[31;1m\1^[[0m/g' \
-e 's/\(Downloaded:.*\)/^[[32;1m\1^[[0m/g'
@islomar
islomar / gitignore-java-mac
Last active May 2, 2024 14:55
Basic gitignore for Java and Mac:
# git config --global core.excludesfile ~/.gitignore_global
# Some common .gitignore configurations: https://gist.github.com/octocat/9257657
# Copy the next content on the .gitignore_global file:
.DS_Store
*.class
@islomar
islomar / colored-ssh
Last active August 29, 2015 14:10
Change terminal colours when connecting via SSH to another machine
http://elafosobrerailes.blogspot.com.es/2011/08/cambiar-los-colores-del-terminal-cuando.html
https://gist.github.com/eLafo/1125487#file-colored_ssh-sh
======
Steps
======
1.- Install sshpass
sudo apt-get install sshpass
@islomar
islomar / git
Last active May 9, 2017 15:11
Git commands and bash
#Great tips
http://firstaidgit.io/#/
#Display all unpushed commits
git log origin/master..HEAD
#GitHub emoji
http://www.emoji-cheat-sheet.com/
#Git flow
@islomar
islomar / unix-commands.md
Last active June 10, 2019 07:57
Unix commands

Linux hints and tricks

  • Create shortcut in Ubuntu-Gnome Alacarte

Memory: number of slots and maximum RAM that could be installed

sudo dmidecode -t 16 dmidecode -t memory >> show memory slots

watch free -m >> shows free memory

@islomar
islomar / mongodb-commands
Created January 13, 2015 22:46
MongoDB commands
/etc/mongod.conf
mongod --shutdown
/data/db
@islomar
islomar / sublime-shortcuts
Created January 14, 2015 14:05
Sublime shortcuts
Ctl + P: search files
Ctl + Shift + F: search text in files