Saturday, January 23, 2016

Java Web Services


  • Specifications
    • JAX-RS    (Java API for RESTful Web Services)
      • implementations:
        • Jersey
        • Apache CXF
        • RESTEasy (JBoss implementation)
    • JAX-WS     (Java API for XML Web Services)
      • implementations:
        • part of the J2EE platform
        • Apache CXF
        • Axis2
      • based on SOAP
  • Implementations
    • Jersey
    • Apache CXF
      • https://cxf.apache.org/
      • WS framework
      • JAX-WS and  JAX-RS  front end APIs support
      • mainly SOAP: good for client-side WSDL services
      • can speak with SOAP, XML/HTTP, RESTful HTTP

Tuesday, January 5, 2016

PostgreSQL / Postgres / Postgre


lg@lgstage11:~$ psql -U user -p 5432 mydb

mydb=> \dt

 Liste des relations
 Schéma |       Nom       | Type  | Propriétaire
--------+-----------------+-------+--------------
 public | shop_c           | table | user
 public | shop_ean       | table | user
(2 lignes)

mydb=> \x      -> formatting

select * from shop_e limit 10;

service postgresql stop
service postgresql start

psql -U user --password
if this complains that the user doesn't have a database, you can do it another way:
postgre@machine:  createuser search
postgre@machine:  createdb search

\copy (select lt.image.lt_kimage_id from lt.image LIMIT 100000) To '/tmp/test.csv';

DELETE FROM image WHERE image_id IN (select image.image_id from image INNER JOIN keyword ON image_id = keyword.image_id WHERE keyword.keyword LIKE '%_dead' ORDER BY image_id LIMIT 200000);

-- if "psql" doesn't work, do this first:
    su - postgres
 https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546
.
.

    Thursday, November 26, 2015

    Some Python packages


    yum install python27

    ---- install numpy
    yum install python27-pip python27-devel parallel
    cd /usr/bin
    ln -s pip2.7 pip
    pip install --upgrade pip
    pip install requests solrpy
    yum install gcc
    pip install numpy

    ---- numpy, scipy on ubuntu
    yum install python-pip python-dev build-essential
    yum install libatlas-base-dev gfortran
    pip install numpy scipy

    ---- scipy on centOS
    yum install lapack-devel
    pip install scipy

    ---- Install pip
    yum install python-pip
    if you have an error like: "urllib3/util/ssl_.py:90: InsecurePlatformWarning" do:
    sudo yum remove python-openssl

    ---- look for a package:
    pip search requests |grep requests
    ---- see if it is installed
    pip show requests
    ---- see all installed
    pip freeze

    ---- MySQL
    pip install MySQL-python       didn't work right away. I had to do this

    yum search all MySQL
    yum install MySQL-client
    yum install MySQL-devel
    yum install MySQL-python27

    ---- image hash
    pip install ImageHash

    --- look for local Python package
    pip list | grep cv

    --- my-virtualenv
           (if  version < Python 3.3:    virtualenv my-virtualenv -p /usr/bin/python)
           /opt/homebrew/bin/python3.10 -m venv my-virtualenv
      my-virtualenv$ source bin/activate
                --- important: use pip from the virtualenv ---
                --- start by doing "pip install --upgrade pip"
      (my-virtualenv) lee@mycomp:~/python/flask/my-virtualenv$ deactivate

    (my-virtualenv) lee@G10054 scripts % which python3
    /Users/lee/dev/es/src/main/scripts/my-virtualenv/bin/python3
    .
    .

    Sunday, October 18, 2015

    Postfix survival kit (SMTP server)

    http://www.postfix.org/

    config in:
    /etc/postfix/main.cf

    Tuesday, September 1, 2015

    curl survival kit

    (-v verbose)

    curl --request PUT --user admin http://maven.toot.com/nexus/content/repositories/releases/com/leguide/search3s/search-3S/3.5.4/threesidx4/lg_platform_scheduler_server.conf.xml --data-binary @/home/lee/lee_dev/search-platform/platform-scripts/config-prod/price_intelligence/threesidx4-cluster/lg_platform_scheduler_server.conf.xml

    curl -X PUT "http://127.0.0.1:9200/index_tmp/_doc/1" -H 'Content-Type: application/json' -d'{"title": "whatever"}'

    Saturday, August 22, 2015

    apt-get survival kit

    apt-cache policy gcc-4.8-base
    apt-get --simulate install libgfortran3
    apt-get -f install       (fix broken)
    apt-get update
    ppa purge

    aptitude install libgfortran3    : automatically downgrade packages