Thursday, November 10, 2016

An introduction to information security

Information security is the collection of technologies, standards, policies and management practices that are applied to information to keep it secure.

The value of any piece of information relates to its levels of shareability and scarcity. The aim of information security is to preserve the value of information by ensuring that these levels are correctly identified and preserved.

The design of a successful information security policy and strategy for any organisation requires an assessment of a number of key factors. These factors can be categorised as either imperatives or incentives. Imperatives are pressures that force you to act. Incentives are the rewards and opportunities that arise from acting.

Sunday, October 2, 2016

Docker

Docker



//Install Docker 

//Check whether Docker is installed 
$ Docker version

//Check Docker running status 
$ sudo status docker

//Get List of Docker Images
$ docker images

//Remove Docker Images
$ docker rmi  

//created and started container
$ docker run 

//Start and stop a container
$ docker start container_name
$ docker stop container_name

//enter a container shell
$ docker exec -t -i container_id /bin/bash

//check out the current running containers
$ docker ps

//Remove Docker Containers
$ docker rm  CONTAINER ID

//Run Docker 
$ sudo start docker


//Stop & Remove All Docker Containers
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)

//Installing Docker Compose
$ sudo apt-get -y install python-pip
$ sudo pip install docker-compose

//Running a Container with Docker Compose
$ cd hello-world
$ nano docker-compose.yml
$ docker-compose up -d
$ docker-compose ps
$ docker-compose stop


Tuesday, April 5, 2016

Ngnix

https://www.linode.com/docs/websites/nginx/how-to-configure-nginx


/etc/nginx/nginx.conf

service nginx restart

Tuesday, February 2, 2016

Windows Tips

Open Group Policy Editor
GPEDIT.MSC

Tuesday, January 26, 2016

Secure and Harden Your Apache Web Server

1. Disable Signature (server version number and ServerName of the serving virtual host.)
2. Disable Banner (Server response header field, OS-type of the server, etc.)
vi httpd.conf
vi httpd-default.conf
ServerTokens Prod
ServerSignature Off

3. Disable Directory Listing
httpd.conf
Options -Indexes +FollowSymLinks +Includes +ExecCGI
4. Timeout value configuration
vi httpd-default.conf
Timeout 60
5. Hide PHP version info in HTTP header
vi php.ini
display_errors=Off  //hide php error info
expose_php = Off

Ref:
http://geekflare.com/apache-web-server-hardening-security/

Thursday, January 21, 2016

Express

Middleware functions are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle. The next middleware function is commonly denoted by a variable named next.

The order of middleware loading is important: middleware functions that are loaded first are also executed first.

Tuesday, January 12, 2016

PrestaShop Setup

1. Top horizontal mene
Modules->Front office Features->Top horizontal menu

2. Homepage Image slider
Modules->Front office Features->Image slider for your homepage

3. Store contacts and google map
Preference->Store contacts

4. Product attributes such as size, color, etc.
Catalogs->Products->Combinations

5. About us
Preference->cms

6. Changing Domain Name on your PrestaShop install
http://doc.prestashop.com/display/PS16/System+Administrator+Guide#SystemAdministratorGuide-MovingPrestaShop
https://www.siteground.com/kb/how_to_configure_prestashop_to_work_with_another_domain/
(1) update the url in ps_shop_url table;
(2) update the url in ps_configuration (PS_SHOP_DOMAIN, PS_SHOP_DOMAIN_SSL)
(3) delete everything except the index.php files in the following folders:
/cache/smarty/cache
/cache/smarty/compile

7. The admin folder name could be changed automatically.
This is because security in prestashop. You can't use "admin" directory.
you can use any other name, but not simple "admin"



Saturday, December 5, 2015

ejs

"E" is for "effective." EJS is a simple templating language that lets you generate HTML markup with plain JavaScript. 

Git

Git is a widely used version control system for software development. It is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows.

git clone https://github.com/libgit2/libgit2





Monday, November 16, 2015

Node.js async in practice

Error-first callback:
  • The first argument of the callback is reserved for an error object. If an error occurred, it will be returned by the first err argument.
  • The second argument of the callback is reserved for any successful response data. If no error occurred, err will be set to null and any successful data will be returned in the second argument.
Common node.js pattern suggests that the first argument of the callback function is an error.

Module

Node.js has a simple module loading system. In Node.js, files and modules are in one-to-one correspondence.

Variables local to the module will be private.

A required module prefixed with '/' is an absolute path to the file. For example, require('/home/marco/foo.js') will load the file at /home/marco/foo.js.

A required module prefixed with './' is relative to the file calling require(). That is, circle.js must be in the same directory as foo.js for require('./circle') to find it.

Without a leading '/', './', or '../' to indicate a file, the module must either be a core module or is loaded from a node_modules folder.

module.exports is the object that's actually returned as the result of a require call.

JS Library

Underscore.js is a utility-belt library for JavaScript that provides support for the usual functional suspects (each, map, reduce, filter...) without extending any core JavaScript objects.



Ref:
http://www.sebastianseilund.com/nodejs-async-in-practice
http://amirrajan.net/nodejs-by-example/

Wednesday, April 15, 2015

AngularJS

AngularJS is built around the belief that declarative programming should be used for building user interfaces and connecting software components, while imperative programming is better suited to defining an application's business logic.

Directives 

AngularJS directives are extended HTML attributes with the prefix ng-.

The ng-app directive initializes an AngularJS application.
The ng-init directive initializes application data.
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.

Data Binding

Data-binding: This is one of the core features in Angular. When the page loads, Angular binds the name of the input box to a variable of the same name in the data model and keeps the two in sync.

The {{ firstName }} expression, in the example above, is an AngularJS data binding expression.
Data binding in AngularJS, synchronizes AngularJS expressions with AngularJS data.
{{ firstName }} is synchronized with ng-model="firstName".

Filters

A filter can be added to an expression with a pipe character (|) and a filter.

Tuesday, April 14, 2015

Javascript

1. where to put the javascript in the HTML, head or body?


A common advise for HTML applications, is to place scripts at the very bottom of the element.

Sunday, April 5, 2015

PhoneGap

http://cleancodedevelopment-qualityseal.blogspot.nl/2012/11/how-to-install-phonegap-for-android.html

Getting Cordova/Phonegap to emulate on Genymotion virtual device
It seems that adb sees genymotion virtual device as a real device and not as an emulated one, try cordova run android instead of cordova emulate android.

Thursday, March 19, 2015

Margin and Padding

Padding is the space inside the border, between the border and the actual view's content. Note that padding goes completely around the content: there is padding on the top, bottom, right and left sides (which can be independent).
Margins are the spaces outside the border, between the border and the other elements next to this view. In the image, the margin is the grey area outside the entire object. Note that, like the padding, the margin goes completely around the content: there are margins on the top, bottom, right, and left sides.
alt text

Android padding vs margin

Ref: http://stackoverflow.com/questions/4619899/difference-between-a-views-padding-and-margin?lq=1

Monday, March 9, 2015

Script

wget -r -nH --cut-dirs=5 -nc ftp://user:pass@server//absolute/path/to/directory

Note the double slash after the server name. If I don't put an extra slash the path is relative to the home directory of user.

  • -nH avoids the creation of a directory named after the server name 
  • -nc avoids creating a new file if it already exists on the destination (it is just skipped) 
  • --cut-dirs=5 allows me to take the content of /absolute/path/to/directory and to put it in the directory where I launch wget. The number 5 is used to filter out the 5 components of the path. The double slash means an extra component.
echo %date:~6,4%-%date:~3,2%-%date:~0,2%
2015-03-12



Ref: http://stackoverflow.com/questions/113886/how-do-you-recursively-ftp-a-folder-in-linux

Saturday, January 3, 2015

Install HMailServer + RoundCube

Install HMailServer
1. copy libmysql.dll from mysql bin folder to HMailServer bin folder.

Install RoundCube


Active password plugin
1. Open php.ini add the followings, add
extension=php_com_dotnet.dll
2. Open roundcube/plugins/password/config.inc.php, update
$config['password_driver'] = 'hMail';
3. Open roundcube/config/config.inc.php, add
$config['plugins'] = array('password');

//Query the MX Record using -query=mx

nslookup -query=mx redhat.com



Tuesday, September 23, 2014

SAN (Storage Area Network)

A storage area network (SAN) is a dedicated network that provides access to consolidated, block level data storage. SANs are primarily used to enhance storage devices, such as disk arrays, tape libraries, and optical jukeboxes, accessible to servers so that the devices appear like locally attached devices to the operating system. A SAN typically has its own network of storage devices that are generally not accessible through the local area network (LAN) by other devices.

DAS (Direct Attached Storage)

NAS (Network Attached Storage)


Concentrating the storage on one or more NAS servers or in a SAN instead of placing storage devices on each application server allows application server configurations to be optimized for running their applications instead of also storing all the related data and moves the storage management task to the NAS or SAN system. Both NAS and SAN have the potential to reduce the amount of excess storage that must be purchased and provisioned as spare space. In a DAS-only architecture, each computer must be provisioned with enough excess storage to ensure that the computer does not run out of space at an untimely moment. In a DAS architecture the spare storage on one computer cannot be utilized by another. 

Friday, August 22, 2014

3D ELearning System

http://www.skills2learn.com/index.html
http://psrinteractive.com/
http://www.eonreality.com/
http://elearningindustry.com/the-top-6-animated-video-software-in-the-elearning-market
http://www.designmate.com/index.html
http://ghostproductions.com/blog/2013/11/21/technology-education-elearning-animation/


Sunday, November 11, 2012

NoSQL

NoSQL databases are often highly optimized for retrieve and append operations and often offer little functionality beyond record storage.

Tuesday, November 6, 2012

Python

Django web Framework (/ˈdʒæŋɡoʊ/ jang-goh) is an open source Web 2.0 application framework, written in Python, which follows the model–view–controller architectural pattern.