terça-feira, 7 de maio de 2013

Alterar monitor principal no ubuntu

Para alterar o monitor principal do Ubuntu, Mint, etc... (O monitor com a barra)

#!/bin/bash
# Author: Andrew Martin
# Credit: http://ubuntuforums.org/showthread.php?t=1309247
echo "Enter the primary display from the following:" # prompt for the display
xrandr --prop | grep "[^dis]connected" | cut --delimiter=" " -f1 # query connected monitors

read choice # read the users's choice of monitor

xrandr --output $choice --primary

mysql user and database

Moved to a more complete version here


Criar a base de dados:
mysql> CREATE database my_db;

Criar um utilizador mysql:
mysql> CREATE USER 'my_user'@'localhost' IDENTIFIED BY 'my_pass';

Verificar as permissões do utilizador:
mysql> SELECT * FROM mysql.user WHERE User = 'my_user'\G

Verificar os GRANTS de um utilizador:
mysql> SHOW GRANTS FOR my_user;