Skip to content

Instantly share code, notes, and snippets.

View juelvaldivia's full-sized avatar
:octocat:
Working from home

Juel juelvaldivia

:octocat:
Working from home
View GitHub Profile
<?php
if(isset($_POST['email'])) {
// Debes editar las próximas dos líneas de código de acuerdo con tus preferencias
$email_to = "[email protected]";
$email_subject = "Contacto desde el sitio web";
// Aquí se deberían validar los datos ingresados por el usuario
if(!isset($_POST['name']) || !isset($_POST['message']) || !isset($_POST['email']))
{
update HIJO set HIJO.apellido = PADRE.apellido
from HIJO
join PADRE on PADRE.id = HIJO.idPadre
SELECT
t1.COLUMN_NAME AS columna_nombre,
t1.COLUMN_DEFAULT AS columna_defecto,
t1.IS_NULLABLE AS columna_nulo,
t1.DATA_TYPE AS columna_tipo_dato,
COALESCE(t1.NUMERIC_PRECISION,
t1.CHARACTER_MAXIMUM_LENGTH) AS columna_longitud,
PG_CATALOG.COL_DESCRIPTION(t2.OID,
t1.DTD_IDENTIFIER::int) AS columna_descripcion,
t1.DOMAIN_NAME AS columna_dominio
SELECT
t1.TABLE_NAME AS tabla_nombre,
PG_CATALOG.OBJ_DESCRIPTION(t2.OID, 'pg_class') AS tabla_descripcion
FROM
INFORMATION_SCHEMA.TABLES t1
INNER JOIN PG_CLASS t2 ON (t2.relname = t1.table_name)
WHERE
t1.TABLE_SCHEMA='public'
ORDER BY
t1.TABLE_NAME;
SELECT
t1.TABLE_NAME AS tabla_nombre,
t1.COLUMN_NAME AS columna_nombre,
t1.COLUMN_DEFAULT AS columna_defecto,
t1.IS_NULLABLE AS columna_nulo,
t1.DATA_TYPE AS columna_tipo_dato,
COALESCE(t1.NUMERIC_PRECISION,
t1.CHARACTER_MAXIMUM_LENGTH) AS columna_longitud,
PG_CATALOG.COL_DESCRIPTION(t2.OID,
t1.DTD_IDENTIFIER::int) AS columna_descripcion,
__author__ = 'juel'
# -*- coding: 850 -*-
from eralchemy import render_er
import getpass
import psycopg2
salida = False
while not salida :
print 'Entre las credenciales del servidor--->'
create sequence table_id_table_seq;
ALTER TABLE public.table ALTER COLUMN id_table SET DEFAULT nextval('"table_id_table_seq"'::regclass);
alter sequence table_id_table_seq
owner by table.id_table;
// valor por defecto en autoincrementable
ALTER SEQUENCE table_id_table_seq RESTART WITH 4
Para verificar si está o no activado SELinux
$ /usr/sbin/sestatus
SELinux status: disabled/enable
Para desactivar es necesario modificar el archivo de configuración de SELinux
en la opción "SELINUX=disabled"
$ vi /etc/selinux/config
ERROR: Service 'php-fpm' failed to build: OCI runtime create failed: container_linux.go:346:
starting container process caused "process_linux.go:297: applying cgroup configuration for
process caused \"open /sys/fs/cgroup/docker/cpuset.cpus.effective: no such file or directory\"": unknown
SOLUTION
sudo dnf install -y grubby && \
sudo grubby \
--update-kernel=ALL \
@juelvaldivia
juelvaldivia / ALIAS GIT
Created March 18, 2020 14:56
ALIAS GIT
alias add="git add ."
alias commit="git commit -am"
alias feature="git flow feature"
alias release="git flow release"
alias hotfix="git flow hotfix"
alias check="git checkout"
alias branch="git branch"
alias develop="git checkout develop"
alias master="git checkout master"
alias deploy_prod="git push production master"