How to connect to more than one database in codeigniter
$db[‘default’][‘hostname’] = “localhost”;
$db[‘default’][‘username’] = “root”;
$db[‘default’][‘password’] = “”;
$db[‘default’][‘database’] = “database_name”;
$db[‘default’][‘dbdriver’] = “mysql”;
set another config for 2nd database
$db[‘otherdb’][‘hostname’] = “localhost”;
$db[‘otherdb’][‘username’] = “root”;
$db[‘otherdb’][‘password’] = “”;
$db[‘otherdb’][‘database’] = “other_database_name”;
$db[‘otherdb’][‘dbdriver’] = “mysql”;
Sample to call
//Load another database
$DB2 = $this->load->database(‘another_db’, TRUE);
//Default database query
$query = $this->db->get();
//Another database query
$query = $DB2->get();
Some notes on ionic CLI command
Create new project (will create myApp directory):
> ionic start myApp blank
(besides blank, there is option to use other template like tabs, sidemenu, tutorial, super)
tabs : a simple 3 tab layout
sidemenu: a layout with a swipable menu on the side
blank: a bare starter with a single page
super: starter project with over 14 ready to use page designs
tutorial: a guided starter project
Get into the directory and start service
> ionic serve
Launch editor to start coding
> atom .
- ionic framework doc
- ionic crashed course video (~30 minutes)
It is sometimes useful to convert a web page to a PDF file
- to send it to other people via whatsapp or email
- to keep it in our folder on PC
- to print
HTTPS becoming a standard now for all apps and websites.
- lets encrypt
- comodo (free 90 days)
An easy way to deploy latest code to the server.
Below are some resources that can be referred to
- using cpanel
Getting yourself a used car has some advantages. The most severe one is you save thousands of your money. But need to be very careful in order to get a used car with good condition.
If you are looking for a used car, try out the following websites.
- mudah.my – huge list of cars available
- carlist.my – most of the list are more or less the same with mudah. especially from car dealer
- motortrader.com.my – there is a rating from Goo KANTEI for the condition of the car. For some cars. Can find more cars directly from owners
- oto.my – related to paultan.org and carbase.my
the rest not worth to mention here. Don’t have many listings
Some general tips to purchase second hand car
- if possible check why previous owner sell
- before go to see, ask questions over the phone. The most important one whether the car still available
- ask to see the grant
- ask for any other charges on top of car price – insurance, roadtax, change name, puspakom service, loan processing etc.
Some tips on checking the condition of the car
- sign of accident (normally with uneven paint)
- any leaking on engine and absorber etc
- the hose and belts are in acceptable condition
- test drive to check on engine is smooth and no irregular sounds from the car body or engine
- tyre tread still ok, manufactured not more than 3 years
Several providers for disposable or temporary emails. Just in case you wan to test anything and need a valid email for temporary
- https://mailinator.com – can set email@example.com
- yopmail.com – can set firstname.lastname@example.org
- https://mytemp.email – total random, cannot set own name
- https://temp-mail.org/en/ – can set own email. provide multiple @domain
SSH is a safer and easier way to establish connection to a server instead of using username and password.
In Mac OSX terminal, check if any SSH key is exist
If no SSH key available, generate one
ssh-keygen -t rsa
You need to confirm on the location to save, and whether to use passphrase or not
Then you can copy paste the SSH key to the server you want to connect to
Normally the settings of SSH tied to user account (check under user profile settings > SSH). Not under individual repository
— Another note on creating SSH key —
- == Generating a new SSH key ==
1. Open Git Bash or Command Prompt (Windows) or Terminal (Mac/Linux).
2. Paste the text below, substituting in your GitLab email address.
ssh-keygen -t rsa -b 4096 -C “email@example.com”
This creates a new ssh key, using the provided email as a label.
Generating public/private rsa key pair.
3. When you’re prompted to “Enter a file in which to save the key,” press Enter. This accepts the default file location.
Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter]
4. At the prompt, type a secure passphrase. For more information, see “Working with SSH key passphrases”.
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
== Set SSH Public key in GitLab ==
1. Open gitlab.com and go to Settings.
2. Open SSH Keys tab and add new key:
Key : [Paste SSH Public key (id_rsa.pub) not Private key]
Title : [It should display barracudacampus email after you’ve pasted the key]
3. Click *Add key*
== Use SSH key in SourceTree ==
1. Open SourceTree and click on *Tools > Options > General*
2. Go to SSH Client Configuration and update following field:
SSH Key : [Select id_rsa file generated previously]
SSH Client : OpenSSH
3. Click *OK*