Skip to content

Instantly share code, notes, and snippets.

@jgcasta
jgcasta / ChangeVBMem.sh
Created June 14, 2014 10:59
Change memory size for a running Virtual Box virtual machine
#!/bin/bash
#
# ChangeVBMem.sh
#
# ver 1.0
#
# Jose Gomez Castaño jgcasta@gmail.com
#
# Change memory size for a running virtual machine. The system will be stopped and restarted
@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.
@jgcasta
jgcasta / IberiaSRTM2Tiles.sh
Last active August 29, 2015 13:59
Shell script to Download SRTM2 tiles for Iberia
#!/bin/bash
# Download SRTM2 Tiles for Iberia (http://www2.jpl.nasa.gov/srtm/)
#
# Jose Gomez Castano jgomez03@pdi.ucm.es
wget http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N35E000.hgt.zip
wget http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N35E001.hgt.zip
wget http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N35E002.hgt.zip
wget http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N35E003.hgt.zip
@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 / XmlGregorianCalendar2String.java
Last active August 29, 2015 13:55
Return a String date with format dd-MM-yyyy from a XMLGregorianCalendar
/**
* Return a String date with format dd-MM-yyyy from a XMLGregorianCalendar
*
* @param cal
* @return
*/
public String XmlGregorianCalendar2String(XMLGregorianCalendar cal){
String str = "";
SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy");
@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 / 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 / loadExternalFiles.xml
Last active April 21, 2018 17:25
Spring bean to describe how to load external property file, and Log4j.properties
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">