Skip to content

Instantly share code, notes, and snippets.

View jthmiranda's full-sized avatar
🎯
Focusing

Jonathan Miranda jthmiranda

🎯
Focusing
View GitHub Profile
@jthmiranda
jthmiranda / newdate.java
Last active August 29, 2015 14:27
new data jasperreport
// para insertar fecha en campo textfield
new java.text.SimpleDateFormat("dd-MMM-yyyy HH:mm:ss z", java.util.Locale.US).format(new java.util.Date())
// para mostrar fecha en español
new Locale("ES")
// usando groovy
new groovy.lang.GroovyShell().evaluate("Calendar cal = Calendar.getInstance(); cal.set(2009, 8, 8); return cal.getTime(); ")
![alt text](http://i.stack.imgur.com/O56lf.jpg "ejemplo de fecha")
@jthmiranda
jthmiranda / nginx.conf
Last active September 1, 2015 18:00
algunas configuraciones de reverse proxy, algunas faltan afinar
server {
listen 80;
server_name app.bolpros.com 10.11.25.2:8000;
# Strict Transport Security
add_header Strict-Transport-Security max-age=2592000;
rewrite ^/mobile.*$ https://10.0.2.15/web_mobile/static/src/web_mobile.html permanent;
rewrite ^/webdav(.*)$ https://10.0.2.15/webdav/$1 permanent;
@jthmiranda
jthmiranda / mesos-dns-setupd.md
Created September 1, 2015 22:40
detalle para configurar mesos-dns con docker

Mesos-DNS

Scripts for setting up

sudo mkdir /etc/mesos-dns
sudo vi /etc/mesos-dns/config.json

config.json

@jthmiranda
jthmiranda / ejemploo_llaves
Created September 10, 2015 17:57
{,} en los comandos de Linux y Unix?
Por lo general utilizo esto {,} cuando necesito crear archivos numerados: archivo1, archivo2, archivo”n”:
> [ rafael ] ~ $ touch archivo{1..3}.log
> [ rafael ] ~ $ ls -lt
total 0
-rw-r--r-- 1 rafael 0xl337 0B Nov 4 00:52 archivo1.log
-rw-r--r-- 1 rafael 0xl337 0B Nov 4 00:52 archivo2.log
-rw-r--r-- 1 rafael 0xl337 0B Nov 4 00:52 archivo3.log
> [ rafael ] ~ $
@jthmiranda
jthmiranda / move.sh
Last active September 14, 2015 21:14
Moving throught SSH
# to move file or folders
tar zcf - filename | ssh user@ipaddress "cd /; tar xvzf"
# to move docker images to another host
docker save image-name | bzip2 | pv | ssh user@host "bunzip2 | docker load"
# using docker machine (testing yet)
docker $(docker-machine config mach1) save <image> | docker $(docker-machine config mach2) load
# send local file to container (just need to modify through host to host)
#!/bin/bash
IMAGE_IDS=$(docker images -q --filter="dangling=true")
if [ -n "$IMAGE_IDS" ]; then
docker rmi $IMAGE_IDS > /dev/null 2>&1
fi
@jthmiranda
jthmiranda / docker.service
Created October 19, 2015 14:02
workaround for -> WARNING: Module br_netfilter not found | go to /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
[Service]
Type=notify
ExecStart=/usr/bin/docker daemon -g /home/oracle/docker/docker/ -H fd://
MountFlags=slave
@jthmiranda
jthmiranda / add-apt-repository
Created October 21, 2015 13:42
kali linux 2 code replacement for add-apt-repository /usr/bin/add-apt-repository
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
@jthmiranda
jthmiranda / index.html
Created October 29, 2015 17:38
filter interval of time angularJS 1
<div ng-app="APP" ng-controller="MainController">
<select>
<option ng-repeat="h_m in [] | time:8:20:15">{{h_m}}</option>
</select>
</div>
@jthmiranda
jthmiranda / app.desktop
Created June 12, 2013 21:23
Create a app laucher on Unity enviroment
[Desktop Entry]
Name=Napster
Comment=p2p
Exec=/home/user/Documentos/app-1-1-bin-32/appname
Icon=/home/user/Documentos/app-1-1-bin-32/icons/logo.xpm
Terminal=false
Type=Application
#Name: application name
#Comment: comment