How to fix freebsd-update no mirror problem

In my latest post about php 7 on FreeBSD 10.2 I use $5 vps/month as quick solution for my freebsd 10.2 need (the service is really good actually since I can use any *bsd by upload iso to their server). The main problem of it is freebsd-update problem where I face this error when I use freebsd-update : “No mirrors remaining, giving up”.

I don’t see that problem when I use vps but I used to see it when I try to use virtualization like virtualbox but I need it for my class. Each student must be able to update their freebsd box by their self.

Finally I got the solution 5 minutes before class start ūüôā


Here’s what I do :

1st try

# freebsd-update fetch
Looking up mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from…

No mirrors remaining, giving up.

Try to debug it

# freebsd-update -v debug fetch
Looking up mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from…
fetch: transfer timed out
fetch: latest.ssl appears to be truncated: 0/512 bytes
No mirrors remaining, giving up.

Ok, lets try other mirror

# freebsd-update -s fetch
Looking up mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from… ^C^C

I cancel it.

Another try

# dig Continue reading

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.


To enable the designer tab  :

  1. Edit

In case only available then you need to rename the file into

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. Continue reading

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 mirrors… none found.
Fetching public key from… done.
Fetching metadata signature for 10.2-RELEASE from… 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

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

;        IN    A

;; ANSWER SECTION:    599    IN    CNAME    599    IN    A

;; AUTHORITY SECTION:        599    IN    NS        599    IN    NS        599    IN    NS

;; Query time: 16 msec
;; 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 mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from… 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 ‘ (’ 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 ‘’ (ECDSA) to the list of known hosts.
Password for [email protected]:
Last login: Tue Oct 27 18:44:11 2015 from
FreeBSD 10.2-RELEASE (GENERIC) #0 r286666: Wed Aug 12 15:26:37 UTC 2015

Welcome to FreeBSD!

Release Notes, Errata:
Security Advisories:
FreeBSD Handbook:
Questions List:
FreeBSD Forums:

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 mirrors… 5 mirrors found.
Fetching metadata signature for 10.2-RELEASE from… 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:

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+, please wait…
Verifying signature with trusted certificate… 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 mirrors… 7 mirrors found.
Fetching public key from… done.
Fetching snapshot tag from… 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… 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.                            
Applying patches…
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
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/

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



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
fetch: Authentication error
*** Error code 1

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
no listening sockets available, shutting down
Unable to open logs


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





Total time: 13.138 secs
Built the following apk(s):

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:
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.

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
[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  split-select
aidl  bcc_compat                dx       jack.jar               lib       mainDexClasses  mipsel-linux-android-ld  renderscript   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