Skip to content

Instantly share code, notes, and snippets.

View danielnunez's full-sized avatar
:octocat:
Codeando eternamente

Daniel Nuñez S. danielnunez

:octocat:
Codeando eternamente
View GitHub Profile
version: '2'
services:
node1:
image: mariadb:10.1
environment:
- TERM=xterm
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_INITDB_SKIP_TZINFO=1
volumes:
- ~/Dev/docker/compose/galera/conf.d:/etc/mysql/conf.d
@danielnunez
danielnunez / docker-raspberry.md
Created May 26, 2020 04:18 — forked from pablokbs/docker-raspberry.md
Docker en raspberry
@danielnunez
danielnunez / odbc_setup_macos.md
Created May 30, 2019 18:50 — forked from arvsrao/odbc_setup_macos.md
Guide to accessing MS SQL Server in Mac OS X via PyODBC

Since I spent essentially two full days figuring out how to access a corporate MS SQL database pythonicly, I figured I should leave some notes, for future reference and to aid other souls looking to do the same.

These instructions and the commands that follow, were executed on a MAC OS 10.8.3 system. Additionally, I found this blog [post][1] especially helpful during the debugging process.

On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC][2]. Look elsewhere for a discussion about the differences between these driver managers. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing [pyodbc][3] requires iODBC as its manager.

Start by installing freeTDS libraries. FreeTDS allows unix programs to talk natively with MS SQL and SyBase databases.

brew intsall freetds
CREATE TABLE "City" (
id integer NOT NULL,
name text,
region_id integer
);
INSERT INTO "City" (id, name, region_id) VALUES (15101, 'Arica', 15);
INSERT INTO "City" (id, name, region_id) VALUES (15102, 'Camarones', 15);
INSERT INTO "City" (id, name, region_id) VALUES (15201, 'Putre', 15);
INSERT INTO "City" (id, name, region_id) VALUES (15202, 'General Lagos', 15);
@danielnunez
danielnunez / setup-single.sh
Created April 27, 2017 05:08 — forked from eamexicano/setup-single.sh
Inicializa repositorio de git. Lo envia vía ssh a un nuevo repositorio vacío y sincroniza con htdocs. Necesita el nombre del repo, usuario y modificar las rutas.
#!/bin/bash
SITIO="$1"
USUARIO="$2"
PUERTO="22"
REPOSITORIO_REMOTO="/var/repo/$SITIO"
SHEBANG="#!/bin/bash"
SITIO_HTDOCS="/var/www/$SITIO"
read -r -d '' HOOK <<EOF
${SHEBANG}
@danielnunez
danielnunez / gist:0dc5f8e58e5dc5c4b040
Created December 10, 2015 19:22
Largo máximo de VARCHAR en MySQL
Los valores en las columnas VARCHAR cadenas de longitud variable.
La longitud puede ser especificado como un valor de 0 a 255 antes
de MySQL 5.0.3, y de 0 a 65.535 en 5.0.3 y versiones posteriores.
El efectivo máximo de la longitud de un VARCHAR en MySQL 5.0.3 y
luego está sujeta a que el tamaño máximo de fila (65.535 bytes,
el cual es compartido entre todas las columnas) y el conjunto de
caracteres utilizado.
Uso TEXT tipos.
Los cuatro tipos de TEXTO son TINYTEXT, TEXT, MEDIUMTEXT, y LONGTEXT.