Install Latest Corona SDK on Linux Peppermint OS 5

I want to learn create game for my daughter since she like to play game in her Acer Tablet. I don’t know much about programming for mobile phone nor tablet but I’ll learn.

After dig for internet I decide to use Corona SDK but the problem came since I use Peppermint OS 5 that not supported.

I try Wine way and document the process here for my own reference. Might be useful for others.

Wine version

$ wine --version
wine-1.6.2

Checking cmd command from wine

$ wine cmd
Wine CMD Version 5.1.2600 (1.6.2)

Z:\home\alamsyah>c:

C:\>dir
Volume in drive C has no label.
Volume Serial Number is 0000-0000

Directory of C:\

10/02/2015 12:03 <DIR> Program Files
14/01/2015 15:17 <DIR> Program Files (x86)
23/02/2015 15:17 <DIR> server
12/12/2014 20:40 <DIR> users
12/12/2014 20:40 <DIR> windows
0 files 0 bytes
5 directories 411,322,195,968 bytes free
C:\>

Great. Wine working fine.

Corona SDK

Download latest version for Windows

I got corona sdk 2014.2511

corona_sdk_2014.2511

Install it

$ wine start CoronaSDK-2014.2511.msi

I got error message :

fixme:exec:SHELL_execute flags ignored: 0x00000100
fixme:storage:create_storagefile Storage share mode not implemented.
fixme:msi:ITERATE_CreateShortcuts poorly handled shortcut format, advertised shortcut

but I ignore it.

Follow the screen to get corona sdk installed.

Run Corona SDK

Menu -> Programs -> Corona SDK -> Corona Simulator

corona_sdk_simulator

Try to compile (build for Android)

Got error message

corona_sdk_x86

Well, time for JDK.

Java Development Kit

According this docs I need JDK 7

corona_sdk_jdk7_64bit

Install this version also not work.

corona_jdk6_32bit

I skip this JDK problem as I still able to code and see it from simulator.

Well, time for continue learning 🙂

Update :

I use ZeroBrane Studio

$ wget -c https://download.zerobrane.com/ZeroBraneStudioEduPack-1.00-linux.sh 

$ chmod +x ZeroBraneStudioEduPack-1.00-linux.sh

$ ./ZeroBraneStudioEduPack-1.00-linux.sh
Verifying archive integrity… All good.
Uncompressing ZeroBraneStudio with EduPack 1.00………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..
Installing ZeroBrane Studio 1.00…
[sudo] password for alamsyah:
Done.

To uninstall ZeroBrane Studio at a later time, run:
zbstudio-uninstall

Fix bad entry of sources list for Peppermint OS 5

Just quick post for myself. Today I need to give sample to my student about apt-get command and while I try it I got this error :

Err http://ppa.launchpad.net trusty/main amd64 Packages
404 Not Found

Err http://ppa.launchpad.net trusty/main i386 Packages
404 Not Found

W: Failed to fetch http://ppa.launchpad.net/openshot.developers/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/openshot.developers/ppa/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

Yes. That error mean the address is not found. Might be the address changed or something else.

As I use Peppemint OS 5. I found that source.list is no longer packed in single file but located in directory.

$ ls -l /etc/apt/sources.list.d/
total 44
-rw-r–r– 1 root root 146 Mar 2 13:27 jerzy-kozera-zeal-ppa-trusty.list
-rw-r–r– 1 root root 172 Mar 2 13:27 maarten-baert-simplescreenrecorder-trusty.list
-rw-r–r– 1 root root 172 Mar 2 13:27 maarten-baert-simplescreenrecorder-trusty.list.save
-rw-r–r– 1 root root 142 Mar 2 13:27 mc3man-trusty-media-trusty.list
-rw-r–r– 1 root root 142 Mar 2 13:27 mc3man-trusty-media-trusty.list.save
-rw-r–r– 1 root root 150 Mar 2 13:27 openshot_developers-ppa-trusty.list
-rw-r–r– 1 root root 150 Mar 2 13:27 openshot_developers-ppa-trusty.list.save
-rw-r–r– 1 root root 144 Mar 2 13:27 peppermint.list
-rw-r–r– 1 root root 144 Mar 2 13:27 peppermint.list.save
-rw-r–r– 1 root root 132 Mar 2 13:27 phalcon-stable-trusty.list
-rw-r–r– 1 root root 132 Mar 2 13:27 phalcon-stable-trusty.list.save

$ cat /etc/apt/sources.list.d/openshot_developers-ppa-trusty.list
deb http://ppa.launchpad.net/openshot.developers/ppa/ubuntu trusty main
# deb-src http://ppa.launchpad.net/openshot.developers/ppa/ubuntu trusty main

Remove the file

$ sudo rm /etc/apt/sources.list.d/openshot_developers-ppa-trusty.*
[sudo] password for alamsyah:

Recheck it
$ ls -l /etc/apt/sources.list.d/
total 36
-rw-r–r– 1 root root 146 Mar 2 13:27 jerzy-kozera-zeal-ppa-trusty.list
-rw-r–r– 1 root root 172 Mar 2 13:27 maarten-baert-simplescreenrecorder-trusty.list
-rw-r–r– 1 root root 172 Mar 2 13:27 maarten-baert-simplescreenrecorder-trusty.list.save
-rw-r–r– 1 root root 142 Mar 2 13:27 mc3man-trusty-media-trusty.list
-rw-r–r– 1 root root 142 Mar 2 13:27 mc3man-trusty-media-trusty.list.save
-rw-r–r– 1 root root 144 Mar 2 13:27 peppermint.list
-rw-r–r– 1 root root 144 Mar 2 13:27 peppermint.list.save
-rw-r–r– 1 root root 132 Mar 2 13:27 phalcon-stable-trusty.list
-rw-r–r– 1 root root 132 Mar 2 13:27 phalcon-stable-trusty.list.save

Re run apt-get

$ sudo apt-get update

this time no error message.

How about openshot ?

Well, I try re add the source :

$ sudo add-apt-repository ppa:openshot.developers/ppa
This PPA contains the current stable version of OpenShot Video Editor.

If you would rather the bleeding-edge version, check out the following URL:
https://launchpad.net/~jonoomph/+archive/openshot-edge
More info: https://launchpad.net/~openshot.developers/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp8sj5wgdh/secring.gpg’ created
gpg: keyring `/tmp/tmp8sj5wgdh/pubring.gpg’ created
gpg: requesting key B9BA26FA from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp8sj5wgdh/trustdb.gpg: trustdb created
gpg: key B9BA26FA: public key “Launchpad OpenShot Development PPA” imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK

$ sudo apt-get update

……………….

…………………….

Fetched 785 kB in 41s (19,0 kB/s)
W: Failed to fetch http://ppa.launchpad.net/openshot.developers/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/openshot.developers/ppa/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

Well, I think its openshot repository problem. I skip install this 🙂

How to install Xampp Linux on Peppermint OS 5

I have a few php system at the moment. My 1st system is php and folks (mysql etc) installed via apt-get . 2nd system is PHP system using phpfarm technique . This time I want to add other system that backed by Xampp 🙂 . Lets start add this big boy.

Download Latest xampp for linux (at this time I use xampp 5.6.3.0 for 64 bit).

xampp1

$ wget -c http://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/5.6.3/xampp-linux-x64-5.6.3-0-installer.run?r=&ts=1423030874&use_mirror=jaist

$ mv xampp-linux-x64-5.6.3-0-installer.run\?r\= xampp-linux-x64-5.6.3-0-installer.run

$ chmod +x xampp-linux-x64-5.6.3-0-installer.run

$ sudo ./xampp-linux-x64-5.6.3-0-installer.run

Execute as super user or sudo

# ./xampp-linux-x64-5.6.3-0-installer.run

xampp2

Make sure core files selected.

xampp3

After installation finish you might want to test run it.

Stop all running instance of Apache and Mysql

# service apache2 stop
* Stopping web server apache2 *
# service mysql stop
mysql stop/waiting

# /opt/lampp/xampp start
Starting XAMPP for Linux 5.6.3-0…
XAMPP: Starting Apache…ok.
XAMPP: Starting MySQL…ok.
XAMPP: Starting ProFTPD…ok.
# /opt/lampp/xampp stop
Stopping XAMPP for Linux 5.6.3-0…
XAMPP: Stopping Apache…ok.
XAMPP: Stopping MySQL…ok.
XAMPP: Stopping ProFTPD…ok.

Or using sudo

$ sudo /opt/lampp/xampp start
Starting XAMPP for Linux 5.6.3-0…
XAMPP: Starting Apache…ok.
XAMPP: Starting MySQL…ok.
XAMPP: Starting ProFTPD…ok.

Test

xampp4

Document root setting

$ sudo nano /opt/lampp/etc/httpd.conf

Find these lines :

DocumentRoot “/opt/lampp/htdocs”
<Directory “/opt/lampp/htdocs”>

Change to your preferences.

Save when you’re done.

Access MySQL command line

$ sudo /opt/lampp/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.21 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

Change MySQL password

Continue from previous prompt

mysql> use mysql;
Database changed
mysql> update user set password=password(‘123456′) where user=’root’;
Query OK, 2 rows affected (0,00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0,00 sec)

mysql> exit

Install IonCube Loader

IonCube provide loader for 32 and 64 bit architecture.

Download latest version from here.

$ wget -c http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.bz2

$ tar xvjf ioncube_loaders_lin_x86-64.tar.bz2
ioncube/
ioncube/ioncube_loader_lin_5.0.so
ioncube/ioncube_loader_lin_4.3.so
ioncube/ioncube_loader_lin_4.2.so
ioncube/ioncube_loader_lin_5.6.so
ioncube/ioncube_loader_lin_5.3.so
ioncube/ioncube_loader_lin_5.5_ts.so
ioncube/ioncube_loader_lin_5.4.so
ioncube/ioncube_loader_lin_4.3_ts.so
ioncube/ioncube_loader_lin_5.5.so
ioncube/ioncube_loader_lin_5.4_ts.so
ioncube/ioncube_loader_lin_5.3_ts.so
ioncube/ioncube_loader_lin_4.4.so
ioncube/ioncube_loader_lin_4.4_ts.so
ioncube/ioncube_loader_lin_5.2.so
ioncube/ioncube_loader_lin_4.1.so
ioncube/ioncube_loader_lin_5.1_ts.so
ioncube/ioncube_loader_lin_5.0_ts.so
ioncube/ioncube_loader_lin_5.1.so
ioncube/ioncube_loader_lin_5.6_ts.so
ioncube/ioncube_loader_lin_5.2_ts.so

Which version?

Based on phpinfo() . Its PHP 5.6.3 then I must copy ioncube/ioncube_loader_lin_5.6_ts.so to

directory that provide by phpinfo() information

xampp5

$ sudo mv ioncube/ioncube_loader_lin_5.6.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/

Tell php.ini for new shared object file.

$ sudo nano /opt/lampp/etc/php.ini

Add this line :

zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/ioncube_loader_lin_5.6.so

save.

Restart xampp

$ sudo /opt/lampp/xampp restart

Recheck phpinfo() page to find this information.

xampp6

Install PhalconPHP Extension on Linux Xampp

$ wget -c "https://github.com/phalcon/cphalcon/archive/master.zip"

$ unzip master.zip

$ cd cphalcon-master/build/64bits/

$ /opt/lampp/bin/phpize --enable-phalcon --with-php-config=/opt/lampp/bin

Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226

$ ./configure --with-php-config=/opt/lampp/bin/php-config

$ make

$ sudo make install

[sudo] password for alamsyah:
Installing shared extensions: /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/

$ sudo echo "extension=phalcon.so" >> etc/php.ini

Restart Xampp

$ sudo /opt/lampp/xampp restart

Check phpinfo() page to see

xampp7

Reference : Belajar Phalcon Framework

pkg: PACKAGESITE in pkg.conf is no longer supported.

As FreeBSD 10.1 spoil me with pkg then I stumble upon FreeBSD 9.2 box that installed due to its default ports. Yes another requirement of PHP 5.2.17 in the house yo.

The problem I encounter is :

# pkg info
pkg: PACKAGESITE in pkg.conf is no longer supported. Convert to the new repository style. See pkg.conf(5)
pkg: Cannot parse configuration file!

I guess that error lead to error problem when compile PHP 5.2.17 from ports.

……..

……….

Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

***************************************************************
====> Compressing man pages (compress-man)
===> Building package for php52-5.2.17_14
Creating package /usr/ports/lang/php52/work/pkg/php52-5.2.17_14.tbz
Registering depends: apache22-2.2.27_2 apr-1.5.1.1.5.3 gdbm-1.11 gettext-0.18.3.1 libxml2-2.8.0_5 libiconv-1.14_3 db48-4.8.30.0 pcre-8.34 perl5-5.16.3_9 expat-2.1.0.
Registering conflicts: php53-5* php5-5*.
Creating bzip’d tar ball in ‘/usr/ports/lang/php52/work/pkg/php52-5.2.17_14.tbz’
tar: bin/php: Cannot stat: No such file or directory
tar: bin/php-config: Cannot stat: No such file or directory
tar: bin/phpize: Cannot stat: No such file or directory
tar: etc/php.conf: Cannot stat: No such file or directory
tar: etc/php.ini-dist: Cannot stat: No such file or directory
tar: etc/php.ini-recommended: Cannot stat: No such file or directory
tar: include/php/TSRM/TSRM.h: Cannot stat: No such file or directory
tar: include/php/TSRM/acconfig.h: Cannot stat: No such file or directory
tar: include/php/TSRM/readdir.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_config.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_config.w32.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_config_common.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_nw.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_strtok_r.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_virtual_cwd.h: Cannot stat: No such file or directory

Yes.

# ls /usr/local/etc/ | grep pkg
pkg.conf
pkg.conf.sample

Replace pkg.conf

# mv /usr/local/etc/pkg.conf.sample /usr/local/etc/pkg.conf

# pkg info
pkg-1.4.6 Package manager

NO error this time.

# echo ‘NO_WARNING_PKG_INSTALL_EOL=yes’ >> /etc/make.conf

pkg update
Updating FreeBSD repository catalogue…
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
Fetching meta.txz: 100% 968 B 1.0k/s 00:01
Fetching packagesite.txz: 100% 5 MB 230.6k/s 00:23
Processing entries: 100%
FreeBSD repository update completed. 23846 packages processed

Re try compile but not work but at least “pkg: PACKAGESITE in pkg.conf is no longer supported.’ no longer appear.

Install Drupal 8 with phpng (php next generation) on FreeBSD 10.1

After get success with php next generation (phpng) installation I decide to test it with real php script. Drupal came to my attention and I came with a plan of recipe 🙂

  • Drupal 8 (at the moment its 8.0.0-beta4)
  • PHP 7.0.0-dev
  • Lighttpd
  • MariaDB 10

I still use Vultr as Vps provider since my adsl connection is sucks at the moment.

Lets get start

Install MariaDB 10

I use pkg approach than using source way that I did before.

Delete previous installed mysql client

# pkg info | grep mysql
mysql56-client-5.6.22 Multithreaded SQL database (client)
# pkg delete mysql56-client
Checking integrity… done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
mysql56-client-5.6.22

The operation will free 45 MB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling mysql56-client-5.6.22…
[1/1] Deleting files for mysql56-client-5.6.22: 100%

Install MariaDB 10 server and Client

# pkg install -y mariadb100-server mariadb100-client

Enable MariaDB from rc.conf

# echo 'mysql_enable=YES' >> /etc/rc.conf

Start MariaDB Service

# /usr/local/etc/rc.d/mysql-server start

Change MariaDB root password

# /usr/local/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
… Success!

Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
… Success!

By default, MariaDB comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up…

All done! If you’ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Add new user for upcoming drupal installation

# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.0.15-MariaDB FreeBSD Ports

Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> create database drupal;
Query OK, 1 row affected (0.00 sec)

MariaDB [mysql]> grant all privileges on drupal.* to [email protected] identified by ‘123456’ with grant option;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.01 sec)

MariaDB [mysql]> exit
Bye
#

Compile phpng

I compile phpng using last post.

# mkdir $HOME/tmp/usr/etc

# /root/tmp/usr/etc/php.ini

add these lines

max_execution_time=600
memory_limit=128M
error_reporting=0
display_errors=0
log_errors=0
user_ini.filename=
realpath_cache_size=2M
cgi.check_shebang_line=0

zend_extension=opcache.so.0.0
opcache.enable_cli=1
opcache.save_comments=0
opcache.fast_shutdown=1
opcache.validate_timestamps=1
opcache.revalidate_freq=60
opcache.use_cwd=1
opcache.max_accelerated_files=100000
opcache.max_wasted_percentage=5
opcache.memory_consumption=128
opcache.consistency_checks=0

Install Lighttpd

# pkg install -y lighttpd
Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 packages will be affected (of 0 checked):

New packages to be INSTALLED:
lighttpd: 1.4.35_5
pcre: 8.35_2

The process will require 6 MB more space.
1 MB to be downloaded.
Fetching lighttpd-1.4.35_5.txz: 100% 215 KB 219.8k/s 00:01
Fetching pcre-8.35_2.txz: 100% 1 MB 1.1M/s 00:01
Checking integrity… done (0 conflicting)
[1/2] Installing pcre-8.35_2…
[1/2] Extracting pcre-8.35_2: 100%
[2/2] Installing lighttpd-1.4.35_5…
[2/2] Extracting lighttpd-1.4.35_5: 100%

Set Lighttpd run on boot

# echo 'lighttpd_enable=YES' >> /etc/rc.conf

Create document root

# mkdir -p /usr/local/www/data

# touch /usr/local/www/data/index.html

# echo 'tes' > /usr/local/www/data/index.html

Lighttpd Configuration

modules.conf

# ee /usr/local/etc/lighttpd/modules.conf

remove # sign in front of this line:

##
## FastCGI (mod_fastcgi)
##
include “conf.d/fastcgi.conf”

save the file.

# ee /usr/local/etc/lighttpd/conf.d/fastcgi.conf

Add these lines under “server.modules += ( “mod_fastcgi” ) ” : source.

fastcgi.server = ( “.php” => ((
“bin-path” => “/root/tmp/usr/bin/php-cgi”,
“socket” => “/tmp/php.socket”,
“max-procs” => 2,
“bin-environment” => (
“PHP_FCGI_CHILDREN” => “16”,
“PHP_FCGI_MAX_REQUESTS” => “10000”
),
“bin-copy-environment” => (
“PATH”, “SHELL”, “USER”
),
“broken-scriptfilename” => “enable”
)))

Enable fastcgi

Make sure output of

# /root/tmp/usr/bin/php-cgi -v

PHP 7.0.0-dev (cgi-fcgi) (built: Jan 23 2015 04:55:05)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.8.0-dev, Copyright (c) 1998-2014 Zend Technologies

cgi-fcgi means fast cgi enabled.

Testing phpinfo()

# echo "<?php phpinfo();?>" > /usr/local/www/data/info.php

See it from browser.

freebsd_vps_europe_7

 

Fix Lighttpd error message

(network.c.283) warning: please use server.use-ipv6 only for hostnames, not without server.bind / empty address; your config will break if the kernel default for IPV6_V6ONLY changes

That message show up when lighttpd restart.

 

Install Drupal 8

I’ll continue it next time 🙂