run command in startup ubuntu

  1. Running crontab -e will allow you to edit your cron.
  2. Adding a line like this to it:@reboot /path/to/script will execute that script once your computer boots up.
@reboot /path/to/script

updating controller not reflected in twig file in opencart

Hi there, if you are using any kind of modification which affects the header file you need to refresh modifications first.

Log in to the backend (administration) and go to Extension > Modification and hit the refresh button in the right top corner.

google search with operators

Refine web searches

You can use symbols or words in your search to make your search results more precise.

  • Google Search usually ignores punctuation that isn’t part of a search operator.
  • Don’t put spaces between the symbol or word and your search term. A search for site:nytimes.com will work, but site: nytimes.com won’t.

Refine image searches

Overall Advanced Search

  1. Go to Advanced Image Search.
  2. Use filters like region or file type to narrow your results.
  3. At the bottom, click Advanced Search.

Search for an exact image size

Right after the word you’re looking for, add the text imagesize:widthxheight. Make sure to add the dimensions in pixels.

Example: imagesize:500x400

Common search techniques

Search social media

Put @ in front of a word to search social media. For example: @twitter.

Search for a price

Put $ in front of a number. For example: camera $400.

Search hashtags

Put # in front of a word. For example: #throwbackthursday

Exclude words from your search

Put - in front of a word you want to leave out. For example, jaguar speed -car

Search for an exact match

Put a word or phrase inside quotes. For example, "tallest building".

Search within a range of numbers

Put .. between two numbers. For example, camera $50..$100.

Combine searches

Put “OR” between each search query. For example, marathon OR race.

Search for a specific site

Put “site:” in front of a site or domain. For example, site:youtube.com or site:.gov.

Search for related sites

Put “related:” in front of a web address you already know. For example, related:time.com.

See Google’s cached version of a site

Put “cache:” in front of the site address.

Important: Not all search operators return exhaustive results. 

smileys convert into question mark in CI

After wasting a lot of time with character variables and mysql configurations, I fixed the problem with a simple solution that is base64_encode.
Passing the input string through base64_encode and later using base64_decode to show them worked in this case. However the strings take up more space than earlier but this solution is really simple and worthy.
I just posted this question to know if someone ever faced something similar but people really do not get the main point of the question. That is where the people on SO get really exhausting. Anyways thanks for your help people! 🙂


		$content = base64_encode(nl2br($this->common->nohtml($this->input->post("content"))));
		
<?php echo base64_decode ($r->content) ?>
<?php if($r->site_flag) : ?>
	<?php $sites = $this->feed_model->get_feed_urls($r->ID); ?>
	<?php foreach($sites->result() as $site) : ?>
		<div class="feed-url-spot clearfix">
		<div class="pull-left feed-url-spot-image">
			<?php if($site->image) : ?>
			<img src="<?php echo $site->image ?>" width="100%">
			<?php endif; ?>
		</div>
		<p><a href="<?php echo $site->url ?>"><?php echo $site->title ?></a></p>
		<p><?php echo $site->description ?></p>
	</div>
	<?php endforeach; ?>
<?php endif; ?>
	

the main differences between INNODB and MYISAM

The most commonly used storage engine in MySQL are MyISAM and InnoDB.

With these storage engine there are some advantages and disadvantages according to application needs.

As you all know, the default storage engine chosen by MySQL database is MyISAM.

The main difference between MyISAM and INNODB are :

  • MyISAM does not support transactions by tables while InnoDB supports.
  • There are no possibility of row-level locking, relational integrity in MyISAM but with InnoDB this is possible. MyISAM has table-level locking.
  • InnoDB does not support FULLTEXT index while MyISAM supports.
  • Performance speed of MyISAM table is much higher as compared with tables in InnoDB.
  • InnoDB is better option while you are dealing with larger database because it supports transactions, volume while MyISAM is suitable for small project.
  • As InnoDB supports row-level locking which means inserting and updating is much faster as compared with MyISAM.
  • InnoDB supports ACID (Atomicity, Consistency, Isolation and Durability) property while MyISAM does not support.
  • In InnoDB table,AUTO_INCREMENT field is a part of index.
  • Once table in InnoDB is deleted then it can not re-establish.
  • InnoDB does not save data as table level so while implementation of select count(*) from table will again scan the whole table to calculate the number of rows while MyISAM save data as table level so you can easily read out the saved row number.
  • MyISAM does not support FOREIGN-KEY referential-integrity constraints while InnoDB supports.

MySQL – How to turn off ONLY_FULL_GROUP_BY?

If you run into this error with MySQL:

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'db.table.col' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

It’s likely because you have the ONLY_FULL_GROUP_BY function enabled. To fix this, you have to disable it.

Run this command:

mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Another way to turn it off is that to find and modify the config file my.cnf. Usually it’s in /etc/my.cnf or /etc/mysql/my.cnf.

First, check the sql_mode by running this query:

SELECT @@sql_mode;

The result should be something similar to this:

ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

Copy the sql_mode values, remove ONLY_FULL_GROUP_BY, edit my.cnf and put the rest together in a line under [mysqld] section:

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

Then restart the mysql server.

sudo service mysql restart to restart MySQL

How Do I integrate Opencart with Shiprocket?

Integrating Opencart with ShipRocket

Following are the ways to integrate Opencart with ShipRocket. Before you proceed with these steps, make sure that you have installed the Shiprocket plugin on your Opencart account.

Supported Version :

2.3.*,
2.2.0.0,
2.1.0.1, 2.1.0.2,
2.0.0.0, 2.0.1.0, 2.0.1.1, 2.0.2.0, 2.0.3.1

(Link to Download Extension)

Step I – Configuration at Opencart Extension

  1. Login to your Opencart admin panel.

2. Go to Extensions Tab -> Extension Installer. Upload the extension file downloaded from the link given above.

3. Once the file is successfully uploaded. Go to Extensions Tab -> Modules.

4. Add OpenCart Rest API.

5. Once the API’s are installed, click on the Add New button, enter the title as ShipRocket and click Save

6. Now you will get Public Key & Private Key for Opencart. Copy and save them.

Step II – Configuration at ShipRocket panel

1. Login to ShipRocket panel.

2. Go to Settings->Channels.

3. Click on “Add New Channel” Button.

4. Click on Opencart -> Integrate.

5. Switch “On” the Order and Inventory Sync as per your requirement.

6. Fill in the Parameters i.e Store Url,  public Hash, Private hash (as saved from the OpenCart panel) and Opencart version 

7. Click “Save Channel & Test Connection”.

8. The green icon indicates that the channel has been successfully configured.

php soap client install ubuntu

In case that you have Ubuntu in your machine, the following steps will help you:

  1. Check first in your php testing file if you have soap (client / server)or not by using phpinfo(); and check results in the browser. In case that you have it, it will seems like the following image ( If not go to step 2 ):
  1. Open your terminal and paste: sudo apt-get install php-soap.
  2. Restart your apache2 server in terminal : sudo service apache2 restart.
  3. To check use your php test file again to be seems like mine in step 1.

In Ubuntu/Debian 

$ php -i | grep -i soap   or $ $ apt-cache search php | grep -i soap
$ sudo apt-get install php-soap
$ sudo  service apache2 restart

or in RHEL/Fedora 

$ yum search php | grep -i soap
$ sudo yum install php-soap

godaddy cpanel mx records

Configuring DNS for your cPanel domain

cPanel (both shared and on servers) lets you host a website and email for your domain names. To establish the connection between the domain name and your cPanel account, you need to change the domain name’s DNS (What is DNS?).

  • For shared hosting customers with domains in the same account as their hosting, we configure these for you automatically.
  • For everyone else, you will need to configure this DNS wherever your domain name is registered. If it’s through us, you can use our DNS manager (more info). DNS changes can take up to 48 hours to take effect across the Internet.

 Note: Need DNS help from a GoDaddy Guide? On our Contact Us page, click Chat Now for guidance 24/7.

Mandatory Records

Record TypeHostPoints to
A (Host)@Your account’s IP address (Shared Hosting/Server)
A (Host)mailYour account’s IP address (Shared Hosting/Server)
CNAMEwww@
MX (Mail Exchanger)@mail.[your domain name], for example mail.coolexample.com

NOTE: Use MX Priority 0

Warning: You must delete any other MX (Mail Exchanger) entries in the DNS zone file for your email to work. The MX entry listed above should be the only MX entry.

If you have your cPanel site set up on a subdomain (e.g. cpanel.coolexample.com), replace each instance of “@” with your subdomain and use the domain name including the subdomain in the MX record.

Optional Records

You do not need to add all of these records to your zone file, but doing so will make certain functions work, such as Autodiscovery through Outlook.

Record TypeHostPoints to/Value
A (Host)adminYour account’s IP address (Shared Hosting/Server)
CNAMEautoconfig@
CNAMEautoconfig.admin@
CNAMEautodiscover@
CNAMEautodiscover.admin@
CNAMEcpanel@
CNAMEftp@
CNAMEwebdisk@
CNAMEwebdisk.admin@
CNAMEwebmail@
CNAMEwhm@
CNAMEwww.admin@
TXT@v=spf1 a mx ptr include:secureserver.net -all

NOTE: This record applies only to cPanel shared hosting accounts.
TXTadminv=spf1 a mx ptr include:secureserver.net -all

NOTE: This record applies only to cPanel shared hosting accounts.

 Note: Only use the TXT records listed above if your domain is using cPanel email. If you have these TXT records, and you use another email provider with your domain, you may have problems sending email.

Record TypeServiceProtocolNamePriorityWeightPortTarget
SRV_autodiscover_tcp@00443cpanelemaildiscovery.cpanel.net
SRV_autodiscover_tcpadmin00443cpanelemaildiscovery.cpanel.net

You can also remove the following DNS entries:

CNAME Records
email
imap
pop
smtp

spf record found godaddy

Add an SPF record

An SPF (Sender Policy Framework) record is a type of TXT record in your DNS zone file. SPF records help identify which mail servers are permitted to send email on behalf of your domain. Adding an SPF record can help detect and prevent spammers from sending email messages with forged From addresses on your domain.

  1. Log in to your GoDaddy Domain Control Center. (Need help logging in? Find your username or password.)
  2. Select your domain to access the Domain Settings page.
  3. Under Additional Settings, select Manage DNS.
  4. Select Add under the records table.
  5. Under Type, select TXT.
  6. Enter the details for your SPF record:
    • Host: The domain or subdomain for the SPF record. To put the record on your root domain, enter @ in the Host field.
    • TXT Value: The SPF rule to be applied. For example, enter v=spf1 mx -all to indicate emails are allowed from your mail server and no others. Check out more info about SPF record syntax.
    • TTL: How long the server should cache information. The default setting is 1 hour.
  7. Select Save to save your new SPF record.

Please allow up to 48 hours for your changes to take full effect globally.