2014年9月5日 星期五

How to setting Asterisk to Amazon

Hello,

I would like you to check and configure the following to allow Asterisk work correctly:

1. Edit your "sip.conf" and add the following settings.

    $ vim  /etc/asterisk/sip.conf

      #add the two lines in your sip.conf
       [general]
       localnet=172.31.0.0/255.255.0.0
       externip=54.254.242.156
     
       [provider]
       nat=yes

2.  Reload asterisk.

     $ asterisk -rvvvvvvv

Looking forward to your feedback to assist in further troubleshooting.

Best regards,

Billy O.
Amazon Web Services
We value your feedback. Please, rate my response using the link below.

2014年8月31日 星期日

Database maps to Sqlalchemy

  1. use pip install "sqlacodegen".
  2. command $sqlacodegen mysql://users:pass@localhost/db_name --outfile tables.py.
  3. Finish.

2014年8月1日 星期五

uWSGI and Nginx

  1. uwsgi --socket /tmp/uwsgi.sock -w Flask:app --chmod-socket=666
  2. /etc/nginx/site-enable/
  3. # mysite_nginx.conf

    # the upstream component nginx needs to connect to
    upstream flask {
        server unix:///tmp/uwsgi.sock;
    }

    # configuration of the server
    server {
        # the port your site will be served on
        listen      7777;
        # the domain name it will serve for
        server_name PinLiang.example.com; # substitute your machine's IP address or FQDN
        charset     utf-8;

        # max upload size
        client_max_body_size 75M;   # adjust to taste

        # Django media
        location /media  {
            alias /home/pinliang/Restful/Money/media;  # your Django project's media files - amend as required
        }

        location /static {
            alias /home/pinliang/Restful/Money/static; # your Django project's static files - amend as required
        }

        # Finally, send all non-media requests to the Django server.
        location / {
            uwsgi_pass  flask;
            include     /home/pinliang/Restful/Money/uwsgi_params; # the uwsgi_params file you installed
        }
    }
  4. [uwsgi]
    chdir = /home/pinliang
    module = Flask
    callable = app
    master = true
    processes = 1
    socket = /tmp/uwsgi.sock
    chmod-socket = 666
    vacuum = true

2014年6月4日 星期三

How to used ssh and sftp command?

If your want remote server use default Port, then you just use command:

$ ssh yourremotename@ipaddress
$ sftp yourremotename@ipaddress

If remote server have setting special port then use command:

$ ssh yourremotename@ipaddress -p yourportnumber
$ sftp -oPort=yourportnumber yourremotename@ipaddress

2014年5月26日 星期一

How to update/install openssl version 1.0.1g on Ubuntu 14.04 (Solve Openssl Heartbleed problem)

  1. Check your openssl version used command $ sudo openssl version
  2. If your version not 1.0.1g or 0.9.8, suggest to update openssl to 1.0.1g.
  3. Remove original openssl $ sudo apt-get purge openssl
  4. $ sudo apt-get autoremove && apt-get autoclean
  5. Download 1.0.1g source
  6. $ ./config --prefix=/usr/
  7. $ make
  8. $ make install_sw
  9. Used command $ sudo openssl version check your openssl version.

Reference:
  1.  make: *** [install_docs] Error 255
  2.  Documentation fixes for openssl-1.0.1g(Ubuntu 14.04)
  3.  Upgrade OpenSSL on Ubuntu 14.04

2014年5月14日 星期三

How to install Skype in Ubuntu 14.04

  1. I used operation system is 32Bit, Xfce.
  2. Download source code from Skype.
  3. $ apt-get install gdebi-core
  4. $ gdebi skype-ubuntu-precise_4.2.0.13-1_i386.deb

2014年5月5日 星期一

How to install Libreoffice used source code

  1. First Download Source Code.
  2. Decompress file.
  3. Go to path $ cd {your file path}/RPMS/ or $ cd {your file path}/DEBS/
  4. Install $ yum localinstall *.rpm (CentOS, Fedora) or $ dpkg -i *.deb (Ubuntu, Debian)
  5. Finish. 
P.S. Red words is command.