Skip to content

Instantly share code, notes, and snippets.

@jgcasta
jgcasta / date2XMLGregorianCalendar.java
Last active December 16, 2015 21:39
Return a XMLGregorianCalendar from a Date object in java
public static XMLGregorianCalendar date2XMLGregorianCalendar(Date fecha, Date hora) {
Calendar calendarFecha = Calendar.getInstance();
calendarFecha.setTime(fecha);
Calendar calendarHora = Calendar.getInstance();
calendarHora.setTime(hora);
//System.out.println("hora->" + calendarHora.get(Calendar.HOUR_OF_DAY) + "/" + calendarHora.get(Calendar.MINUTE) + "/" +calendarHora.get(Calendar.SECOND));
@jgcasta
jgcasta / MavenCheatSheet.txt
Created May 11, 2013 20:18
Maven Cheat Sheet
Install an external dependency into the local repository
$ mvn install:install-file -Dfile=<path-to-file> -DgroupId=Id=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
Generate a package
$ mvn package
Install into the local repository
@jgcasta
jgcasta / ShellDeleteOracleRecords.sh
Last active January 2, 2016 16:39
Delete Oracle records from a bash shell script
#!/bin/bash
#Delete Oracle table since 1 natural year
#
ANO=$(date +%Y)
ANTERIOR=$[ANO-1]
FBORRADO=$(date +%d-%m-$ANTERIOR)
MES=$(date +%m)
MESANTERIOR=$[MES-1]
@jgcasta
jgcasta / license-badges.md
Created June 1, 2016 07:26 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file. Easily copy and paste the code under the badges into your Markdown files.

Apache

Apache 2.0 License

License
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

BSD

@jgcasta
jgcasta / getTLE.py
Last active June 10, 2016 19:31
Get TLE orbital elements for a NORAD ID satellite and date
#!/usr/bin/env python
# -*- coding: utf-8
'''
GEt TLE orbital elements for a Satellite
@author Jose Gomez Castaño jgcasta@gmail.com
@version 1.0.0
@precondition username and password to login into www.space-track.org website is needed
@jgcasta
jgcasta / install_python_3.6.sh
Created December 26, 2016 15:12
Python 3.6 install
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar xvf Python-3.6.0.tgz
cd Python-3.6.0
./configure --enable-optimizations
make -j8
sudo make altinstall
python3.6
@jgcasta
jgcasta / sec_tutorial.md
Created March 17, 2017 20:34 — forked from tgrall/sec_tutorial.md
MongoDB Security Tutorial

#Simple MongoDB Security Tutorial

###1 - Start mongod without any "security option"

$ mongod --port 27017

@jgcasta
jgcasta / Createvm.sh
Created June 14, 2014 10:58
Shell script to create a VirtualBox Virtual machine
#!/bin/bash
#
# createvm.sh
#
# ver 1.0
#
# Jose Gomez Castaño jgcasta@gmail.com
#
# Create a Virtual Box Machine in the createPath directory with the name given in name variable.