This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Action Export CSV to DJANGO 2.0 | |
import csv | |
from django.http import HttpResponse | |
def export_csv(modeladmin, request, queryset): | |
response = HttpResponse(content_type="text/csv") | |
response['Content-Disposition'] = 'attachment; filename="export.csv"' | |
writer = csv.writer(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: "path/to/csvData", | |
type: "GET", | |
dataType: "text", | |
success: function (data) { | |
csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(data); | |
$("#exportsags").attr({ | |
"href": csvData, | |
"download": "sag_data.csv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.6 | |
# coding=utf-8 | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import smtplib | |
import urllib.request | |
import subprocess | |
import shlex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
logFile="/var/log/asterisk/messages" | |
debugFile="/var/log/asterisk/ips-bloqueados.log" | |
attempts=3 | |
whitelist="127.0.0.1" | |
name=`basename $0` | |
checkIsScriptRunning=$(ps | grep $name | grep -v grep | wc -l) | |
if [ $checkIsScriptRunning -ge 3 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import re | |
class CEP: | |
MESSAGE_NUMBER_OUT_OF_RANGE = "Number out of range [100000-999999]" | |
MESSAGE_INVALID_NUMBER = "Invalid number" | |
def valid(self, number): | |
self.messages = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meu telefone Cisco 7912 estava com a tela em branco e as luzes sempre acesas, o telefone não realiza o boot. | |
Eu resolvi este problema subindo um servidor DHCP Server + tftp usando dnsmasq no arch linux | |
Utilizando estes links como referencia | |
https://wiki.archlinux.org/title/Dnsmasq_(Portugu%C3%AAs) | |
https://bbs.archlinux.org/viewtopic.php?id=271778 | |
https://itblog.su/downloads/cp7912r.zup | |
https://github.com/staskobzar/cisco_prov/blob/master/sip/Readme7912.txt | |
https://github.com/staskobzar/cisco_prov/tree/master/sip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"400": { | |
"title": "Erro de download de m\u00eddia", | |
"description": "Falha ao baixar a m\u00eddia do remetente." | |
}, | |
"402": { | |
"title": "Elegibilidade da empresa (problema de pagamento)", | |
"description": "Verifique a configura\u00e7\u00e3o de pagamento no Gerenciador do WhatsApp e tente novamente." | |
}, | |
"408": { |