Ok

En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies. Ces derniers assurent le bon fonctionnement de nos services. En savoir plus.

Le dernier Mohican - The last Mohican

  • Faurisson

    Robert Faurisson

  • L 'Univers d'Edgar Cayce

    http://www.histoireebook.com/public/ebook2/Koechlin_De_Bizemont_Dorothee-Marguerite_-_L_Univers_d_Edgar_Cayce_Tome_2.zip

    A télécharger

  • [Postgresql] Change the owner of the tables

    $ psql -qAt -d mydatabase -c "SELECT 'ALTER TABLE '||schemaname||'.'||tablename||' OWNER TO new_owner;' FROM pg_tables WHERE schemaname = 'myschema'" > data.txt

     

    $ psql < data.txt -d mydatabase

     

    source : http://penningpence.blogspot.fr/2014/09/changing-owner-of-multiple-database.html

  • Pgbouncer [postgres]

    Installer pgbouncer , configurer le .ini :

    cat /etc/pgbouncer/pgbouncer.ini

     

    [databases]
    <aliasBDD> = dbname=test user=pg_test port=5433 pool_size=48

    [pgbouncer]
    logfile = /var/log/pgbouncer/pgbouncer.log
    pidfile = /var/run/pgbouncer/pgbouncer.pid
    auth_file = /etc/pgbouncer/userlist.txt
    listen_addr = <hostname>-pgb
    listen_port = 5432
    auth_type = trust
    admin_users = pgbouncer
    stats_users = monitor

    pool_mode = transaction

    #server_reset_query =
    server_reset_query =
    max_client_conn = 1800
    default_pool_size = 20
    unix_socket_dir = /tmp

    ignore_startup_parameters = extra_float_digits, application_name
    server_check_query = select 1
    server_check_delay = 10
    log_connections = 1
    log_disconnections = 1
    log_pooler_errors = 1

     

    Se connecter au pgbouncer :

    su - pgbouncer

    psql

    show databases : affiche les databases liés

     

  • [MYSQL] Explain requetes lentes ?

    A quoi ça sert de faire un explain sur une requete lente?

     

    Alors pour info dans une requête quand tu ne mets pas les simples quotes sur les types varchar, et ben

    => MySQL n'utilise pas l'index.

     

     

    Bouuuhh

  • Get Op

    #!/bin/bash
    function usage
    {
     if [ $# -gt 0 ]; then
            echo $@ >&2
     fi
     cat << EOF >&2
    usage : t [-v][-h host_name][-P port_num][-u user_name][-p password][-D db_name]
    Other parameters (-h, -P, ... -D) = Same as mysql command (refer to mysql documentation).
    EOF
     exit 1
    }
    function cat_args
    {
     echo $msql $1 $2
    }
    msql='/usr/local/mysql5/bin/mysql '

    called_with="$@"
    while getopts "vh:P:u:p:D:" arg
    do
            case $arg in
                    h|P|u|p|D)
                            msql=$(cat_args -$arg$OPTARG)
                            ;;
                    v)
                            verbose=1
                            ;;
                    *|?)
                            usage incorrect parameter
                            ;;
            esac
    done

    echo $msql
    echo show tables|$msql