Código em python3 para ler linhas em um arquivo de texto e postar automaticamente. Lembrando que são necessários buscar no REST APIs Twitter as chaves de acesso e instalar o módulo tweepy (pip install tweepy).

Caso não tenha o pip instalado, basta buscar no repositório o python-pip ou fazer a instalação do arquivo no windows.

import tweepy, time, sys
 
argfile = str(sys.argv[1])
 
CONSUMER_KEY = 'inserir Consumer Key'
CONSUMER_SECRET = 'inserir Consumer Secret'
ACCESS_KEY = 'inserir Access Key'
ACCESS_SECRET = 'inserir Access Secret'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
 
filename=open(argfile,'r')
f=filename.readlines()
filename.close()
 
for line in f:
api.update_status(line)
time.sleep(60)

O time.sleep determina quantos segundos será postado cada linha do arquivo. No exemplo, a cada 60 segundos.

Após isso, basta executar o arquivo.py junto com o arquivo de texto.

Ex: python3 twitter.py twitter.txt

 

Download do Script

Fonte

Segue um script em Python 2 para testar se a porta está aberta ou fechada.

#!/usr/bin/python
import socket
ip = raw_input("Entre com o endereco de IP: ")
port = input("Entre com o numero da porta: ")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if sock.connect_ex((ip,port)):
    print "A porta", port, "esta fechada"
else:
    print "A porta", port, "esta aberta"