Job Opportunities for Tuesday, May 7, 2013

 

Hi All,

Please find the below the latest job postings:

Documentation Specialist at Export Trading Group

Business Analyst, City of Vaughan

Cross Platform Associate Producer (English) (French), CBC/Radio Canada

Finance and Administrative Director, Greenpeace Canada

Thanks,

The TRIEC Team

Posted in Jobs | Leave a comment

Most Popular Job Websites

http://www.monster.com/

http://www.careerbuilder.com/

http://ca.indeed.com/

http://www.simplyhired.ca/

http://www.glassdoor.com/

http://www.workopolis.com

http://www.bright.com/

http://www.ziprecruiter.com/

http://www.findtherightjob.com/

http://www.job.com/

http://www.beyond.com/

http://www.theladders.com/

http://toronto.en.craigslist.ca/sof/

http://toronto.en.craigslist.ca/web/

http://toronto.en.craigslist.ca/eng

http://www.localwork.ca/

http://www.sisystems.com/index.cfm?mg=cpo.MainViewOpps

http://careers.stackoverflow.com

https://www.odesk.com

http://www.dice.com/

Posted in Jobs | Tagged | Leave a comment

Find a job in canada – how to make it happen. Dr. Lionel Laroche

In depth analyses of the Canadian labor market and the challenges that people face when moving to Canada. Dr. Lionel Laroche – Hard skills vs. soft skills, at the IEP conference.

Posted in Cross Cultural Management | Comments Off on Find a job in canada – how to make it happen. Dr. Lionel Laroche

Nginx, PHP 5.3.10 and PHP-FastCGI (PHP5-FPM) on Ubuntu 10.04 (lucid)

The nginx is an open source Web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high concurrency, performance and low memory usage. Although commonly used to serve static content, it's quite capable of handling dynamic pages as well. This guide will help you get nginx up and running with PHP via FastCGI on your Ubuntu 10.04 (lucid) Linux VPS. To check the Ubuntu version type: lsb_release -a and press Enter.

Set the Hostname

Issue the following commands to make sure it is set properly:

hostname
hostname -f

The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN).

Install PHP-FPM: PHP FastCGI Process Manager

PHP-FPM (PHP FastCGI Process Management) is a patch for PHP to improve PHP’s FastCGI capabilities and administration. It is bundled with the official PHP distribution since version 5.3.3.

cd /tmp 
aptitude install python-software-properties 
add-apt-repository ppa:brianmercer/php5
apt-get clean; apt-get update; apt-get upgrade; apt-get dist-upgrade

Install/Update PHP5

Issue the following commands to update your system and install the nginx web server, PHP, and compiler tools:

apt-get install php5 php5-cgi php5-common php5-dev php-pear php5-cli php5-suhosin php5-gd php5-imagick php5-curl php5-mcrypt
apt-get install php5-fpm php5-ldap php5-memcache php-apc php5-mysql php5-sqlite php5-intl
apt-get install php5-snmp php5-tidy php5-xmlrpc php5-xsl php5-json php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-idn php5-imap


pear channel-update pear.php.net 
pear upgrade-all

Optional installation:

 apt-get install pdo pdo_sqlite sqlite 

Start PHP5-FPM

service php5-fpm start 

To check that PHP is listening on port 9000, run the following command:

netstat -ant | grep :9000

Output:

tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN

Tweak the php-fpm configuration:

nano /etc/php5/fpm/php5-fpm.conf

The following tweaks have been customized for a 512MB-1GB VPS. The line "request_terminate_timeout = 30s" is optional but I highly suggest you use it. It's saying that if a php-fpm process hangs it will terminate it if it continues to hang for 30 seconds. This will add stability and reliability to php application in the event there is a problem.

pm.max_children = 25
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 10
pm.max_requests = 500
request_terminate_timeout = 30s

Restart php5-fpm:

service php5-fpm restart

Install NGINX

Append the appropriate stanza to /etc/apt/sources.list. The Pgp page explains the signing of the nginx.org released packaging. Ubuntu 10.04:

deb http://nginx.org/packages/ubuntu/ lucid nginx
deb-src http://nginx.org/packages/ubuntu/ lucid nginx     

Install Nginx:

apt-get clean; apt-get update; apt-get upgrade; apt-get dist-upgrade
sudo apt-get install nginx   
...

Installing new version of config file /etc/nginx/fastcgi_params ...
Installing new version of config file /etc/nginx/nginx.conf ...
Installing new version of config file /etc/nginx/mime.types ...
Installing new version of config file /etc/logrotate.d/nginx ...
Installing new version of config file /etc/init.d/nginx ...
...

Check the version of Nginx: nginx -v or dpkg –print-avail nginx

To start Nginx, run the following command:

service nginx start

To check that Nginx is listening on port 80, run the following command:

netstat -ant | grep :80

Output:

tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN

Issue with starting Nginx.

Output:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Check runung PID for port 80:

lsof -i tcp:80 or fuser -n tcp 80

Kill processes and run Nginx:

fuser -k 80/tcp ; service nginx restart

Tweak the nginx configuration:

nano /etc/nginx/nginx.conf
user www-data;
worker_processes  1;
error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {use epoll; worker_connections  1024; multi_accept on;}

http {
    ##
    # Basic Settings
    ##
    client_max_body_size 20M;
    client_body_buffer_size 128k;

    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    sendfile    on;
    tcp_nopush  on;
    tcp_nodelay on;
    keepalive_timeout  65;
    types_hash_max_size 2048;
        # server_tokens off;
        # access_log off;
        # client_max_body_size 32m;
        # client_body_timeout 60;
        # client_header_timeout 60;
        # send_timeout 60;
        # reset_timedout_connection on;
    ##
    # Logging Settings error_log=[debug | info | notice | warn | error | crit]
    ##
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;
    error_log   /var/log/nginx/error.log info;

    ##
    # Gzip Settings
    ##
        gzip on;
        gzip_min_length 5000;
        gzip_buffers 16 8k;
        gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/json;
        gzip_proxied any;
        gzip_comp_level 9;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_http_version 1.1;

        gzip_static on;
        ignore_invalid_headers  on;

    ##
    # Virtual Host Configs
    ##
        upstream php {
                server 127.0.0.1:9000;
         }
       include /etc/nginx/sites-enabled/*;
}

 

 

 

 

 

 

 

 

 

 

Posted in Technologies | Comments Off on Nginx, PHP 5.3.10 and PHP-FastCGI (PHP5-FPM) on Ubuntu 10.04 (lucid)

Introduction to MongoDB

Databases
MongoDB has databases, collections, and documents. Download an example file.

Collections
Collections correlate to tables within the relational database paradigm.Like tables, indexes
are applied to collections. A collection is a collection of documents and indexes.

Documents
In MongoDB, the primary object is called a document. MongoDB document is a JSON array with a set of keys that map to values.

Installing MongoDB

Connecting to a Database
The default host is localhost, and the default port is 27017.
Connecting to MongoDB database server at localhost port 27017:
$connection = new Mongo();
Connecting to a remote host with optional custom port:
$connection = new Mongo( “190.50.0.80:66001” );

Selecting a Database
MongoDB will create a new database if you try to select a database that doesn’t. Open connection to MongoDB server:
$db = $connection->selectDB(‘workout’);
or
$db = $connection->workout;

CRUD Operations
Create a collection or access to collection:
$user_collection = $db->user;
or
$user_collection= $connection->workout->user;

Creating a Document
$user = array(‘group_access_id’ =>1, ‘first_name’ => ‘Ruslan’, ‘last_name’ => ‘Verbelchuk’,‘phone’ => ”, “e-mail”=>’ruslan.verbelchuk@gmail.com’, “membership”=>”);
$user_collection->insert($user);

Asynchronous update does not return a value after insert a record.
$user_collection->insert($user);

Synchronously update hold execution until it has finished inserting. The application must wait for the database.
$user_collection->insert($user, array(‘safe’ => true));
To access the primary key:
$user_id = $user[‘_id’];

Save a Document
An _id value is specified and exists.
$user_collection->save($user);

Primary Keys and ObjectIds

MongoDB will automatically create a primary key (ObjectIds) for each document.
$user_id->getTimestamp();

Reading a Document
Access the document by the primary key:
$user_data=$user_collection->findone( array(‘_id’=>$user_id) );
echo ‘<br>First Name: ‘ . $user_data[‘first_name’] . ‘<br/>’;
echo ‘Last Name: ‘ . $user_data[‘last_name’] . ‘<br/>’;
echo ‘E-mail: ‘ . $user_data[‘e-mail’] . ‘<br/>’;
echo ‘<br/>’;

A second parameter that is an array of the fields to return:
$user_data=$user_collection->findone( array(‘_id’=>$user_id), array(‘phone’) );
echo “<p>”.print_r($user_data).”</p>”;

Get all documents:
$user_data=$user_collection->find();
echo $user_data->count() . ‘ document(s) found. <br/>’;
foreach ($user_data as $obj) {
echo ‘<br>First Name: ‘ . $obj[‘first_name’] . ‘<br/>’;
echo ‘Last Name: ‘ . $obj[‘last_name’] . ‘<br/>’;
echo ‘E-mail: ‘ . $obj[‘e-mail’] . ‘<br/>’;
echo ‘<br/>’;
}

Updating a Document
Using $set to update a few fields:
$user_collection->update(
array(‘_id’ =>$user_id),
array(‘$set’=>array(‘e-mail’=>’ruslan.verbelchuk@hotmail.com’,’phone’=>’4164440505′) )
);

Use update to add a value:
$user_collection->update(
array(‘first_name’=>’Ruslan’,’last_name’=>’Verbelchuk’),
array(‘$set’=>array(‘location’=>array(
‘country’=>’CA’,
‘province’=>’ON’,
‘city’=>’Toronto’,
‘zip_code’=>’M5M9T6’,
‘street_Name’=>’Yonge’,
‘street_type’=>’Str’,
‘street_direction’=>”,
‘street_number’=>’1450’,
‘street_type’=>”,
‘number_suffix’=>”,
‘unit_suite_apt’=>”,
‘date_time’=>”,
)
) )
);
Append values atomically to an array:
$user_collection->update(
array(‘first_name’=>’Ruslan’,’last_name’=>’Verbelchuk’),
array(‘$push’=>array(‘location’=>array(
‘country’=>’USA’,
‘province’=>’NY’,
‘city’=>’Rochester’,
‘zip_code’=>’12345’,
‘street_Name’=>’University’,
‘street_type’=>’Str’,
‘street_direction’=>”,
‘street_number’=>’23’,
‘street_type’=>”,
‘number_suffix’=>”,
‘unit_suite_apt’=>”,
‘date_time’=>”,
)
) )
);

Deleting a Document
justOne limit the deletion to a single document.
$criteria = array(‘last_name’=> ‘Verbelchuk’);
$user_collection->remove($criteria, array(“justOne” => true) );

Posted in MongoDB | Tagged | Comments Off on Introduction to MongoDB

FAQ: MongoDB

  1. Tools

 

Posted in Technologies | Comments Off on FAQ: MongoDB

Responsive Web Design

Responsive web design (often abbreviated to RWD) is an approach to web design in which a site is crafted to provide an optimal viewing experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices (from desktop computer monitors to mobile phones).

5 APIs that will transform the Web in 2013
http://blog.alexmaccaw.com/the-next-web
Changing Times For Web Developers – 6 Tips You Should Read To Survive
http://www.amazedsaint.com/2012/11/changing-times-for-web-developers-6.html

Frameworks:

  1. Bootstrap
  2. YUI and responsive grids:
    http://gridbuilder.herokuapp.com/,
    http://gridbuilder.herokuapp.com/layout.html
    http://www.youtube.com/watch?v=KpyBAQt7hUs, scroll to 43:10
    (although the first talk is very good – if you are familiar with jQuery UI, you will see that YUI one step ahead actually).
Posted in Technologies | Leave a comment

How to Mount a Remote Folder using SSH on Ubuntu

Connecting to a server across the internet is much more secure using SSH. There is a way that you can mount a folder on a remove server using the SSHFS service.

There are quite a few steps that you’ll have to follow, so get ready and open a terminal window.

First we’ll install the module:

sudo apt-get install sshfs

Now we will use the modprobe command to load it

sudo modprobe fuse

We’ll need to set up some permissions in order to access the utilities. Replace <username> with your username.

sudo adduser <username> fuse
sudo chown root:fuse /dev/fuse
sudo chmod +x /dev/fusermount

Since we’ve added ourselves to a user group, we need to logout and back in at this point before we continue.

Now we’ll create a directory to mount the remote folder in. I chose to create it in my home directory and call it remoteserv.

mkdir ~/remoteserv

Now we have the command to actually mount it. You’ll be prompted to save the server key and for your remote password.

sshfs <username>@<ipaddress>:/remotepath ~/remoteserv

Now you should be able to cd into the directory and start using it as if it was local.

cd ~/remoteserv
root@ubuntu:~/remoteserv$ ls -l

To unmount sshfs enter this command

fusermount -u ~/remoteserv
Posted in Debian&Ubuntu | Comments Off on How to Mount a Remote Folder using SSH on Ubuntu

How to start/stop IIS services from command prompt?

Open command prompt from start option

1) To start world wide web services c:\>net start w3svc
2) To start the ftp service c:\>net start msftpsvc
3) To start the smtp service c:\>net start smtpsvc
4) To start the plesk control panel service c:\>net start PleskControlPanel
5) To start the HTTP SSL service c:\>net Start HTTPFilter
6) To restart IIS services c:\>iisreset /restart
7) To check the status of the IIS services c:\>iisreset /status

To stop the services use stop instead of start in the above 5 commands .

Posted in Technologies | Leave a comment

How to install imagemagick on Ubuntu 10.04?

The solution is to go get the latest ImageMagick version and build it yourself;

> wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
> tar -xzvf ImageMagick.tar.gz
> ./configure --prefix=/usr/local --with-x=no --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp
> make
> sudo make install
> sudo /sbin/ldconfig /usr/local
> sudo ln -f /usr/local/bin/Magick-config /usr/bin/Magick-config
> sudo PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ gem install rmagick

Result

Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Posted in Technologies | Comments Off on How to install imagemagick on Ubuntu 10.04?