How to Enable Designer Tab on PhpMyAdmin

I’m in the middle of project deadline and need to create simple erd. I ever see designer tab in phpmyadmin long time ago but when I need it today I see nothing.

myadmin1

To enable the designer tab  :

  1. Edit config.inc.php

In case only config.inc.sample.php available then you need to rename the file into config.inc.php

Locate these lines :

 

*
* phpMyAdmin configuration storage settings.
*/

/* User used to manipulate with storage */
// $cfg[‘Servers’][$i][‘controlhost’] = ”;
// $cfg[‘Servers’][$i][‘controlport’] = ”;
$cfg[‘Servers’][$i][‘controluser’] = ‘pma’;
$cfg[‘Servers’][$i][‘controlpass’] = ‘pmapass’;

/* Storage database and tables */
$cfg[‘Servers’][$i][‘pmadb’] = ‘phpmyadmin’;
$cfg[‘Servers’][$i][‘bookmarktable’] = ‘pma__bookmark’;
$cfg[‘Servers’][$i][‘relation’] = ‘pma__relation’;
$cfg[‘Servers’][$i][‘table_info’] = ‘pma__table_info’;
$cfg[‘Servers’][$i][‘table_coords’] = ‘pma__table_coords’;
$cfg[‘Servers’][$i][‘pdf_pages’] = ‘pma__pdf_pages’;
$cfg[‘Servers’][$i][‘column_info’] = ‘pma__column_info’;
$cfg[‘Servers’][$i][‘history’] = ‘pma__history’;
$cfg[‘Servers’][$i][‘table_uiprefs’] = ‘pma__table_uiprefs’;
$cfg[‘Servers’][$i][‘tracking’] = ‘pma__tracking’;
$cfg[‘Servers’][$i][‘designer_coords’] = ‘pma__designer_coords’;
$cfg[‘Servers’][$i][‘userconfig’] = ‘pma__userconfig’;
$cfg[‘Servers’][$i][‘recent’] = ‘pma__recent’;
$cfg[‘Servers’][$i][‘users’] = ‘pma__users’;
$cfg[‘Servers’][$i][‘usergroups’] = ‘pma__usergroups’;

Make sure to remove // in front of the lines.

2. Grant user pma ; you can use phpmyadmin ‘SQL’ .

GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO ‘pma’@’localhost’ identified by ‘pmapass’ with GRANT OPTION;

3. Import SQL from examples directory of your phpmyadmin. read more »

How to Install Official PHP 7 release on FreeBSD 10.2

Finally  PHP 7 officialy released. I’m eager to see it again after already test it before (7.0.0 dev built on January 23 2015)

# freebsd-update fetch

Looking up update.FreeBSD.org mirrors… none found.
Fetching public key from update.FreeBSD.org… done.
Fetching metadata signature for 10.2-RELEASE from update.FreeBSD.org… failed.
No mirrors remaining, giving up.

# dig

dig: Command not found.

Fix it by install bind-tools

# pkg install bind-tools

Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 4 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    bind-tools: 9.10.3_1
    libxml2: 2.9.3
    libedit: 3.1.20150325_1
    idnkit: 1.0_5

The process will require 32 MiB more space.
3 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching bind-tools-9.10.3_1.txz: 100%    2 MiB 310.1kB/s    00:08   
Fetching libxml2-2.9.3.txz: 100%  789 KiB 269.4kB/s    00:03   
Fetching libedit-3.1.20150325_1.txz: 100%  121 KiB 123.6kB/s    00:01   
Fetching idnkit-1.0_5.txz: 100%  194 KiB 198.5kB/s    00:01   
Checking integrity… done (0 conflicting)
[1/4] Installing libxml2-2.9.3…
[1/4] Extracting libxml2-2.9.3: 100%
[2/4] Installing libedit-3.1.20150325_1…
[2/4] Extracting libedit-3.1.20150325_1: 100%
[3/4] Installing idnkit-1.0_5…
[3/4] Extracting idnkit-1.0_5: 100%
[4/4] Installing bind-tools-9.10.3_1…
[4/4] Extracting bind-tools-9.10.3_1: 100%

Test it.

# dig update.freebsd.org

; <<>> DiG 9.10.3 <<>> update.freebsd.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27825
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 3, ADDITIONAL: 0

;; QUESTION SECTION:
;update.freebsd.org.        IN    A

;; ANSWER SECTION:
update.freebsd.org.    599    IN    CNAME    update2.freebsd.org.
update2.freebsd.org.    599    IN    A    149.20.53.26

;; AUTHORITY SECTION:
freebsd.org.        599    IN    NS    ns1.isc-sns.net.
freebsd.org.        599    IN    NS    ns2.isc-sns.com.
freebsd.org.        599    IN    NS    ns3.isc-sns.info.

;; Query time: 16 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Dec 05 16:55:49 WIB 2015
;; MSG SIZE  rcvd: 162

Now retry update FreeBSD.

[email protected]:/usr/home/alam # freebsd-update fetch

Looking up update.FreeBSD.org mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from update.FreeBSD.org… failed.
No mirrors remaining, giving up.

Ok, I give up too 🙂

Time to use VPS from Vultr.

It took less than 5 minutes to start

Login now

 ssh [email protected]
The authenticity of host ‘45.32.67.158 (45.32.67.158)’ can’t be established.
ECDSA key fingerprint is bb:93:1e:43:d5:2a:41:07:5c:0a:7b:8a:70:2a:60:f4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘45.32.67.158’ (ECDSA) to the list of known hosts.
Password for [email protected]:
Last login: Tue Oct 27 18:44:11 2015 from 10.0.2.2
FreeBSD 10.2-RELEASE (GENERIC) #0 r286666: Wed Aug 12 15:26:37 UTC 2015

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace “en” with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

Edit /etc/motd to change this login announcement.
#

Update FreeBSD

Fetch latest update

# freebsd-update fetch

Looking up update.FreeBSD.org mirrors… 5 mirrors found.
Fetching metadata signature for 10.2-RELEASE from update5.freebsd.org… done.
Fetching metadata index… done.
Fetching 2 metadata patches.. done.
Applying metadata patches… done.
Inspecting system… done.
Preparing to download files… done.
Fetching 5 patches… done.
Applying patches… done.

The following files will be updated as part of updating to 10.2-RELEASE-p7:
/bin/freebsd-version
/boot/kernel/kernel
/boot/kernel/kernel.symbols
/usr/include/sys/vnode.h
/usr/sbin/ntpd

Install the update

# freebsd-update install

Installing updates… done.

Update pkg

# pkg update

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/quarterly, please wait…
Verifying signature with trusted certificate pkg.freebsd.org.2013102301… done
Installing pkg-1.6.1…
Extracting pkg-1.6.1: 100%
Message from pkg-1.6.1:
If you are upgrading from the old package format, first run:
 

# pkg2ng

Updating FreeBSD repository catalogue…
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01   
Fetching packagesite.txz: 100%    5 MiB   5.5MB/s    00:01   
Processing entries: 100%
FreeBSD repository update completed. 24617 packages processed.

Search for PHP package

# pkg search php | grep Language

mod_php5-5.4.45,1              PHP Scripting Language
mod_php55-5.5.30               PHP Scripting Language
mod_php56-5.6.14               PHP Scripting Language
php5-5.4.45                    PHP Scripting Language
php55-5.5.30                   PHP Scripting Language
php56-5.6.14                   PHP Scripting Language

Only PHP 5.4, 5.5 and 5.6 available. Continue with ports.

Install ports with Portsnap

Download snapshot

# portsnap fetch

Looking up portsnap.FreeBSD.org mirrors… 7 mirrors found.
Fetching public key from isc.portsnap.freebsd.org… done.
Fetching snapshot tag from isc.portsnap.freebsd.org… done.
Fetching snapshot metadata… done.
Fetching snapshot generated at Sat Dec  5 00:03:05 UTC 2015:
e77ac916c3137b60907a8bc1a7d4e7fae5ca0bf35dcd8e100% of   70 MB   37 MBps 00m01s
Extracting snapshot… done.
Verifying snapshot integrity… done.
Fetching snapshot tag from isc.portsnap.freebsd.org… done.
Fetching snapshot metadata… done.
Updating from Sat Dec  5 00:03:05 UTC 2015 to Sat Dec  5 03:10:07 UTC 2015.
Fetching 4 metadata patches… done.
Applying metadata patches… done.
Fetching 0 metadata files… done.
Fetching 5 patches.
(5/5) 100.00%  done.                            
done.
Applying patches…
done.
Fetching 0 new ports or files… done.

Extract ports

# portsnap extract

Find PHP 7

# make search name=php70
# make search name=php7
#

I must wait for developer to get it from ports or pkg.

Install PHP 7 from source

# pkg install -y git autoconf bison libxml2 libxslt jpeg png libxpm freetype2 gmp libmcrypt mysql56-client aspell recode

# hash -r

# mkdir ~/tmp
# cd ~/tmp

# git clone https://git.php.net/repository/php-src.git
Cloning into ‘php-src’…
remote: Counting objects: 642977, done.
remote: Compressing objects: 100% (129159/129159), done.
remote: Total 642977 (delta 514316), reused 640981 (delta 512488)
Receiving objects: 100% (642977/642977), 160.98 MiB | 16.17 MiB/s, done.
Resolving deltas: 100% (514316/514316), done.
Checking connectivity… done.
Checking out files: 100% (17869/17869), done.

# cd php-src
# ./buildconf
buildconf: checking installation…
buildconf: autoconf version 2.69 (ok)
rebuilding aclocal.m4
rebuilding configure
rebuilding main/php_config.h.in

Build it

# ./configure \
    –prefix=$HOME/tmp/usr \
    –with-config-file-path=$HOME/tmp/usr/etc \
    –enable-mbstring \
    –enable-zip \
    –enable-bcmath \
    –enable-pcntl \
    –enable-ftp \
    –enable-exif \
    –enable-calendar \
    –enable-sysvmsg \
    –enable-sysvsem \
    –enable-sysvshm \
    –enable-wddx \
    –with-curl \
    –with-mcrypt \
    –with-iconv \
    –with-gmp \
    –with-pspell \
    –with-gd \
    –with-jpeg-dir=/usr \
    –with-png-dir=/usr \
    –with-zlib-dir=/usr \
    –with-xpm-dir=/usr \
    –with-freetype-dir=/usr \
    –enable-gd-native-ttf \
    –enable-gd-jis-conv \
    –with-openssl \
    –with-gettext=/usr \
    –with-zlib=/usr \
    –with-bz2=/usr \
    –with-recode=/usr \
    –with-mysqli=/usr/local/bin/mysql_config

………..

Generating files
configure: creating ./config.status
creating main/internal_functions.c
creating main/internal_functions_cli.c
+——————————————————————–+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+——————————————————————–+

Thank you for using PHP.

config.status: creating php7.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: main/php_config.h is unchanged
config.status: executing default commands

Make

# make

…………….

…………………….

Build complete.
Don’t forget to run ‘make test’.

# make install

Installing shared extensions:     /root/tmp/usr/lib/php/extensions/no-debug-non-zts-20151012/
Installing PHP CLI binary:        /root/tmp/usr/bin/
Installing PHP CLI man page:      /root/tmp/usr/php/man/man1/
Installing phpdbg binary:         /root/tmp/usr/bin/
Installing phpdbg man page:       /root/tmp/usr/php/man/man1/
Installing PHP CGI binary:        /root/tmp/usr/bin/
Installing PHP CGI man page:      /root/tmp/usr/php/man/man1/
Installing build environment:     /root/tmp/usr/lib/php/build/
Installing header files:          /root/tmp/usr/include/php/
Installing helper programs:       /root/tmp/usr/bin/
  program: phpize
  program: php-config
Installing man pages:             /root/tmp/usr/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /root/tmp/usr/lib/php/
SSL certificate subject doesn’t match host pear.php.net
fetch: https://pear.php.net/install-pear-nozlib.phar: Authentication error
*** Error code 1

Stop.
make: stopped in /root/tmp/php-src

Check it

# /root/tmp/usr/bin/php -v
PHP 7.1.0-dev (cli) (built: Dec  5 2015 03:59:38) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2015 Zend Technologies
#

Lol, looks like I get ‘edge’ version. Maybe I should use traditional tar.gz file 🙂

I keep that for other update as my student already wait for my class.

Fix Starting httpd: (98)Address already in use

Quick note for myself. Today I have to increase php upload maximum size in Centos server.

I got this error :

# /sbin/service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

 

Everything is fine and nothing change for configuration, the only strange is so many child process of apache.

# fuser 80/tcp
80/tcp:                398  1404  1546  2715  2762  2810  3750  4017  5110  5561  6714  7456  8079  8178  8179  8180  8665  8937  8938  8939  8947  8948  8949  8950  8951  8952  8953  8954  8955  8956  8959  8960  8977  8978  8979  9186 11382 13507 13547 13548 13574 13584 13587 13588 13589 14092 14570 15236 15742 20804 22014 23891 24560 24846 27136 27268 27269 27272 27996 29080 29268 29394 29395 29396 29803 30398 31883 32078 32555

Killall command is very suitable in this case :

# killall httpd

Try again :

# service httpd start
Starting httpd:                                            [  OK  ]

It works now 🙂

Step by step guide create apk for your ionic framework project

Programmer Gamer Classic White Coffee Mug

I just learn to use ionic framework and I like it since I can use my knowledge in html and css a bit. The process also push me to learn about angular js. As the process getting fun each day I got litttle problem with create apk process (part of publishing). Specially in sign step. I try to recreate it by make simple ‘blank’ project.

Here’s my environment :

$ ionic info

Your system information:

Cordova CLI: 5.3.1
Gulp version:  CLI version 3.9.0
Gulp local:
Ionic CLI Version: 1.6.5
Ionic App Lib Version: 0.3.9
OS: Distributor ID:    Peppermint Description:    Peppermint Five
Node Version: v4.0.0

Create the project

$ ionic start test blank

$ cd test/

$ ionic platform add android

Start process build apk

$ cordova plugin rm cordova-plugin-console

$ cordova build –release android

…………….

……………………

……………………………

BUILD SUCCESSFUL

Total time: 13.138 secs
Built the following apk(s):
/home/alamsyah/test/platforms/android/build/outputs/apk/android-release-unsigned.apk

Generate Private Key

I use this convention :

keytool -genkey -v -keystore appname.keystore -alias appnamekey -keyalg RSA -keysize 2048 -validity 10000

$ keytool -genkey -v -keystore test.keystore -alias testkey -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]:  alamsyah rasyid
What is the name of your organizational unit?
[Unknown]:  digitalfusi
What is the name of your organization?
[Unknown]:  digitalfusi
What is the name of your City or Locality?
[Unknown]:  palembang
What is the name of your State or Province?
[Unknown]:  sumsel
What is the two-letter country code for this unit?
[Unknown]:  id
Is CN=alamsyah rasyid, OU=digitalfusi, O=digitalfusi, L=palembang, ST=sumsel, C=id correct?
[no]:  yes

Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
for: CN=alamsyah rasyid, OU=digitalfusi, O=digitalfusi, L=palembang, ST=sumsel, C=id
Enter key password for <testkey>
(RETURN if same as keystore password):
[Storing test.keystore]

Sign apk file

1st error :

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore test.keystore android-release-unsigned.apk test
Enter Passphrase for keystore:
jarsigner: Certificate chain not found for: test.  test must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.

note : I don’t use absolute path for this command.

2nd error :

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /home/alamsyah/test/test.keystore android-release-unsigned.apk testkey
Enter Passphrase for keystore:
jarsigner: unable to open jar file: android-release-unsigned.apk

note : I type the command not in the same location of .apk file

$ cd platforms/android/build/outputs/apk/

retype the command

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /home/alamsyah/test/test.keystore android-release-unsigned.apk testkey
Enter Passphrase for keystore:
adding: META-INF/MANIFEST.MF
adding: META-INF/TESTKEY.SF
adding: META-INF/TESTKEY.RSA
signing: AndroidManifest.xml
signing: assets/www/cordova-js-src/android/nativeapiprovider.js
signing: assets/www/cordova-js-src/android/promptbasednativeapi.js
signing: assets/www/cordova-js-src/exec.js
signing: assets/www/cordova-js-src/platform.js
signing: assets/www/cordova-js-src/plugin/android/app.js
signing: assets/www/cordova.js
signing: assets/www/cordova_plugins.js
signing: assets/www/css/style.css
signing: assets/www/img/ionic.png
signing: assets/www/index.html
signing: assets/www/js/app.js
………………………………………………

………………………………………………………

signing: classes.dex
jar signed.

Warning:
No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate’s expiration date (2043-02-17) or after any future revocation date.

Optimize apk with zipalign

zipalign is part of jdk. In my case I already install it in /opt

$ pwd
/opt/android-sdk/build-tools/23.0.1
[email protected] /opt/android-sdk/build-tools/23.0.1 $ ls
aapt  arm-linux-androideabi-ld  dexdump  i686-linux-android-ld  jill.jar  llvm-rs-cc      mainDexClasses.rules     NOTICE.txt    runtime.properties  split-select
aidl  bcc_compat                dx       jack.jar               lib       mainDexClasses  mipsel-linux-android-ld  renderscript  source.properties   zipalign

So the correct command is :

$ /opt/android-sdk/build-tools/23.0.1/zipalign -v 4 android-release-unsigned.apk  test.apk
Verifying alignment of test.apk (4)…
50 META-INF/MANIFEST.MF (OK – compressed)
3297 META-INF/TESTKEY.SF (OK – compressed)
6633 META-INF/TESTKEY.RSA (OK – compressed)
7806 AndroidManifest.xml (OK – compressed)
8974 assets/www/cordova-js-src/android/nativeapiprovider.js (OK – compressed)
9752 assets/www/cordova-js-src/android/promptbasednativeapi.js (OK – compressed)
……………..

……………………

………………………..

2295604 res/drawable-xhdpi-v4/icon.png (OK)
2302852 res/drawable-xxhdpi-v4/icon.png (OK)
2314932 res/drawable-xxxhdpi-v4/icon.png (OK)
2331845 res/xml/config.xml (OK – compressed)
2333704 resources.arsc (OK)
2337101 classes.dex (OK – compressed)
Verification succesful.

That is good sign that apk successfully optimize and ready for google play 🙂

ls -l | grep apk
-rw-rw-r– 1 alamsyah alamsyah 2402681 Okt  2 16:46 android-release-unsigned.apk
-rw-rw-r– 1 alamsyah alamsyah 2402707 Okt  2 16:50 test.apk

Quick update youtube-dl through pip

I use youtube-dl for download video from youtube. This program is very straightforward and came with plenty of options. One day I got error message that start with ‘encrypted signature’ . After look around I was told to upgrade my youtube-dl into latest version.

$ sudo dpkg –get-selections | grep youtube
youtube-dl                    install

Good.

Since I use pip for install this software then pip install –upgrade is come to rescue.

$ sudo pip install –upgrade youtube_dl
Downloading/unpacking youtube-dl from https://pypi.python.org/packages/2.7/y/youtube_dl/youtube_dl-2015.09.22-py2.py3-none-any.whl#md5=5131af34b2cbf21624c59338eb774027
  Downloading youtube_dl-2015.09.22-py2.py3-none-any.whl (1.0MB): 1.0MB downloaded
Installing collected packages: youtube-dl
  Found existing installation: youtube-dl 2014.02.17
    Not uninstalling youtube-dl at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed youtube-dl
Cleaning up…

$ youtube-dl –version
2015.09.22