Skip to content

Instantly share code, notes, and snippets.

View W360S's full-sized avatar

World 360° Services W360S

View GitHub Profile
@W360S
W360S / Install-Magento.md
Last active August 21, 2016 01:08 — forked from rafaelstz/Install-Magento-1.md
Install Magento 1.9.2.4 (With Sample Data)
@W360S
W360S / Install & Start Docker
Created August 21, 2016 01:10
Install & Start Docker
Install
There are two ways to install Docker Engine. You can install using the yum package manager. Or you can use curl with the get.docker.com site. This second method runs an installation script which also installs via the yum package manager.
Install with yum
Log into your machine as a user with sudo or root privileges.
Make sure your existing yum packages are up-to-date.
$ sudo yum update
Add the yum repo.
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},sl
@W360S
W360S / Chown File Permission
Created August 22, 2016 07:59
Chown File Permission
chmod Wordpress
find . -type d -exec chmod 755 '{}' \;
find . -type f -exec chmod 644 '{}' \;
@W360S
W360S / find command
Created February 13, 2017 08:53
find / -xdev 2>/dev/null -name "website_templates.xml"
find / -xdev 2>/dev/null -name "website_templates.xml"
@W360S
W360S / recompile-nginx-on-CentOS-to-support-HTTP-2
Created February 13, 2017 17:34
recompile-nginx-on-CentOS-to-support-HTTP-2
# recompile-nginx-on-CentOS-to-support-HTTP-2
In CentOS command line, or an SSH terminal and enter the following command (note the uppercase letter V):
nginx -V
nginx version: nginx/1.10.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-file-aio --with-threads --with-ipv6 --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-ht
cd /usr/local/src/
curl https://curl.haxx.se/download/curl-7.51.0.tar.gz | tar xvz
# wget http://www.openssl.org/source/openssl-1.0.2.tar.gz
# tar -xzvf openssl-1.0.2k.tar.gz
cd curl-7.51.0
./configure --with-openssl=/usr/local/src/openssl-1.0.2 && make && make install
curl -V
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 640, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 677, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 333, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 101, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 326, in checked_call
@W360S
W360S / fixd odoo invalid database name
Created September 26, 2017 13:48
fixd odoo invalid database name
cd path/to/odoo
sed -i 's/matches="[^"]*"//g' addons/web/static/src/xml/base.xml
it is not that simple, Odoo code still depends on the old unmaintained python-pypdf
However, there is an easy workaround : create a fake python-pdf package and install python-pyPdf from Pipy (Python repository). All of this will be done as root :
install equivs to create fake packages and python-pipto install package from Python repository
run equivs-control python-pypdf, this will create and populate the file python-pypdf
edit the file like below (dot and space under "Description" are mandatory) :
Section: python
Package: python-pypdf
Version: 1.13