Monday, September 14, 2020

linux bulk prefix filenames

 



In order to bulk add prefix to filenames  in a directory run the following comnmand


for f in * ; do mv -- "$f" "2018-05-24_$f" ; done




*solution taken from: https://stackoverflow.com/a/4787428 

Wednesday, December 11, 2019

Installing nodejs 13 on linux mint



Installing nodejs 13 on linux mint

by default the  sudo apt-get install -y nodejs will install v8.10.0
in order to install version 13 you need to add the v13 repository to the update manager


In the terminal type:
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -

then run:
sudo apt-get install -y nodejs



That's it,



Tuesday, November 26, 2019

sql joins



Inner join:

SELECT users.name, phones.phone FROM `phones` INNER JOIN users ON users.ID = phones.userID




Left join:

SELECT users.name, phones.phone FROM `users` LEFT JOIN `phones` ON users.ID = phones.userID



Right join:

SELECT users.name, phones.phone FROM users RIGHT JOIN phones ON users.ID = phones.userID


Tuesday, September 3, 2019

Creating local virtual directory




#Create soft link:
ln -s /path/to/real/folder /path/to/symbolic/link

# Example:
ln -s /path/to/real/folder /var/www/html/symbolic_link
------------------------------------------------------------------------------------------------

#add virtual domain to yor local machine (hosts file)

sudo nano /etc/hosts
------------------------------------------------------------------------------------------------
# add to follow line and save the file:

127.0.0.1 the-domain-that-you-want-to-add.com

------------------------------------------------------------------------------------------------
#configure your apache to work with the new configured domain in the hosts file

sudo nano /etc/apache2/sites-available/000-default.conf
------------------------------------------------------------------------------------------------
#add the following configuration
<VirtualHost *:80>

    ServerAdmin your@email.com

    ServerName the-domain-that-you-want-to-add.com

    ServerAlias www.the-domain-that-you-want-to-add.com

    DocumentRoot /var/www/html/symbolic_link

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

                <Directory /var/www/html/symbolic_link>

                                Options Indexes FollowSymLinks MultiViews

                                AllowOverride All

                                Order allow,deny

                                allow from all

                </Directory>

</VirtualHost>

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

that's it
Now open your browser and navigate to http://the-domain-that-you-want-to-add.com

Saturday, July 8, 2017

JS Inheritance OOP


See the Pen JS Inheritance OOP by Ariel Barkan (@ArielBarkan) on CodePen.

Creating Array of Objects + search


linux bulk prefix filenames

  In order to bulk add prefix to filenames  in a directory run the following comnmand for f in * ; do mv -- "$f" "2018-05-24_...