Skip to content

Instantly share code, notes, and snippets.

View dersteppenwolf's full-sized avatar
🏠
Working from home

Juan Carlos Méndez dersteppenwolf

🏠
Working from home
View GitHub Profile
@dersteppenwolf
dersteppenwolf / service-monitor-2.py
Created August 16, 2012 04:23 — forked from Motoma/service-monitor-2.py
Script para monitorear servicios tcp, http y ftp
#! /usr/bin/env python
from os import system
from urllib2 import urlopen
from socket import socket
from sys import argv
from time import asctime
import smtplib
import string
from ftplib import FTP
@dersteppenwolf
dersteppenwolf / publish_wordpress.py
Created August 18, 2012 15:45
Publicar información en Wordpress utilizando python
#!/usr/bin/python
# -*- coding: latin-1 -*-
#basado en el script originalmente publicado en
#http://www.jansipke.nl/using-python-to-add-new-posts-in-wordpress/
import datetime, xmlrpclib
from xml.sax.saxutils import escape
wp_url = "http://server.com/wordpress/xmlrpc.php"
wp_username = "usuario"
@dersteppenwolf
dersteppenwolf / arcpy_compress_analyze.py
Created August 23, 2012 04:43
Comprimir SDE y Analizar Schema (Arcgis 10, arcpy)
#-*- coding: UTF-8 -*-
#Script para ejecutar el compress y analyze de la base de datos
#Basado en el Script original para arcgis 9.3.1 por Mike Long - [email protected]
import string, os, arcpy, time
import traceback,sys
from arcpy import env
# Set the date.
@dersteppenwolf
dersteppenwolf / arcpy_proper_case.py
Created September 17, 2012 16:33
a python script to convert arcmap labels to proper case
import re
def title(value):
value = value.decode('utf-8')
t = re.sub("([a-z])'([A-Z])", lambda m: m.group(0).lower(), value.title())
return re.sub("\d([A-Z])", lambda m: m.group(0).lower(), t)
title(!NOM_MUNICI!)
@dersteppenwolf
dersteppenwolf / generate_twitter_list_rss_.rb
Created October 24, 2012 23:25
Generate a RSS of a Twitter feed using Ruby and Twitter API v1.1
require 'rubygems'
require 'twitter'
require 'builder'
client = Twitter::Client.new(
:consumer_key => "your consumer key",
:consumer_secret => "your consumer secret",
:oauth_token => "your oauth token",
:oauth_token_secret => "your oauth secret"
)
@dersteppenwolf
dersteppenwolf / WordpressXMLRpcClient.java
Created November 23, 2012 16:15
Create New Posts in Wordpress using Java and XMLRpc
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
/**
* Create New Posts in Wordpress using Java
*
* //http://codex.wordpress.org/XML-RPC_WordPress_API/Posts#wp.newPost
#
# converts a shapefile to an elasticsearch geo_point type with this mapping:
#
# {
# "zipcode" : {
# "properties" : {
# "geometry": {
# "properties": {
# "coordinates": {
# "type": "geo_point"
import requests
import json
import random
import urllib
class MapInstance(object):
def __init__(self, definition, url, headers=None):
self.url = url
self.definition = definition
import os
import urllib
import urllib2
import base64
import json
import sys
import argparse
try:
import requests
except ImportError: