Skip to content

Instantly share code, notes, and snippets.

View checco's full-sized avatar
🐗
I'm always hungry

Francesco Latini checco

🐗
I'm always hungry
View GitHub Profile
@checco
checco / HotelDescriptiveInfoRQ.rb
Last active October 17, 2016 07:59
OTA_HotelDescriptiveInfoRQ with class NET:Http
require 'uri'
require 'openssl'
require 'net/http'
url = URI("https://www.hostelspoint.com/xml/xml.php")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
@checco
checco / PingRQ.rb
Last active October 17, 2016 08:01
OTA_PingRQ with class NET:Http
require 'uri'
require 'openssl'
require 'net/http'
url = URI("https://www.hostelspoint.com/xml/xml.php")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
@checco
checco / url_check.py
Last active August 1, 2018 15:13
Python script that checks the HTTP status code of an URL. You have to write a list of URLs (url_list.csv), with the desired status code on the second column (if the second column is empty it takes a 200 like default value). You can use this script for automatic testing some URLs of your internal/external environment
#!/usr/bin/env python
import requests
file = "url_list.csv"
with open(file, 'r') as f:
for line in f:
line += ' '
url = line.split(' ')[0].strip()
@checco
checco / vagrant-hosts.sh
Created April 8, 2016 15:41
Script that return a list of running Vagrant machine (IP HOSTNAME), so you can copy and paste it on your /etc/hosts
#!/bin/bash
interface="eth0"
hosts=`vagrant status | grep running | awk '{print $1}'`
if [ `echo ${hosts} | wc -w` -gt '0' ]
then
for host in ${hosts}
do
ip=`echo "ip a sh dev ${interface} | grep 'inet ' | sed 's/\// /g'" | vagrant ssh ${host} | awk '{print $2}'`
@checco
checco / send-telegram.py
Last active January 22, 2017 23:36
Python 3 script which permit to your bot to send messages in a group chat or a single person
#!/usr/bin/env python3
import urllib3
import certifi
import sys
# Generate a bot ID here: https://core.telegram.org/bots#botfather
bot_id = ''
chat_id = ''