Skip to content

Instantly share code, notes, and snippets.

@mashimom
mashimom / javadoc_doclint-less
Created March 27, 2015 18:45
Deactivate Javadoc's 8 doclint on gradle builds (as found on http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html)
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
@mashimom
mashimom / gist:5f32c6985acdb1b1e5ac
Created March 27, 2015 18:54
Create Javadocs jar
task javadocsJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocsJar
}
## For 64 Bit:
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u75-b13/jdk-7u75-linux-x64.tar.gz"
##For 32 Bit:
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u75-b13/jdk-7u75-linux-i586.tar.gz"
@mashimom
mashimom / findjar
Created May 7, 2015 18:11
ZSH alias for finding a class within jars under current directory tree
alias findjar="for f (**/*.jar(.)) jar -tf \"$f\" | grep --label \"$f\" -l `sed 's|\.|/|g' <<< \"$@\"`"
@mashimom
mashimom / gist:02033a6c3efe7bf11dab
Created May 9, 2015 16:12
Rsync without consuming all bandwidth
rsync <params like -vritzn> --bwlimit=8000 ./ <USER>@<HOSTNAME>:<PATH>
@mashimom
mashimom / gist:518b70b6aab26d7b75d1
Last active August 29, 2015 14:20
ZSH alias for find using realpath with zsh globbing
alias fnd="realpath $@"
@mashimom
mashimom / gist:0d0f58a65a2ab30aac75
Created May 11, 2015 11:47
ZSH alias for find using relative path with zsh globbing
alias prn="print -l $@"
@mashimom
mashimom / Vagrantfile
Created June 20, 2015 19:13
Add a local cache to all apt, yum and npm operations (~/.vagrant.d/Vagrantfile)
Vagrant.configure("2") do |config|
config.vm.box = 'your-box'
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
# OPTIONAL: If you are using VirtualBox, you might want to use that to enable
# NFS for shared folders. This is also very useful for vagrant-libvirt if you
# want bi-directional sync
@mashimom
mashimom / gist:ba1f31c53d722e037b55
Created July 20, 2015 17:10
Find a Linux process by partial name
pgrep -l xfce
## returns: 14306 xfce4-terminal
@mashimom
mashimom / ansible_install_ubuntu
Last active November 19, 2018 10:05
Install Ansible on Ubuntu
#!/bin/sh
sudo apt install python-setuptools python-dev build-essential
sudo easy_install pip
sudo pip install ansible
mkdir -p ~/.ansible/{host_vars,group_vars,roles}
wget -O ~/.ansible.cfg https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg
touch ~/.ansible/hosts
echo "[all]" >> ~/.ansible/hosts