Sunday, September 18, 2016

CSS selector in Chrome using the example of Apple iPhone 7 Plus Availability Monitoring

The iPhone 7 Plus Reserve Page for HK is a dynamic web content as in

The basic javascript console code in Google Chrome for availability is as below

iPhone7availability    Select all
// proper case string prptotype (JScript 5.5+) String.prototype.toProperCase = function() { return this.toLowerCase().replace(/^(.)|\s(.)/g, function($1) { return $1.toUpperCase(); }); } function testip7plus() { var targetProduct = "Plus" var targetCapacity = "256GB" // "32GB", "128GB", "256GB" var targetColor = "Silver" // "Rose Gold" 玫瑰金色, "Gold" 金色, "Sliver" 銀色, "Black" 黑色, "Jet Black" 亮黑色 var FinalSelectedProduct = false; targetCapacity = targetCapacity.toUpperCase() targetColor = targetColor.toProperCase(); var stores_length = $('form#availabilityForm #selectStore option[disabled!=disabled]').length; for(a=0; a<stores_length; a++) { var enabledStore = $('form#availabilityForm #selectStore option[disabled!=disabled]').eq(a).val(); setTimeout(function() { $('form#availabilityForm select').val(enabledStore); $('form#availabilityForm select').change(); },1800) var enabledStoreText = $('form#availabilityForm #selectStore option[disabled!=disabled]').eq(a).text().replace(/^\s+|\s+$/g, ''); var products_length = $('form#availabilityForm #selectSubfamily option[disabled!=disabled]').length; for(p=0; p<products_length; p++) { var enabledProduct = $('div#productSelectionView #selectSubfamily option[disabled!=disabled]').eq(p).val(); var enabledProductText = $('div#productSelectionView #selectSubfamily option[disabled!=disabled]').eq(p).text(); if (~enabledProductText.toLowerCase().indexOf(targetProduct.toLowerCase())) { console.log("Log " + enabledStoreText + " has " + enabledProductText); $('form#availabilityForm select').val(enabledProduct); $('form#availabilityForm select').change(); var unavailableGB = $('div#capacity-row li.unavailable input[value="'+targetCapacity+'"]').length console.log("Log " + enabledStoreText + " checking for " + targetCapacity) if (unavailableGB == 0) { var sizeAva_length = $('div#capacity-row li').length; for(u=0;u<sizeAva_length;u++) { if ($('div#capacity-row li').eq(u).find('div').attr('id') == targetCapacity) { $('div#capacity-row li').eq(u).find("input").click(); break; } } var unavailableColor = $('div#product-row li.unavailable input[data-color="'+targetColor+'"]').length console.log("Log " + enabledStoreText + " checking for " + targetColor) if (unavailableColor == 0) { var colorAva_length = $('div#product-row li').length; for(v=0;v<colorAva_length;v++) { if ($('div#product-row li').eq(v).find('input').attr('data-color') == targetColor) { setTimeout(function() { $('div#product-row li').eq(v).find("input").click(); },800) FinalSelectedProduct = true; break; } } if (FinalSelectedProduct) { console.log("SUCCESS!!! " + enabledStoreText + " has " + $(' div.product div.callout.callout-center.product-specs ul.specs li:first').text().trim() + " " + enabledProductText + $('div.success.row div.success-copy.small-center').text().trim()); break; } } else { console.log("Log " + enabledStoreText + ", sorry no " + targetCapacity + " " + targetColor) } } } else { console.log(enabledStoreText + ", sorry no " + targetProduct) } } if (FinalSelectedProduct) { return; } } } testip7plus()

There is an archive for iPhone 6 Availability script in last year, please click the Chrome CSS Javascript label below

Saturday, September 17, 2016

How to check something that "is not yet implemented" in Swift 3 Linux

How to grep "XXXX is not yet implemented" in Swift 3 Linux
cd $(HOME) git clone --depth=1
cd $(HOME)/swift-corelibs-foundation/Foundation
grep -r "NSUnimplemented() }"

How to grep func or init in Swift 3 Linux
cd $(HOME)/swift-corelibs-foundation/Foundation
grep -r "open func \|public init"

Wednesday, August 24, 2016

How to install Objective C 2.0 and GNUstep under Windows SubSystem for Linux - Bash Shell

Install Objective C 2.0 and GNUstep under Windows 10 bash shell
Follow the steps below (make sure the steps are followed in order, that is build libobjc2 before GNUstep) to install required packages and build scripts

bash    Select all
sudo apt-get update sudo apt-get install build-essential libblocksruntime-dev libkqueue-dev libpthread-workqueue-dev gobjc libxml2-dev libjpeg-dev libtiff-dev libpng12-dev libcups2-dev libfreetype6-dev libcairo2-dev libxt-dev libgl1-mesa-dev sudo apt-get install clang-3.6 cmake git sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100 cd $HOME git clone --depth=1 cd libobjc2 rm -fr Build mkdir Build && cd Build cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIB_INSTALL_PATH=/usr/local/lib make sudo make install cd $HOME wget tar xvf gnustep-make*.tar.gz cd gnustep-make* CC=clang CXX=clang++ ./configure --prefix=/usr/local make sudo make install cd $HOME wget tar xvf gnustep-base*.tar.gz cd gnustep-base* CC=clang CXX=clang++ ./configure --prefix=/usr/local make sudo make install sudo ldconfig -v # no gnustep-gui installation here. sudo apt-get install libdispatch-dev # testing cd $HOME cat > blocktest.m << EOF #include <stdio.h> int main() { void (^hello)(void) = ^(void) { printf("Hello, block!\n"); }; hello(); return 0; } EOF clang `gnustep-config --objc-flags` -fblocks -o blocktest -x objective-c blocktest.m `gnustep-config --base-libs` ./blocktest cat > main.m << EOF // // main.m // Just a little test case for Objective-C 2.0 on Ubuntu // #import <Foundation/Foundation.h> #import <dispatch/dispatch.h> int main(int argc, const char * argv[]) { @autoreleasepool { int multiplier = 7; int (^myBlock)(int) = ^(int num) { return num * multiplier; }; NSLog(@"%d", myBlock(3)); dispatch_queue_t queue = dispatch_queue_create(NULL, NULL); dispatch_sync(queue, ^{ printf("Hello, world from a dispatch queue!\n"); }); dispatch_release(queue); } @autoreleasepool { NSLog(@"Wow it works!"); } return 0; } EOF # command line for locale generation sudo locale-gen en_US.UTF-8 # command line to reset timezone if not yet configured sudo dpkg-reconfigure tzdata clang `gnustep-config --objc-flags` -fblocks -o main -x objective-c main.m `gnustep-config --base-libs` -ldispatch ./main # to compile objective c++, you would need extra parameters and use clang++ clang++ -std=c++11 -stdlib=libc++ -x objective-c++ clang++ -std=c++11 -stdlib=libstdc++ -x objective-c++

GNUstep documentation is here ->

Wednesday, August 3, 2016

Bash Shell Built Into Windows 10 Anniversary Update 1607 Build 14393.10

After Windows 10 Anniversary Update, you have to enable "Developer mode" on the "Update & Security" page.
Then go to Control Panel -> Program and Features -> Turn Windows Features on or off -> Windows SubSystem for Linux (Beta), and click OK.

Bash Shell is only for 64-bit versions of Windows 10.

Bash Shortcut Keys
There are a number of very useful shortcut keys you can use in the bash shell:

Ctrl + U: Clears the line from the cursor point back to the beginning.
Ctrl + A: Moves the cursor to the beginning of the line.
Ctrl + E: Moves the cursor to the end of the line.
Ctrl + R: Allows you to search through the previous commands.

Batch Rename Files
rename –v 's/foo/bar/g' *

Customize command line prompt
function prompt
local WHITE="\[\033[1;37m\]"
local GREEN="\[\033[0;32m\]"
local CYAN="\[\033[0;36m\]"
local GRAY="\[\033[0;37m\]"
local BLUE="\[\033[0;34m\]"
export PS1="${GREEN}\u${CYAN}@${BLUE}\h ${CYAN}\w${GRAY}$ "

\u refers to the current username
\h refers to the host name
\w refers to the current file path.

or simply uncomment the line force_color_prompt=yes in ~/.bashrc

You can use Docker for Windows as engine and docker client for linux in bash. "Docker for Windows" requires Windows 10 Pro 64-bit and Hyper-V Package.

To install docker client for Linux under bash shell
cd ~/
tar -xzvf docker-1.12.0.tgz
cd docker
./docker -H tcp:// ps

Or simply add the corresponding variables to ~/.bashrc
export DOCKER_HOST=tcp://
export PATH=$PATH:~/docker

To detach the docker tty without exiting the shell, use the escape sequence Ctrl-p + Ctrl-q

Install docker-compose and try docker-compose example as per
shell script    Select all
# install dcoker-compose curl -L`uname -s`-`uname -m` > ~/docker/docker-compose chmod +x ~/docker/docker-compose docker-compose --version # try docker-compose example on wordpress and mysql images cd $HOME mkdir my-wordpress cd my-wordpress cat > docker-compose.yaml <<EOF version: '2' services: db: image: mysql:5.7 volumes: - "./.data/db:/var/lib/mysql" restart: always environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest links: - db ports: - "8000:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_PASSWORD: wordpress EOF # start the docker-compose example docker-compose up -d # then try browser http://localhost:8000/ # stop the docker-compose example docker-compose down

Swift 3 on Ubuntu (14.04 LTS trusty) for Windows 10 bash shell

You need to download and extract the development snapshot (Ubuntu 14.04) from and do these under bash shell.
shell script    Select all
# download and extract swift 3 snapshot cd ~/ wget tar xzvf swift-DEVELOPMENT-SNAPSHOT-2016-08-04-a-ubuntu14.04.tar.gz # the latest snapshot 2016-08-23 has libdispatch cd ~/ wget tar xzvf swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a-ubuntu14.04.tar.gz # Swift 3.0 GM Candidate cd ~/ wget tar xzvf swift-3.0-GM-CANDIDATE-ubuntu14.04.tar.gz # install and configure clang plus other tools sudo apt-get update sudo apt-get install -y libicu-dev uuid-dev clang-3.6 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100 sudo apt-get install -y git build-essential # clears the executable stack flag of shared library sudo apt-get install -y execstack sudo execstack -c ~/swift-DEVELOPMENT-SNAPSHOT-2016-08-04-a-ubuntu14.04/usr/lib/swift/linux/ sudo execstack -c ~/swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a-ubuntu14.04/usr/lib/swift/linux/ sudo execstack -c ~/swift-3.0-GM-CANDIDATE-ubuntu14.04/usr/lib/swift/linux/ # add path in ~/.bashrc export PATH=$PATH:~/swift-DEVELOPMENT-SNAPSHOT-2016-08-04-a-ubuntu14.04/usr/bin export PATH=$PATH:~/swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a-ubuntu14.04/usr/bin export PATH=$PATH:~/swift-3.0-GM-CANDIDATE-ubuntu14.04/usr/bin # test Foundation, libdispatch and swiftc compile cat > hello.swift <<EOF import Foundation let device = "WIN10" print("Hello from Swift on \(device)") //print("\(TimeZone.defaultTimeZone().name) \(NSDate())") // for old snapshot 2016-08-04 //print("\(NSTimeZone.defaultTimeZone().abbreviation()!) \(NSDate())") // for old snapshot 2016-08-23 print("\(NSTimeZone.default.abbreviation()!) \(NSDate())") // for Swift 3.0 GM Candidate // Test libdispatch import Dispatch var my_dispatch_group = DispatchGroup() let concurrentQueue = DispatchQueue(label: "myqueuename", attributes: DispatchQueue.Attributes.concurrent) for a in 1...20 { my_dispatch_group.enter() let block = DispatchWorkItem { print("do something at \(a)") } my_dispatch_group.leave() my_dispatch_group.notify(queue: concurrentQueue, work:block) } let item = DispatchWorkItem { print("PROGRAM ENDED \(NSTimeZone.default.abbreviation()!) \(NSDate())") } my_dispatch_group.notify(queue:, work:item) sleep(1) EOF swiftc hello.swift ./hello # test Swift Package Manager mkdir -p $HOME/test1 cd $HOME/test1 swift package init swift test

Install node.js and mongo shell for Ubuntu
shell script    Select all
# download and extract node.js cd ~/ wget tar xpvf node-v4.4.7-linux-x64.tar.xz # add path in ~/.bashrc export PATH=$PATH:~/node-v4.4.7-linux-x64/bin node --version npm --version # install mongo shell for version 3.2.8 # please refer to instructions here sudo apt-key adv --keyserver hkp:// --recv EA312927 echo "deb trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list sudo apt-get update sudo apt-get install -y mongodb-org-shell=3.2.8 # if you follow the previous post on example # you need to install mongodb server on the Windows platform # in order to test that example.

File System Access

Ubuntu filesystem from Windows Explorer

Windows filesystem from Ubuntu bash

Wednesday, June 22, 2016

How to build Node.js REST APIs in Raspberry Pi 3

This project is based on the "Build a REST API with node.js" video tutorial from Udemy

The project file can be downloaded here :!z9oFlTgJ!geCPHjoXJ3rpm1OdldU8s5RBSJxLKiAxh_axvTbODB4

The node.js ARMv7 version is v4.4.3 and npm 2.15.1
which (ARMv7) can be downloaded from
The project also use packages like bcryptjs, body-parser, express, jsonwebtoken and mongoose and integrate with mongodb. - No-SQL db.

To install mongodb in Raspberrry Pi, use sudo apt-get install mongodb

The following enhancements were made to the original project code

1. add shell scripts and use curl for API testing ( ..., as POSTMAN is only available in google chrome
2. add js code to avoid creating of duplicated user (test using
3. add test to user login and obtain Authorization sessionToken (test using
4. add js code to check Authorization before CRUD (create, read, update and delete definition record)
5. add js code to check existence of definition id before update and delete record (test using
6. shell script to get sessionToken in each test for instruction to further test on update and delete definition (test using
7. add js code to create log when create, update and delete definition record (test using / and then

To use mongo to admin user
> use workouts
> db.addUser({ user: "test", pwd: "test", roles:["readWrite", "dbAdmin"]});

or use createUser as below
> db.createUser({ user: "test", pwd: "test", roles:["readWrite", "dbAdmin"]});

To use mongo to display mongodb info
> use workouts
> show collections
> db.users.find()
> db.definitions.find().pretty()
> db.logs.find().pretty()

To use mongo to remove object
> db.definitions.remove({_id:ObjectId("573c29c0f11288dc9997d0")})

Instructions to use
1. First install node.js and mongodb and check that if mongod is running successfully in background. (If you use windows / OSX version of mongodb, please make sure the required data path is created before running mongod.exe / mongod)
2. use mongo to create admin user as above
3. Download the project file and unzip and install packages and start
bash    Select all
unzip cd nodeapi npm install npm start & # test ./ ./ ./ ... ./ # kill background job kill $!

Tuesday, June 21, 2016

How to run Docker for macOS

1) Download from here ->

2) Drag to Application Folder and double click to start and then check version in Terminal
docker --version
docker info

3) Search and Pull Docker image
docker search kitura
docker pull ibmcom/kitura-ubuntu:latest

4) Run image with port forwarding <local port : container port>
docker run -p 8095:8095 -t -i ibmcom/kitura-ubuntu:latest /bin/bash

5) Run / Download (if none) additional images and run as daemon
docker run -d -p 8080:8080 --name nodejs node
docker run -d -p 80:80 --name webserver nginx

6) List all downloaded or committed images
docker images

Download old images from
and using import
cat ~/Downloads/ubuntu-10.04-x86.tar.gz | docker import - ubuntu-x86:10.04
docker import ubuntu-10.04-x86.tar.gz ubuntu-x86:10.04

docker run -t -i ubuntu-x86:10.04 bash

7) Run image with port forwarding <local port : container port> and bash shell
docker run -p 8095:8095 -t -i ibmcom/kitura-ubuntu:latest bash
docker run -p 80:80 -t -i nginx:latest bash
docker run -p 3000:3000 -t -i node:latest bash
docker run -t -i lballabio/quantlib-python:latest bash

8) List all containers with <CONTAINER ID>
docker ps -a
#export container
docker export <CONTAINER ID> > ubuntu.tar

Execute container with bash shell
docker exec -t -i <CONTAINER ID> bash

9) Commit changes to image with <newname:newtag>
docker commit <CONTAINER ID> kitura-ubuntu:v2
docker run -p 8095:8095 -it kitura-ubuntu:v2 /bin/bash

This is useful when you cannot start a container manually after docker upgraded. e.g.
docker start <CONTAINER ID> && docker attach <CONTAINER ID>

10) copy docker file to local docker start <CONTAINER ID>
docker cp <CONTAINER ID>:/root/myfile.tgz .

Docker for Mac OSX data is at

To test the kitura docker image for Swift web app
shell script    Select all
mkdir $HOME/play cd $HOME/play #swift build --init swift package init cat > $HOME/play/Package.swift <<EOF import PackageDescription let package = Package( name: "play", dependencies: [ .Package(url: "", majorVersion:0, minor:15), .Package(url: "", majorVersion: 1, minor: 1) ] ) EOF mkdir -p $HOME/play/Sources cat > $HOME/play/Sources/main.swift <<EOF import Foundation import Kitura import KituraSys import KituraNet import MongoKitten // All Web apps need a Router instance to define routes let router = Router() // Simple Mongodb instance let dbserver: MongoKitten.Server! do { dbserver = try Server("mongodb://test:test@localhost:27017", automatically: true) let database = dbserver["workouts"] print("MongoDB is available at port 27017") } catch { // Unable to connect print("MongoDB is not available on the given host and port") } // Simple JSON Wrapper Support func JSON<KeyType, ValueType>(_ dictionary: [KeyType: ValueType]) -> String? { let bridgeValue = dictionary.bridge() do { let jsonData = try, options: NSJSONWritingOptions.PrettyPrinted) let str = String(data:jsonData, encoding: NSUTF8StringEncoding) return(str) } catch let error as NSError{ print(error.description) return(nil) } } // Basic GET request router.get("/hello") { _, response, next in response.headers["Content-Type"] = "text/plain; charset=utf-8" do { try response.status(.OK).send("Hello World").end() } catch { print("ERROR: Failed to send response to client: \(error)") } } router.get("/today") { _, response, next in let now = NSDate() let dayTimePeriodFormatter = NSDateFormatter() dayTimePeriodFormatter.dateFormat = "E, d MMM yyyy" let dateString = dayTimePeriodFormatter.string(from:now) dayTimePeriodFormatter.dateFormat = "HH:mm:ss Z" let timeString = dayTimePeriodFormatter.string(from:now) response.headers["Content-Type"] = "text/plain; charset=utf-8" do { let payload = ["Message": "Hello World", "Date": dateString, "Time": timeString] if let json = JSON(payload) { try response.status(.OK).send(json).end() } else { try response.status(.OK).send("Does anybody really know what time it is ?").end() } } catch { print("ERROR: Failed to send response to client: \(error)") } } // Start server let port = 8095 let server = HTTPServer.listen(port:port, delegate: router) print("starting server on port \(port)") EOF cd $HOME/play/Packages/SwiftyJSON-7.0.4/ git pull #there are 3 errors in Packages/Strand-1.4.1/Sources/Strand.swift and need to be changed before build #Strand.swift let pointer = UnsafeMutablePointer<Void>(holder.toOpaque()) #change to let pointer = UnsafeMutablePointer<Void>(OpaquePointer(bitPattern: holder)) let unmanaged = Unmanaged<StrandClosure>.fromOpaque(arg)] #change to let unmanaged = Unmanaged<StrandClosure>.fromOpaque(OpaquePointer(arg)) private func runner(arg: UnsafeMutablePointer<Void>?) -> UnsafeMutablePointer<Void>? { #change to private func runner(arg: UnsafeMutablePointer<Void>!) -> UnsafeMutablePointer<Void>! { and 1 error in Packages/MongoKitten-1.1.0/Sources/Server.swift let port: UInt16 = UInt16(url.port?.int16Value ?? 27017) # change to let port: UInt16 = UInt16(url.port?.shortValue ?? 27017) #build app cd $HOME/play swift build -Xcc -fblocks -Xlinker -rpath -Xlinker .build/debug #install and start mongodb server apt-get update apt-get install mongodb -y apt-get install lsb-release -y service mongodb start #create user in mongodb using mongo client mongo > use workouts > db.createUser( {user: "test", pwd: "test", roles: [ "readWrite", "dbAdmin" ]} ); > show users > exit #run app and use mac browser to localhost:8095/hello .build/debug/play

To test the node docker image for node.js web app
shell script    Select all
#install mongodb apt-get update apt-get install mongodb mongodb-server mongodb-clients -y #start mongdb service if not automatically service mongodb start #mongo shell script create user and to display info mongo > use workouts > db.addUser( {user: "test", pwd: "test", roles: [ "readWrite", "dbAdmin" ]} ); > show users > exit #download project file and copy to the container #the project file can be downloaded from here!z9oFlTgJ!geCPHjoXJ3rpm1OdldU8s5RBSJxLKiAxh_axvTbODB4 docker cp ~/Download/ 6d8baf06826e:/root #unzip and install apt-get install zip unzip -y cd $HOME unzip cd nodeapi npm install npm start #use docker to start another shell access to test docker exec -it 6d8baf06826e bash cd $HOME/nodeapi ./ ./ ./ ./ ./ ./ ...

To test the quantlib-python docker image
shell script    Select all
apt-get update apt-get install python-pip -y pip install --upgrade pip pip install numpy cd $HOME cat > $HOME/qlversion.cpp <<EOF #include <iostream> #include <ql/version.hpp> int main() { std::cout << "Current QL Version:" << QL_LIB_VERSION << std::endl; return 0; } EOF g++ qlversion.cpp -o qlversion ./qlversion cat > $HOME/ <<EOF import numpy as np import QuantLib as ql # Set Evaluation Date today = ql.Date(31,3,2015) ql.Settings.instance().setEvaluationDate(today) # Setup the yield termstructure rate = ql.SimpleQuote(0.03) rate_handle = ql.QuoteHandle(rate) dc = ql.Actual365Fixed() disc_curve = ql.FlatForward(today, rate_handle, dc) disc_curve.enableExtrapolation() hyts = ql.YieldTermStructureHandle(disc_curve) discount = np.vectorize( start = ql.TARGET().advance(today, ql.Period('2D')) end = ql.TARGET().advance(start, ql.Period('10Y')) nominal = 1e7 typ = ql.VanillaSwap.Payer fixRate = 0.03 fixedLegTenor = ql.Period('1y') fixedLegBDC = ql.ModifiedFollowing fixedLegDC = ql.Thirty360(ql.Thirty360.BondBasis) index = ql.Euribor6M(ql.YieldTermStructureHandle(disc_curve)) spread = 0.0 fixedSchedule = ql.Schedule(start, end, fixedLegTenor, index.fixingCalendar(), fixedLegBDC, fixedLegBDC, ql.DateGeneration.Backward, False) floatSchedule = ql.Schedule(start, end, index.tenor(), index.fixingCalendar(), index.businessDayConvention(), index.businessDayConvention(), ql.DateGeneration.Backward, False) swap = ql.VanillaSwap(typ, nominal, fixedSchedule, fixRate, fixedLegDC, floatSchedule, index, spread, index.dayCounter()) engine = ql.DiscountingSwapEngine(ql.YieldTermStructureHandle(disc_curve)) swap.setPricingEngine(engine) print(swap.NPV()) print(swap.fairRate()) EOF python apt-get install git -y git clone git:// cd QuantLib-with-Python-Blog-Examples/ python

Try docker-compose example as per
shell script    Select all
cd $HOME mkdir my-wordpress cd my-wordpress cat > docker-compose.yaml <<EOF version: '2' services: db: image: mysql:5.7 volumes: - "./.data/db:/var/lib/mysql" restart: always environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest links: - db ports: - "8000:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_PASSWORD: wordpress EOF docker-compose up -d # then try browser http://localhost:8000/ # stop the docker-compose example docker-compose down

Sunday, May 1, 2016

Android NDK old versions

See here

To extract .bin file under Linux or Mac OSX, chmod +x to make it executable and run for extraction.