Skip to content

Instantly share code, notes, and snippets.

View jaybuidl's full-sized avatar
📐

jaybuidl jaybuidl

📐
View GitHub Profile
@jaybuidl
jaybuidl / install-openjdk-11-locally.sh
Created September 27, 2018 10:01
Installs the official OpenJDK 11 binary package and run update-alternatives on a debian system for all java executables
cd ~/Downloads
wget https://download.java.net/java/GA/jdk11/28/GPL/openjdk-11+28_linux-x64_bin.tar.gz
cd /usr/lib/jvm
sudo tar -xvf ~/Downloads/openjdk-11+28_linux-x64_bin.tar.gz
for f in $(find /usr/lib/jvm/jdk-11/bin/ -executable -type f)
do
baseName="$(basename $f)"
echo "setting up $baseName"
@jaybuidl
jaybuidl / get-prices.sh
Last active February 6, 2022 17:25
Live prices download from Alpha Vantage
#!/bin/bash
# precondition: jq installed
pkg="jq"
if [[ $(dpkg-query -W -f='${Status}' $pkg 2>/dev/null) != "install ok installed" ]];
then
echo "$pkg package not found: installing"
if sudo apt-get install -y $pkg;
then
echo "$pkg installation successful, continuing...";
import org.sonatype.nexus.repository.storage.StorageFacet;
import org.sonatype.nexus.repository.storage.Query;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
def fmt = DateTimeFormat.forPattern('yyyy-MM-dd HH:mm:ss');
// Get a repository
def repo = repository.repositoryManager.get('nuget-releases');
// Get a database transaction
def tx = repo.facet(StorageFacet).txSupplier().get();
@jaybuidl
jaybuidl / ubuntu_lsb_release.sh
Last active January 16, 2018 08:14
Runs lsb_release on the upstream distribution
#!/bin/bash
#for example "ubuntu_lsb_release -c -s" gives the ubuntu codename such as xenial or trusty
if [ ! -f /etc/upstream-release/lsb-release ]
then
# this is already ubuntu, delegate
/usr/bin/lsb_release $@
exit 0
fi
@jaybuidl
jaybuidl / reinstall-microsoft-r-open.sh
Created April 28, 2017 05:46
fixes upgrade problems for MS R Open
#!/bin/bash
# official website: https://mran.microsoft.com/documents/rro/installation/#revorinst-lin
# fix package manager
sudo rm -rf /var/lib/dpkg/info/microsoft-r-open-*
sudo dpkg --remove --force-remove-reinstreq microsoft-r-open-mkl-3.3
sudo dpkg --remove --force-remove-reinstreq microsoft-r-open-foreachiterators-3.3
sudo dpkg --remove --force-remove-reinstreq microsoft-r-open-mro-3.3
@jaybuidl
jaybuidl / update-docker-compose.sh
Last active January 16, 2018 08:30
update docker-compose and its auto-completion to the latest release version (not installed as a container!)
#!/bin/bash
latestReleaseUrl="$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep "docker-compose-Linux-x86_64\"" | grep browser_download_url | sed "s/.*\(https.*x86_64\).*/\1/")"
echo "installing $latestReleaseUrl"
sudo curl -L $latestReleaseUrl -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version
#!/bin/bash
# with ansible role from https://galaxy.ansible.com/wtanaka/vagrant
ansible-galaxy install wtanaka.vagrant
#--------------
# or manually
version=1.9.1
@jaybuidl
jaybuidl / scp-docker-data-volumes.sh
Created January 10, 2017 10:37
Copies all the local docker data volumes to a new machine via ssh
#/!bin/bash
[ $# -lt 1 ] && echo "usage: $(basename $0) <target_ssh_user@target_ssh_hostname>" && exit 1;
target="$1"
docker pull alpine
for volume in $(docker volume ls -q)
do
!#/bin/bash
git remote add github git@github.com:SeekersAdvisorsLabs/NEW_REPO.git
git push -u github master ; git push --all github; git push --tags github