Thursday, November 29, 2018
Checking your site SSL
I have been working on trouble shooting web site's SSL recently and came across some very useful free tools for checking the site's SSL in this case. I think it's worth for me to keep a record here and hopefully it's useful for you too :
Easy to use - SSL Checker from SSLShopper
More Complete Info - SSL Report from Qualys
Tuesday, October 09, 2018
FREE Cryptocurrency API
I have been working on some Cryptocurrency project and looking for some free API to use in my project. This post shall serve as my own record in the path of constructing my project and hopefully someone might find it usefull as well. Following are some of the free API that i found and i only focusing those that are able to support realtime(or almost realtime) date feeding.I will be keep updating the list below as i am constructing my project.
CoinAPI API
- FREE
- Support websocket, which seem to be realtime updating.
- For the api document, it seem to be able to support retrieval of orderbook.
- FREE account have the following limitation :
- only support retrieval of trade details using websocket.
- websocket only limited to 15min daily connection time.
- only support retrieval of trade details using websocket.
- websocket only limited to 15min daily connection time.
CryptoCompare API
- FREE
- Support websocket, which seem to be realtime updating, sample : Trade Info
- unable to locate info to retrieve orderbook details.
Nomic API
- FREE and no rate limits. (yet to find out)
- Mentioned to support websocket, but unable to find details info from the API doc.
Wednesday, August 15, 2018
Running Redmine using Docker
Run into Docker recently and would like to work on something. Let's try on running Redmine using Docker. Following are the steps to get it running in your localhost:
1. Install and get docker running in your PC.
2. Run into command prompt and start doing the real docker job.
3. In the command prompt pull Redmine using the following command:
$ docker pull redmine
4. Once you docker pull redmine successfully, now you can run redmine in a container using the following command:
$ docker run -d -P --name myRedmine redmine-d will detach out terminal
-P will publish all exposed ports to random ports
-name corresponds to a name we want to give5. Now we can see the ports by running the following$ docker port myRedmine 3000/tcp -> 0.0.0.0:32769
6. You can now open http://localhost:32769. You might need to wait a while for redmine to start.7. You can also specify a custom port to which the client will forward connections to the container using the following command :$ docker run -d -p 8080:3000 --name myRedmine redmine
Monday, June 25, 2018
Raspberry PI Zero and Raspberry PI Zero W
I personally prefer Raspberry PI Zero with WIFI as it's easier to get connected to the internet for configuration. To setup the the Pi, you can download the respbian images from the following location :
I shall put on the steps in a separate blog entry later for setting up the PI. So please stay tune with me.
Wednesday, February 07, 2018
Trading CryptoCurrency in Malaysia.
To enable to start trading more variety of Crypto Currency, you may refer to the following :
Binance : Trading variety of Crypto Currency in Malaysia
You can open account in Binance, and deposit your Bitcoin / Ethereum directly using the fund wallet address provided in Binance during your purchase in platform like Remito. From Binance, you are then able to trade others Crypto Currency as mentioned above.
* CryptoCurrencies are high risk financial instrument. This article only provide information as it is. The Writer shall never bare any consequences on any actions taken by the reader.
Buying Crypto currency (Bitcoin, Ethereum) in Malaysia
As a Malaysian, I found that it's not that straight forward for Malaysia to buy CryptoCurrency. In fact there is less platform available for us. Following are the 2 platform that's available for us to buy CryptoCurrency :
However, referring to the above platform, we can only buy BitCoin (BTC) and Etherem (ETH) at the moment, to buy / trade others coin like Ripples, Tron, NEO, etc, there are still some steps need to be carry out which i am going to share in another post :
* CryptoCurrencies are high risk financial instrument. This article only provide information as it is. The Writer shall never bare any consequences on any actions taken by the reader.
Sunday, November 26, 2017
Running Docker in my OrangePi Lite
Fascinated to mini PC for sometimes already. Only recently have some free time to play around with my long purchased OrangePi Lite. As an alternative for Raspberry Pi, I got my H3 ARM, Cortex-A7 Quad Core, 512mb RAM OrangePi Lite, for less than USD$14. After tried several way which didn't work, i have found the following setup are able to run Docker :
1. download the armbian server image using the following link :
https://www.armbian.com/orange-pi-lite/
2. burn the image using Win32DiskImage into a SD card with minimum 8GB storage
3. Plugin the SD card into the OrangePi Lite slot and start the OrangePi.
4. Following the instruction on the screen to configure your account and finally reboot the device.
5. Run "armbian-config" to configure WIFI connection.
6. Within armbian-config, switch to use to use Dev builds instead of stable build.
7. run apt-update and then apt-upgrade.
8. reboot the device. After reboot, we are ready to setup docker.
9. Use the following steps to setup docker :
i. Install packages to allow
apt to use a repository over HTTPS:$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
ii. Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
iii. Verify that you now have the key with the fingerprint:
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88,
by searching for the last 8 characters of the fingerprint.
$ sudo apt-key fingerprint 0EBFCD88
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb)
sub 4096R/F273FCD8 2017-02-22
iv. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or testrepository, add the word
edge or test (or both) after the word stable in the commands below.Note: Thelsb_release -cssub-command below returns the name of your Ubuntu distribution, such asxenial. Sometimes, in a distribution like Linux Mint, you might have to change$(lsb_release -cs)to your parent Ubuntu distribution. For example, if you are usingLinux Mint Rafaela, you could usetrusty.
armhf:
$ sudo add-apt-repository \
"deb [arch=armhf] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
v. Install the latest version of Docker CE, or go to the next step to install a specific version. Any existing installation of Docker is replaced.
$ sudo apt-get install docker-c
vi. Verify that Docker CE is installed correctly by running the
hello-world image.$ sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
Monday, November 20, 2017
Raspbian Pi for ORange Pi - Fully expand SD space
Following are the steps to expand the SD space within Raspbian Pi running in My Orange PI :
root@orangepi:~# fdisk /dev/mmcblk0
Command (m for help): p
Disk /dev/mmcblk0: 15.8 GB, 15804137472 bytes
4 heads, 16 sectors/track, 482304 cylinders, total 30867456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x34605ba5
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 40960 124927 41984 83 Linux
/dev/mmcblk0p2 124928 7170047 3522560 83 Linux
Command (m for help): d
Partition number (1-4): 2
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-30867455, default 2048): 124928
Last sector, +sectors or +size{K,M,G} (124928-30867455, default 30867455):
Using default value 30867455
Command (m for help): w
Theen quit (command q), reboot. You will then be able to use resize:
resize2fs /dev/root
df -h
root@orangepi:~# fdisk /dev/mmcblk0
Command (m for help): p
Disk /dev/mmcblk0: 15.8 GB, 15804137472 bytes
4 heads, 16 sectors/track, 482304 cylinders, total 30867456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x34605ba5
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 40960 124927 41984 83 Linux
/dev/mmcblk0p2 124928 7170047 3522560 83 Linux
Command (m for help): d
Partition number (1-4): 2
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-30867455, default 2048): 124928
Last sector, +sectors or +size{K,M,G} (124928-30867455, default 30867455):
Using default value 30867455
Command (m for help): w
Theen quit (command q), reboot. You will then be able to use resize:
resize2fs /dev/root
df -h
Friday, June 23, 2017
How to ignore .php extention in url for Wamp and UWamp
Follow are the step to ignore .php extension in URL 1 :
- First, you need to enable the "rewrite_module" in your apache.
- Second, create a ".htaccess" file inthe root folder of your web folder with the following contents :
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^ %{REQUEST_URI}.php [L]
Thursday, March 09, 2017
Resetting User's password in Bitnami Gitlab using command line
Just for my own record or for someone that needed it :
First create a backup of your stack just in case :
After that just run the following to reset the user's password :
First create a backup of your stack just in case :
sudo /opt/bitnami/ctlscript.sh stop
cd /opt
sudo cp -a bitnami bitnami_backup
sudo /opt/bitnami/ctlscript.sh start
After that just run the following to reset the user's password :
cd /opt/bitnami/apps/gitlab/htdocs
echo 'u=User.find_by_id(1); u.username="NEW_USERNAME"; u.save!;' | RAILS_ENV=production /opt/bitnami/ruby/bin/ruby /opt/bitnami/apps/gitlab/htdocs/bin/rails c
echo 'u=User.find_by_id(1); u.password="NEW_PASSWORD"; u.save!;' | RAILS_ENV=production /opt/bitnami/ruby/bin/ruby /opt/bitnami/apps/gitlab/htdocs/bin/rails c
Tuesday, February 28, 2017
Updating Bitnami Redmine
Information
- installation directory is /opt/bitnami.
- main folders that you can find inside 'apps/redmine' are the following:
• conf: folder that includes the apache configuration files for redmine
• htdocs: this folder includes the redmine files (Gemfile and Rakefile files, redmine configuration files, plugins folder, gems, etc).
- The location of the redmine configuration files (database configuration, email settings, etc) is the 'apps/redmine/htdocs/config' folder.
Upgrading Process
1. Backup existing redmine DB
mysqldump -u root -p bitnami_redmine > /home/bitnami/wordpress_backup.sql
2. Copy the database backup to the new Bitnami version server. using "WinSCP"
3. Stop all services and restart MySQL service
4. Login to MySQL and rebuild the DB
6. Migrate the database to the latest version:
8. Copy the folders from "vendor/plugins" directory into new installation directory, in "plugins" folder.
9. Check the plugins also support this new version and run the following command
3. Stop all services and restart MySQL service
sudo /opt/bitnami/ctlscript.sh stop
sudo /opt/bitnami/ctlscript.sh start mysql3a. if you found that u unable to login to the root account, youmay need to carry out the following steps to reset the MySQL root's password:
- Create a file in /home/bitnami/mysql-init with the content shown below (replace NEW_PASSWORD with the password you wish to use):
UPDATE mysql.user SET Password=PASSWORD('NEW_PASSWORD') WHERE User='root'; FLUSH PRIVILEGES;- If you are using MySQL 5.7 only, use the following content instead of that shown above:
UPDATE mysql.user SET authentication_string=PASSWORD('NEW_PASSWORD') WHERE User='root'; FLUSH PRIVILEGES;- Stop the MySQL server:
sudo /opt/bitnami/ctlscript.sh stop mysql- Start MySQL with the following command:
sudo /opt/bitnami/mysql/bin/mysqld_safe --pid-file=/opt/bitnami/mysql/data/mysqld.pid --datadir=/opt/bitnami/mysql/data --init-file=/home/bitnami/mysql-init 2> /dev/null &- Restart the MySQL Server
sudo /opt/bitnami/ctlscript.sh restart mysql- Remove the Script
rm /home/bitnami/mysql-init
mysql -u root -p
mysql> drop database bitnami_redmine;
mysql> create database bitnami_redmine;
mysql> grant all privileges on bitnami_redmine.* to 'bitnami_redmine'@'localhost' identified by 'DATABASE_PASSWORD';
mysql -u root -p bitnami_redmine < backup.sql5. Edit the Redmine configuration file to update the database user password (the same that you set previously) "/opt/bitnami/apps/redmine/htdocs/config/database.yml"
6. Migrate the database to the latest version:
cd /opt/bitnami/apps/redmine/htdocs
ruby bin/rake db:migrate RAILS_ENV=production7. Copy the ""/opt/bitnami/apps/redmine/htdocs/files" folder from the old installation to the new one.
8. Copy the folders from "vendor/plugins" directory into new installation directory, in "plugins" folder.
9. Check the plugins also support this new version and run the following command
ruby bin/rake redmine:plugins RAILS_ENV="production"10. clean the cache and the sessions, then you are free to restart the services :
ruby bin/rake tmp:cache:clear
ruby bin/rake tmp:sessions:clear
sudo /opt/bitnami/ctlscript.sh restart
Wednesday, July 06, 2016
Setup gitolite in D-Link DIR-620 router running openwrt

- Setup USB Storage. In this case i am using a 8gb USB thumb drive using the following command (i have formated my usb drive into ext4 format):
opkg install kmod-usb-storage block-mount kmod-fs-ext4
- Setup gitolite in the router using the following step :
- Install necessary components
opkg install git perl perlbase-essential perlbase-getopt perlbase-findbin perlbase-cwd perlbase-config perlbase-file perlbase-data perlbase-bytes perlbase-xsloader openssh-keygen perlbase-hostname perlbase-fcntl perlbase-io perlbase-symbol perlbase-selectsaver perlbase-errno perlbase-base
- Backup authorized_keys file if exist
cp -p /etc/dropbear/authorized_keys /etc/dropbear/authorized_keys_backup
- Create directory under mnt and mount usb drive
mkdir /mnt/usb
mount /dev/[sda2]/mnt/usb
- Move root to usb and create link
cd /
mv root /mnt/usb
ln -s /mnt/usb/root root
- Download gitolite
cd /root
git clone git://github.com/sitaramc/gitolite
- Install a link to gitolite executable into /usr/bin
gitolite/install -ln /usr/bin
- create gitolite logfile directory
mkdir /root/.gitolite mkdir /root/.gitolite/logs
- Copy your ssh public key to root, you may use puttykeygen tools to get the single line public key and paste to a new file via vi command
vi yourname.pub
- Setup gitolite
gitolite setup -pk yourname.pub
- now you can remove the public key file and create a link to /root/.ssh/authorized_keys in /etc/dropbear/authorized_keys
rm yourname.pub
rm /etc/dropbear/authorized_keys ln -s /root/.ssh/authorized_keys /etc/dropbear/authorized_keys
- now you can admistrate your gitolite by cloning the gitolite-admin repo
git clone root@OpenWRTBox:gitolite-admin


