How do I make a python script executable?

Add a shebang line to the top of the script:#!/usr/bin/env python Mark the script as executable:chmod +x myscript.py Add the dir containing it to your PATH variable. (If you want it to stick, you’ll have to do this in .bashrc or .bash_profile in your home dir.)export PATH=/path/to/script:$PATH

Recursively find all files that match a certain pattern

With gnu find you can use regex, which (unlike -name) match the entire path: To just count the number of files: (The %i format code causes find to print the inode number instead of the filename; unlike the filename, the inode number is guaranteed to not have characters like a newline, so counting is more reliable. Thanks to @tripleee for … Read more

Mysql: Setup the format of DATETIME to ‘DD-MM-YYYY HH:MM:SS’ when creating a table

“MySQL retrieves and displays DATETIME values in ‘YYYY-MM-DD HH:MM:SS’ format.” This is from mysql site. You can store only this type, but you can use one of the many time format functions to change it, when you need to display it. Mysql Time and Date functions For example, one of those functions is the DATE_FORMAT, which … Read more

How to run SQL script in MySQL?

I want to execute a text file containing SQL queries, in MySQL. I tried to run source /Desktop/test.sql and received the error: mysql> . \home\sivakumar\Desktop\test.sql ERROR: Failed to open file ‘\home\sivakumar\Desktop\test.sql’, error: 2 Any idea on what I am doing wrong?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)