https://www.cyberciti.biz/faq/unix-linux-get-the-contents-of-a-webpage-in-a-terminal/

page="$(wget -O - http://www.cyberciti.biz)"
## display page ##
echo "$page"
## or pass it to lynx / w3m ##
echo "$page" | w3m -dump -T text/html
echo "$page" | lynx -dump -stdin

------

list a programs dependencies

jack@jack-desktop:~/robomongo-1.0.0-linux-x86_64-89f24ea/bin$ ldd ./robomongo
	linux-vdso.so.1 =>  (0x00007ffe043b2000)
	libQt5Network.so.5 => /home/jack/robomongo-1.0.0-linux-x86_64-89f24ea/bin/./../lib/libQt5Network.so.5 (0x00007f3376928000)
	libQt5Widgets.so.5 => /home/jack/robomongo-1.0.0-linux-x86_64-89f24ea/bin/./../lib/libQt5Widgets.so.5 (0x00007f33760d8000)
	libQt5Gui.so.5 => /home/jack/robomongo-1.0.0-linux-x86_64-89f24ea/bin/./../lib/libQt5Gui.so.5 (0x00007f3375930000)
	libQt5Core.so.5 => /home/jack/robomongo-1.0.0-linux-x86_64-89f24ea/bin/./../lib/libQt5Core.so.5 (0x00007f3375215000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3374fd8000)
	libssl.so.1.0.0 => /home/jack/robomongo-1.0.0-linux-x86_64-89f24ea/bin/./../lib/libssl.so.1.0.0 (0x00007f3374d69000)
	libcrypto.so.1.0.0 => /home/jack/robomongo-1.0.0-linux-x86_64-89f24ea/bin/./../lib/libcrypto.so.1.0.0 (0x00007f3374985000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f33745fa000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f33742f1000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f33740da000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3373ebc000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3373af3000)

You can display the octal permissions for a file using the stat command:

stat -c %a [filename]

EXAMPLE:
~/vcn$ stat -c %a ~/.ssh/id_rsa.pub
777


Or by using find:

find [path] -printf '%m %p\n'

Example:
root@NS2:/var/www/example.com/public_html/papers# find . -printf '%m %p\n'
755 .
777 ./comment-file-reader-only.php
777 ./comment-file-nav.php
777 ./comment-file-background.jpg
777 ./comment-read-only-nav.php
777 ./admin-login.php
755 ./includes
644 ./includes/loginphp5.php
644 ./includes/comment-file-reader-only.php
644 ./includes/comment-file-nav.php
644 ./includes/comment-file-background.jpg







Desktop Noticication

notify-send 'Hello world!' 'This is an example notification.' --icon=dialog-information

This will place an icon on your desktop. I use them as Desktop reminders. just enter notify-send -h for help as to how to use it.

caffe stuff

hecking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/protobuf-3.2.0':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
root@413042c78bf0:/protobuf-3.2.0# sudo apt get install gcc
bash: sudo: command not found
root@413042c78bf0:/protobuf-3.2.0# apt-get install gcc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gcc is already the newest version (4:5.3.1-1ubuntu1).
gcc set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
root@413042c78bf0:/protobuf-3.2.0# apt-get install g++
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  g++-5 libstdc++-5-dev
Suggested packages:
  g++-multilib g++-5-multilib gcc-5-doc libstdc++6-5-dbg libstdc++-5-doc
The following NEW packages will be installed:
  g++ g++-5 libstdc++-5-dev
0 upgraded, 3 newly installed, 0 to remove and 10 not upgraded.
Need to get 9727 kB of archives.
After this operation, 39.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libstdc++-5-dev amd64 5.4.0-6ubuntu1~16.04.4 [1426 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 g++-5 amd64 5.4.0-6ubuntu1~16.04.4 [8300 kB]    
Get:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 g++ amd64 4:5.3.1-1ubuntu1 [1504 B]                     
Fetched 9727 kB in 40s (238 kB/s)                                                                                
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libstdc++-5-dev:amd64.
(Reading database ... 11993 files and directories currently installed.)
Preparing to unpack .../libstdc++-5-dev_5.4.0-6ubuntu1~16.04.4_amd64.deb ...
Unpacking libstdc++-5-dev:amd64 (5.4.0-6ubuntu1~16.04.4) ...
Selecting previously unselected package g++-5.
Preparing to unpack .../g++-5_5.4.0-6ubuntu1~16.04.4_amd64.deb ...
Unpacking g++-5 (5.4.0-6ubuntu1~16.04.4) ...
Selecting previously unselected package g++.
Preparing to unpack .../g++_4%3a5.3.1-1ubuntu1_amd64.deb ...
Unpacking g++ (4:5.3.1-1ubuntu1) ...
Setting up libstdc++-5-dev:amd64 (5.4.0-6ubuntu1~16.04.4) ...
Setting up g++-5 (5.4.0-6ubuntu1~16.04.4) ...
Setting up g++ (4:5.3.1-1ubuntu1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
root@413042c78bf0:/protobuf-3.2.0# 
Caffe stuff














Looks to me like Make links python/caffe/_caffe.so to build/lib/libcaffe.so correctly:

$ ldd python/caffe/_caffe.so  | grep caf
    libcaffe.so.1.0.0-rc3 => /home/lyeager/caffe/caffe/python/caffe/../../build/lib/libcaffe.so.1.0.0-rc3 (0x00007fa439e55000)








ldd python/caffe/_caffe.so  | grep caf
    libcaffe.so.1.0.0-rc3 => /home/lyeager/caffe/caffe/python/caffe/../../build/lib/libcaffe.so.1.0.0-rc3 (0x00007fa439e55000)

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libstdc++.so.6
./matlab










Sym Links:

libstdc++.so.6

ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/

/home/jack/anaconda2/envs/py27/lib/

ln -s  



How do you view file permissions?
 $ ls -l /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
response:
-rw-r--r-- 1 root root 1590744 Sep  5  2016 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
 Change Permissions:

To change A file or directory:
 $ chmod 755 /opt/lampp/htdocs 
 --
 To change ALLthe directories to 755 (drwxr-xr-x):

$ find /opt/lampp/htdocs -type d -exec chmod 755 {} \;

To change ALL the files to 644 (-rw-r--r--):

$ find /opt/lampp/htdocs -type f -exec chmod 644 {} \;





to inspect versions in file:

strings /home/jack/anaconda2/lib/libstdc++.so.6 | grep GLIBCXX 
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBXX

Example - libstdc++.so.6:
jack@jack-desktop:~/Desktop/Ubuntu16.04/notebooks$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_DEBUG_MESSAGE_LENGTH




remove extensions:

for file in *.old; do
    mv -- "$file" "${file%%.old}"
done

----------------
jack@jack-desktop:~/git/caffe$ locate opencv.pc/home/jack/anaconda2/pkgs/opencv-3.1.0-np112py27_1/lib/pkgconfig/opencv.pc

/home/jack/anaconda2/pkgs/qt-5.6.2-3/lib/pkgconfig/

ln -s /home/jack/anaconda2/pkgs/opencv-3.1.0-np112py27_1/lib/pkgconfig/opencv.pc /usr/lib/pkgconfig

See man ln. To create symlink /usr/bin/bar --> /opt/foo, (i.e., create symlink at /usr/bin/bar which references to file /opt/foo) do:

ln -s /opt/foo /usr/bin/bar

You would need to apply the above command as root (with sudo).

------------



As you noticed, you can define some log functions like log, log_debug, log_error, etc.

function log () {
    if [[ $_V -eq 1 ]]; then
        echo "$@"
    fi
}

It can help increasing your main code readability and hide show\nonshow logic into logging function.
-----------------------
To get verbose response to running a script:

set -x or set -o xtrace expands variables and prints a little + sign before the line.

set -v or set -o verbose does not expand the variables before printing.

Use set +x and set +v to turn off the above settings.

On the first line of the script, one can put 
----------- file heading
#!/bin/sh -x 



to have the same effect as set -x later in the script.





name=somefile
if [[ -e $name.ext ]] ; then
    i=0
    while [[ -e $name-$i.ext ]] ; do
        let i++
    done
    name=$name-$i
fi
touch "$name".ext

Using yam : Example

#!/bin/bash
#Create Gui Buttons and assign vals for var
while true
do
  #everything goes here


    val=$(yad --center --width=300 --height=100 --title "GNUsual" --image "/mnt/foo.png" --text="Choose a Multicast to view:" \
    --button="Eclipse":1 \
    --button="DeepDream":2 \
    --button="NED":3 \
    --button="PASSWORDS":4 ) \

    ret=$?
    #responses to above button presses are below
    if [[ $ret -eq 1 ]]; then
    eclipse
    #Insert troubleshooting gui-utility commands here
    fi

    if [[ $ret -eq 2 ]]; then
    docker run -d -p 443:8888 -e "PASSWORD=password" -v $(pwd)/Ubuntu16.04/deep-dream-generator:/src ryankennedyio/deepdream
    #Insert troubleshooting gui-utility commands here
    fi

    if [[ $ret -eq 3 ]]; then
    ined
    #Insert troubleshooting gui-utility commands here
    fi

    if [[ $ret -eq 4 ]]; then
    pw
    #Insert troubleshooting gui-utility commands here
    fi

done