Posts tagged macos

All posts

Stop MySQL being loaded on OS X boot

Right now I find myself working on a porject that uses MongoDB, and sometimes I work on projects with PostgreSQL and other times on projects that use MySQL. The difference is that I have to manually load both MongoDB (mongod) and PostgreSQL (I use the Heroku app) when I want to use them, but MySQL is loaded in my system by default.

Thinking on an all-or-none solution, I decided to convert MySQL in a service run on demand, instead of a resident one. I have installed MariaDB via Homebrew, so:

  ➜  julitrows.gitlab.com git:(master) ✗ brew info mariadb
  mariadb: stable 5.5.34, devel 10.0.7
  http://mariadb.org/
  ...
  **BLAH BLAH BLAH **
  ...
  To load mariadb after an update
      launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
      launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

So the second to last line is what we are looking for. By running:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

We’ll remove mysql from being run at startup.

And when we want to use mysql, just do mysql.server start, and mysql.server stop

Easy!


Permisos de escritura de la AEAT en OS X y GNU/Linux

DISCLAIMER: This post is in Spanish as its potential target are Spanish freelancers struggling with the Electronic Administration. Feel free to use Google Translator to know what the fuss is about.

Algunas declaraciones de la AEAT, creo que las que se ahcen a través de aplicaciones instaladas en el disco duro tipo P.A.D.R.E., requieren una carpeta llamada aeat en la carepeta /Usuarios/fulanito con los siguientes permisos:

  • Usuario: Leer y escribir
  • Staff: Sólo leer
  • Everyone: Leer y escribir <– este hay que ponerlo así, por defecto está en “Sólo leer”

Pero otras gestiones, como por ejemplo el modelo 037 que he tenido que hacer hoy mismo, requieren que la carpeta aeat exista en el DIRECTORIO RAIZ DEL SISTEMA, es decir, para poder hacer todas las gestiones (o al menos a las que yo me he enfrentado por ahora), necesitaremos estas dos carpetas en nuestro sistema:

Macintosh HD/aeat
Macintosh HD/Usuarios/fulanito/aeat

O hablando en términos de consola:

/aeat
/Users/fulanito/aeat <-- cambia *Users* por *home* si estás en GNU/Linux

Los permisos con chmod creo que serían 757, es decir rwxr-xrwx

Francamente, no sé como de seguro es tener una carpeta con permisos de escritura para todo dios en el directorio raíz del sistema, pero tener que dar permisos de escritura en el directorio raíz a una aplicación que se ejecuta en el espacio de aplicaciones del usuario me huele a chapuza gorda. Estaría bien que unificaran los criterios de escritura y todo fuera a parar a la carpeta personal del usuario.

Lo más absurdo de todo es que he averiguado el error de escritura en el raíz a base de mirar el log que el applet de la AEAT escribe en… tachán tachán… la carpeta aeat de mi espacio de usuario, sin ningún tipo de problema. Que alguien me lo explique.


Clean unneeded dependencies on Homebrew

Let’s say you’ve uninstalled a formula with Hombrebrew that it’s no longer needed. Homebrew won’t clean the associated dependencies that are no longer needed. You can do this by running:

$ brew rm $(join <(brew leaves) <(brew deps <FORMULA>))

This calls for the formula dependencies and does a join with the installed packages that are not dependencies of other packages, and uninstall the resulting list of packages.

CAVEAT EMPTOR: This method uninstalled Qt from my computer, and I needed it for Capybara. This happened because brew only takes into account dependencies of programs installed with brew. Any dependency from outside brew is ignored.