Mysql find all tables with column names which contain specific word

Sometimes it can be important to find all tables with column names which contain specific word. We can do that with next query:

SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE column_name LIKE '%word%';
sources of information
source visit date
how-to-find-all-the-tables-in-mysql-with-specific-column-names-in-them 2015.06.12

How to find duplicate lines in a files and count how many time each line was duplicated

Sometimes we need to find duplicate lines in a files and count how many time each line was duplicated. We can do that next way:

find . -type f | xargs fgrep "Notice" | uniq -c | sort -nr

. for find means that search will be in current directory.
-type f for find means, we take into account only files.
-с for uniq means prefix lines by the number of occurrences.
-n for sort means compare according to string numerical value.
-r for sort means reverse the result of comparisons.
Another way to get same result:

fgrep -R "Notice" | uniq -c | sort -nr

-R for fgrep means read all files under each directory, recursively.

sources of information
source visit date
find-duplicate-lines-in-a-file-and-count-how-many-time-each-line-was-duplicated 2015.02.23

Putty – export sessions data from Registry

Sometimes you can forgot, that Putty store sessions data not in configuration file, but in MS Windows Registry. So, to keep your sessions after OS reinstall or if you want move sessions data to another PC, we need move that data. How it can be done?

Open MS Windows Registry:
regedit
found branch:
HKEY_CURRENT_USER\Software\Simontatham

putty export sessions data from regedit
putty export sessions data from regedit

Click right mouse button and select export.
After this, on other PC run exported reg file and sessions data will be added to Registry.

sources of information
source visit date
How to Transfer PuTTY Sessions To Another Windows Machine 2012.09.05

ls how to show folders first

For a long time with Linux and Windows i gathered enough notes, which, perhaps, might be usefull for some people.

There are times when we need that ls show folders first, then files. Let’s see how it can be done.

ls -1 --color -h --group-directories-first

‐1 – list one file per line
‐‐color – colorize the output
‐‐group‐directories‐first – group directories before files

 

sources of information
source visit date
unix-ls-how-to-sort-first-directories-then-files-etc 2015.08.11