Skip to content

Instantly share code, notes, and snippets.

@JuniorLima
JuniorLima / admin.py
Created January 23, 2014 15:06
Autocomplete com Yawd Admin
from forms import SideBarExampleAdminForm, WidgetsExampleAdminForm
class WidgetsExampleAdmin(admin.ModelAdmin):
form = WidgetsExampleAdminForm
admin_site.register(WidgetsExample, WidgetsExampleAdmin)
@JuniorLima
JuniorLima / read.me
Last active August 29, 2015 13:56
Comandos SSH - Ubuntu
Exclue arquivos terminados em 'pyc' do diretório altosnoticia
find altosnoticia/ -name '*.pyc' -exec rm {} \;
Ver erros do NGINX
/var/log/nginx/error.log
@JuniorLima
JuniorLima / youtube.html
Created May 29, 2014 12:02
Embed de vídeo do YouTube
http://i1.ytimg.com/vi/embed/maxresdefault.jpg
@JuniorLima
JuniorLima / altera_imagem.py
Created July 31, 2014 13:34
Apagar imagem do diretório
class Photo(models.Model):
image = ImageField(...) # works with FileField also
def save(self, *args, **kwargs):
# delete old file when replacing by updating the file
try:
this = Photo.objects.get(id=self.id)
if this.image != self.image:
this.image.delete(save=False)
@JuniorLima
JuniorLima / base.html
Last active August 29, 2015 14:08
Buscas no Django
{% load staticfiles %}
<html>
<head>
<title>{% block title %}{% endblock %}</title>
</head>
<body>
<img src="{% static "images/sitelogo.png" %}" alt="Logo" />
{% block content %}{% endblock %}
</body>
</html>
@JuniorLima
JuniorLima / local_settings.py
Created June 25, 2015 20:20
local_settings
# -*- coding: utf-8 -*-
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'institucional',
'USER': 'root',
'PASSWORD': 'root',
@JuniorLima
JuniorLima / supervisord.conf
Created September 10, 2015 13:17
ascii upload image django
# /etc/supervisor/supervisord.conf
environment=LANG="en_US.utf8", LC_ALL="en_US.UTF-8", LC_LANG="en_US.UTF-8"
@JuniorLima
JuniorLima / comandos_iptables.sh
Last active April 11, 2017 22:52
IPTABLES - Senac Teresina
# CLIENTE
10.19.8.196
# SERVIDOR
10.19.8.109
#Ver regas
iptables -L
# Bloquear conexões via SSH de cliente
@JuniorLima
JuniorLima / leia_me.md
Last active April 6, 2017 00:14
Instalação de Firewall, Servidor e Cliente

Atividade Redes SENAC

Configurando servidor de firewall, com servidor e máquinas cliente.

Apresentação das máquinas

Firewall Debian - Servidor Debian - Cliente Windows XP - Cliente Windows XP -

@JuniorLima
JuniorLima / letra.css
Created January 11, 2021 16:02
Holyrics + Navegador
.screen-custom {
}
.text-custom {
position: relative;
}
.text-custom span:not(:empty) {
background-color: rgba(67, 50, 42, 0.7);
display: grid;