Update a bunch of images at once and export them as separate images using GIMP

Scaling of images can be achieved without using any scripts/extensions, but to export all images as separate image files, we need to install a plugin in GIMP named ‘Export Layers’.

You can download this plugin from the following link,

https://khalim19.github.io/gimp-plugin-export-layers/

This plugin is available for Windows, Linux, and macOS. For Windows, it can be installed using an executable file.

After installation of this plugin, restart GIMP.

Now, that we have the plugin installed, there is a very simple way to accomplish this task using the following easy steps.

  1. File > Open as layers to select all images to perform a specific task (This is one single action since the file selector allows the selection of multiple images)
  2. Image > Scale image to 75×75 to scale all layers together (We can perform many different actions similar to scaling like transforming, resizing, cropping, etc.)
  3. File > Export Layers will open a dialog that appears allows you to choose the output folder and file extension.
Export Layers Dialog Box

The above steps will save all your image layers to separate files. This could reduce so many steps of similar tasks.

You can perform many different actions like transforming, cropping, resizing, etc. using same steps.

Setup and use a virtual python environment in Ubuntu

With virtualenvwrapper (user-friendly wrappers for the functionality of virtualenv)

Install virtualenv

Install virtualenv with

sudo apt-get install virtualenv

(for Ubuntu 14.04 (trusty) install python-virtualenv)

Install virtualenvwrapper

The reason we are also installing virtualenvwrapper is that it offers nice and simple commands to manage your virtual environments. There are two ways to install virtualenvwrapper:

As Ubuntu package (from Ubuntu 16.04)

Run sudo apt install virtualenvwrapper then run echo "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh" >> ~/.bashrc

Using pip

  1. Install and/or update pip

    Install pip for Python 2 with
    sudo apt-get install python-pip

    or for Python 3
    sudo apt-get install python3-pip

    (if you use Python 3, you may need to use pip3 instead of pip in the rest of this guide).

    Optional (but recommended): 
    Turn on bash autocomplete for pip Run
    pip completion --bash >> ~/.bashrc

    and run 

    source ~/.bashrc 

    to enable.
  2. Install virtualenvwrapper Because we want to avoid sudo pip we install virtualenvwrapper locally (by default under ~/.local) with:
    pip install --user virtualenvwrapper

    and

    echo "export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3" >> ~/.bashrc
  3. Source virtualenvwrapper in .bashrc

    echo "source ~/.local/bin/virtualenvwrapper.sh" >> ~/.bashrc

Setup virtualenv and virtualenvwrapper:

First, we export the WORKON_HOME variable which contains the directory in which our virtual environments are to be stored. Let’s make this ~/.virtualenvs

export WORKON_HOME=~/.virtualenvs

now also create this directory

mkdir $WORKON_HOME

and put this export in our ~/.bashrc file so this variable gets automatically defined

echo "export WORKON_HOME=$WORKON_HOME" >> ~/.bashrc

We can also add some extra tricks like the following, which makes sure that if pip creates an extra virtual environment, it is also placed in our WORKON_HOME directory:

echo "export PIP_VIRTUALENV_BASE=$WORKON_HOME" >> ~/.bashrc

Source ~/.bashrc to load the changes

source ~/.bashrc

Test if it works

Now we create our first virtual environment. The -p argument is optional, it is used to set the Python version to use; it can also be python3 for example.

mkvirtualenv -p python2.7 test

You will see that the environment will be set up, and your prompt now includes the name of your active environment in parentheses. Also if you now run

python -c "import sys; print sys.path"

you should see a lot of /home/user/.virtualenv/... because it now doesn’t use your system site packages.

You can deactivate your environment by running

deactivate

and if you want to work on it again, simply type

workon test

Finally, if you want to delete your environment, type

rmvirtualenv test

Enjoy!

Internet Banking – The Pros And Cons

Over the last decade, millions of people in India have adopted online banking as their preferred method of conducting financial transactions. This way of banking has become quite popular because to the convenience with which one can monitor their account, make payments online, and transfer money between accounts. This is especially true for Indians who are always pressed for time to physically visit the bank.

Online banking also has several non-transactional functions that are very useful. Despite its convenience, however, this way of banking has a few drawbacks. These must be understood to secure your funds and avoid issues in the future.

Key Benefits of Internet Banking

Customers who choose internet banking over traditional branch office visits are eligible for different benefits.

Services

Technology has made it extremely simple for both the bank and the customer to access many services online. Financial planning capabilities, functional budgeting and forecasting tools, loan calculators, investment analysis tools, and equity trading platforms are among the services provided. These are available on the bank’s website as simple applications. Furthermore, most banks offer online tax forms and tax preparation services.

Convenience

Convinience is the most promising advantage that outweighs any shortcomings of internet banking. Making transactions and payments at the click of a button from the comfort of your own home or office is a convenience that no one wants to give up. Keeping track of your accounts via the internet is becoming faster and more convenient than going to the bank. Even non-transactional services, such as ordering cheque-books online, updating accounts, enquiring about interest rates on various financial products, and so on, are much easier to access via the internet.

Mobility 

In recent years, internet banking has taken a stride forward with the evolution of mobile internet banking. Internet banking provides the consumer with unrestricted mobility, allowing you to conduct financial transactions even when on the move.

Another significant advantage of internet banking is that it is environmentally friendly. It saves paper and reduces pollution by eliminating the need for individuals to travel physically and emitting no emissions.

Better Rates

Banks stand to benefit from the adoption of internet banking because it requires less physical effort on their part. The requirement to expand office space and hire more employees to deal with clients is reduced drastically. The banks benefit financially as a result of this. Also, a part of the savings can be passed on to consumers by higher deposit rates and lower lending rates. To encourage internet banking, most banks provide no-deposit or low-deposit accounts. They also have reduced penalties for taking money out of Fixed Deposits early.

Drawbacks of Internet Banking

However, the current trend of exclusively using the online mode has a few pitfalls. This may prove costly in the long run unless guarded against from the beginning.

Security

Security is the most serious flaw in the internet banking method, and you must avoid it at all costs. Even though your account is protected by a variety of sophisticated encryption technologies, there is always the risk of hacking by criminal forces in the cyber world.

On the internet, hacker attacks, phishing, malware, and other forms of unauthorized behaviour are all too frequent. If you only use the internet for banking, identity theft is another major risk. To combat identity theft, most banks have made it essential to post scanned copies of approved checks online. When creating an account and before using online banking services, you should review the bank’s security rules and precautions.

Online banking is a significant move in the right direction as far as the convenience of the customer as well as the banker is concerned. But it must be applied with adequate precaution to avoid falling prey to unscrupulous elements scouring the internet.

Relationships

Online transactions take a toll on the relationship with the banker which the traditional visit to the branch office used to foster. Personal relationships with the staff at the banks come in handy when requesting faster loan approvals or a special service which may no longer be available to the public. The manager has many discretionary powers. These include waiving penal interest or service fees. Additionally, personal contact also meant that the banker would provide essential financial advice and insights which are beneficial to the customer.

Complex Transactions

There are many complex transactions which cannot be sorted out unless there is a face to face discussion with the manager. This is not possible through internet banking. Solving specific issues and complaints requires a physical visit to the bank and cannot be achieved through the internet. Online communication is neither clear nor specific enough to help resolve many complex service issues. Certain services such as notarisation and bank signature guarantees cannot be accomplished online.

How to get the last executed query in PHP CodeIgniter?

Are you wanted to get the last executed SQL query in the CodeIgniter project? then, I will help to get the latest query in CodeIgniter

We can get the last executed query using the last_query() function of the inbuilt db class of the CodeIgniter. This function can be used with simple syntax like $this->db->last_query() to see SQL statements of last executed query in PHP CodeIgniter app. You have to simple code that functions after the main query that you wanted to check.

Here is a simple function code which can be added in any controller of the CodeIgniter project and also output for the last query:

Example:

public function check_query_function() {

    $sql = $this->db->get("products");
  
    $query = $this->db->last_query();
   
    echo "<pre>";
    print_r($query);
    exit;
}

Output:

SELECT * FROM `products`