Skip to content

Instantly share code, notes, and snippets.

View ojgarciab's full-sized avatar
👨‍👩‍👧‍👦
Busy for family reasons

Óscar García ojgarciab

👨‍👩‍👧‍👦
Busy for family reasons
View GitHub Profile
@ojgarciab
ojgarciab / install-docker.sh
Created September 15, 2023 12:28 — forked from nathzi1505/install-docker.sh
Docker and Nvidia Docker installation in Ubuntu 20.04 LTS
# WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned.
# Docker
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
docker --version
@ojgarciab
ojgarciab / php-error-logstash.conf
Created June 28, 2022 10:33 — forked from kamermans/php-error-logstash.conf
Logstash parser for PHP's error_log to combine multline stack traces / errors into one event
input {
stdin {
codec => multiline {
pattern => "^\[%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME} %{TZ}\]"
negate => true
what => "previous"
auto_flush_interval => 10
}
type => "php-error"
}
@ojgarciab
ojgarciab / 7.1.- FreeTDS, UnixODBC, php-mssql
Last active December 15, 2021 07:47 — forked from merolhack/7.1.- FreeTDS, UnixODBC, php-mssql
RHEL (CentOs & Oracle Linux): Conexión con SQL Server
# Instalación de FreeTDS y dependencias:
yum install freetds freetds-devel -y
# Instalación del módulo de PHP:
yum --enablerepo=remi install php-mssql -y
# Habilitar los siguientes booleanos:
setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db 1
@ojgarciab
ojgarciab / gist:32d085858d0a469f6842ee78b82a4666
Last active November 17, 2021 10:47 — forked from ealbinu/gist:3080619
Correo con PHP utilizando mail() codificado en UTF-8
<?php
$correo_destinatario = "";
$nombre_remitente = "";
$correo_remitente = "";
$asunto = "";
$mensaje = "";
/* Hacemos uso de mb_encode_mimeheader para codificar correctamente caracteres especiales */
$headers = 'From: "' . mb_encode_mimeheader($nombre_remitente) . '" <' . $correo_remitente . ">\r\n"
. 'Reply-To: ' . $correo_remitente . "\r\n"
import pytesseract
import sys
import argparse
try:
import Image
except ImportError:
from PIL import Image
from subprocess import check_output
#!/usr/bin/perl
use strict;
sub deswappify {
my $pid = shift;
my $fh = undef;
my $start_addr, $end_addr;
if(open F, "/proc/$pid/smaps") {
@ojgarciab
ojgarciab / control.php
Last active October 16, 2015 06:29 — forked from ChrisGehm/control.php
<?php
require_once 'config.php';
$diferencia_mes = " ";
$estado = " ";
$mes_actual = " ";
$mes_actual = date("m");
$año_actual = date("Y");
//lista completa
@ojgarciab
ojgarciab / app.js
Last active August 29, 2015 14:23 — forked from ricardosiri68/app.js
/*jslint nomen: true, debug: true, evil: true, vars: true, browser: true,
devel: true */
/*global */
var CountDown = function(options){
this.button = document.getElementById(options.button);
this.counter = document.getElementById(options.counter);
this.button.addEventListener('click', this.count_down.bind(this), false);