Skip to content

Instantly share code, notes, and snippets.

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

Juan Sebastian Ocampo Ospina Capriatto

🏠
Working from home
View GitHub Profile
@Capriatto
Capriatto / website-monitoring-1
Created March 4, 2020 19:19 — forked from adeekshith/website-monitoring-1
Scripts for website monitoring using Python
#!/usr/bin/env python
# sample usage: checksites.py eriwen.com nixtutor.com yoursite.org
import pickle, os, sys, logging
from httplib import HTTPConnection, socket
from smtplib import SMTP
def email_alert(message, status):
fromaddr = 'you@gmail.com'
@Capriatto
Capriatto / bash
Created June 24, 2018 00:11 — forked from forkb0mb84/bash
bash
#!/bin/bash
# First line of the script is shebang which tells the system how to execute
# the script: http://en.wikipedia.org/wiki/Shebang_(Unix)
# As you already figured, comments start with #. Shebang is also a comment.
# Simple hello world example:
echo Hello world!
# Each command starts on a new line, or after semicolon:
echo 'This is the first line'; echo 'This is the second line'
@Capriatto
Capriatto / java-snippets.md
Created March 1, 2018 22:03 — forked from thomd/java-snippets.md
Java code snippets

Java Snippets

Converting Strings to int and int to String

String a = String.valueOf(2); 
int i = Integer.parseInt(a);  

Convert String to Date

@Capriatto
Capriatto / normalise.py
Created April 1, 2016 23:37 — forked from j4mie/normalise.py
Normalise (normalize) unicode data in Python to remove umlauts, accents etc.
# -*- coding: utf-8 -*-
import unicodedata
""" Normalise (normalize) unicode data in Python to remove umlauts, accents etc. """
data = u'naïve café'
normal = unicodedata.normalize('NFKD', data).encode('ASCII', 'ignore')
print normal
@Capriatto
Capriatto / gist:3aff8f477fe0f1e11b86
Created December 15, 2015 23:37 — forked from ashokdhudla/gist:b1bf69088c2931d601cc
odoo 8 installation in ubuntu 14.04
Step 1. Build your server
sudo apt-get install openssh-server
sudo apt-get update
sudo apt-get dist-upgrade
Step 2. Create the Odoo user that will own and run the application
sudo adduser --system --home=/opt/odoo --group odoo
sudo su - odoo -s /bin/bash
exit
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
import javafx.animation.*;
import javafx.application.Application;
import javafx.event.*;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.util.Duration;