Skip to content

Instantly share code, notes, and snippets.

@sencloud
sencloud / gist:fb9a6b703824be9f0677e4a868f313ec
Created May 10, 2017 01:35
Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
如下,
root@ubuntu:/var/www# cat .htaccess
Header set X-Frame-Options SAMEORIGIN
报错。
解决方案,
root@ubuntu:/var/www# a2enmod
Your choices are: actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authnz_ldap authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta cgi cgid charset_lite dav dav_fs dav_lock dbd deflate dir disk_cache dump_io env expires ext_filter file_cache filter headers ident imagemap include info ldap log_forensic mem_cache mime mime_magic negotiation php5 proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi reqtimeout rewrite setenvif speling ssl status substitute suexec unique_id userdir usertrack version vhost_alias
package.json里的dependencies,组件版本通常都有关联性。
比如,下面这个,npm install是OK的。
"dependencies": {
"native-base": "^2.0.5",
"react": "^15.4.1",
"react-native": "0.41.2",
"react-native-banner": "^0.1.0",
"react-native-easy-toast": "^1.0.5",
Use command below to get react-native version:
$ react-native --version
react-native-cli: 2.0.1
react-native: 0.38.1
@sencloud
sencloud / gist:f97ff745519e315441185435559c8e03
Created March 21, 2017 10:02
use imagemagick batch convert jpg/png images
*** macOS, install brew first.
$ brew install imagemagick
*** I need to convert a lot of images with different width/height to same width(150px) and height(200px), and images cannot be deformation.
*** write a shell script below:
#!/bin/bash
for img in `ls *.jpg`
do
@sencloud
sencloud / gist:7da7cc1be8afbb5417e622c6512f76cc
Created March 21, 2017 09:33
install redis via macOS brew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install redis
*** To have launchd start redis now and restart at login:
*** brew services start redis
*** Or, if you don't want/need a background service you can just run:
*** redis-server /usr/local/etc/redis.conf
@sencloud
sencloud / gist:80c6d8eca59099036d067042db4f0448
Created March 20, 2017 02:30
PHP ioncube installation . (ENV: Ubuntu)
# wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
# tar xvfz ioncube_loaders_lin_x86-64.tar.gz
# PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
# cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" /usr/lib/php5/20121212/
# service apache2 restart
# service php5-fpm restart
# vi /etc/php5/apache2/php.ini
*** Find and Add:
zend_extension = /usr/lib/php5/20121212/ioncube_loader_lin_5.5.so
@sencloud
sencloud / gist:889bc1627b8822b63aedb3a723ed0e9f
Created March 20, 2017 02:27
Ubuntu Apache PHP Mysql installation
$ sudo su
# apt-get update
# apt-get install mysql-server mysql-client
*** New password for the MySQL “root” user:Repeat password for the MySQL “root” user:
# apt-get install apache2
# apt-get install php5 libapache2-mod-php5
# apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
# apt-get install phpmyadmin
*** enable useful mods