How can I create a hyperlink via the command line? - html

I would like to generate a directory of links for some friends who are not technologically savvy. I'm running Ubuntu and would like to do this via the command line.
My attempts so far have been:
touch https:...
which returns:
touch: cannot touch 'https:...': No such file or directory
cat >> https://...
which also returns the No such file or directory exception.
I also tried echo where the link was the filename and the file type was .html, which returned the same exception.
If I drag and drop the link from the address bar into a folder, it creates the hyperlink - however I would like to batch these according to a list of links.
EDIT: This can be done in Python.

I was able to find a question on SO which supplied an alternative using Python.

you could try the following
$ ln -s {source-filename} {symbolic-filename}
source-filename - the target file which you want to create the link
for
symbolic-filename - the name of the symbolic link
Example:
ln -s source_file.txt link_file.txt
You can verify the link creating using the following command
ls -l link_file.txt

Related

How do I specify a path for pyinstaller

I am learning in a tutorial, how to create widgets. The tutorial, however requires you to use pyinstaller to send the program to anyone. The problem I am facing is specifying my path.
Here is a recent attempt on the terminal command:
C:\tkinter.idea>cd pyinstaller.exe --onefile --icon=sun_icon.ico book.py
The system cannot find the path specified.
Comment below if you need further clarification.
The cd command only works for accessing directory files inside your system (folders). As pyinstaller.exe is a program you don't need to pass the cd command, remove this command and just input pyinstaller.exe --onefile --icon=sun_icon.ico book.py in your cmd.

How to install ESP32 support into Arduino IDE?

Here the link to the page that tells me how to give Arduino the capability to create sketches for my ESP board:
https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/windows.md
open a Git Bash session pointing to ARDUINO_SKETCHBOOK_DIR and execute git submodule update --init --recursive
I have identified the ARDUINO_SKETCHBOOK_DIR from the Arduino IDE. So I do have a path that points from the C:\ drive to this directory. What fails is when I do open GIT Bash and change current directory to the one I have defined as being the ARDUINO_SKETCHBOOK_DIR and do enter the command as shown GIT bash complains "No such file or directory". Effectively this directory is still empty.
Just for completeness of my question. I have followed the instruction on the page whose link I gave to this point where I do no know how to get ahead!
You need to change slashes form "\" to "/" and "C:\" to "c/", and put it in double quotes. Like:
cd "/c/Program Files (x86)/Arduino/hardware/espressif/esp32"

PHP Mysql laravel 5.4 terminal issue

i am new to laravel i just figured out how to install composer laravel etc etc on my local machine MAMP on windows , Now i am confuse with the command on terminal which is
C:\project>mysql -uroot -proot
'mysql' is not recognized as an internal or external command,
operable program or batch file.
How can i fix this ?
setting Environment will solve the issue
Go to Control Panel -> System -> Advanced
Click - Environment Variables
Go to- System Variables find PATH and click on it.
add the path to your mysql\bin folder to the end paths. (ex: E:\xampp\mysql\bin) and add ; end of the line
Close all the command prompts you opens.
Re open and try it.
Setting the PATH to point to the MYSQL bin folder is normally the first thought, but I find that dangerous as things get left lying around when you change software.
I normally create a little batch file in the projects folder or in a folder that it already on your PATH, like this
mysqlpath.cmd
echo off
PATH=C:\mamp\path\to\the\mysql\bin;%PATH%
mysql -v
The mysql -v will output the mysql version number but it is a handy way of knowing that the correct folder has been added to the PATH. This adds the folder to the PATH but only for the life of the command window.
Then just run this from any command window when you want to use MYSQL from the command line
> phppath
You may also like to create one for PHP as well
phppath.cmd
echo off
PATH=C:\mamp\path\to\the\php\;%PATH%
php -v

Wget -i gives no output or results

I'm learning data analysis in Zeppelin, I'm a mechanical engineer so this is outside my expertise.
I am trying to download two csv files using a file that contains the urls, test2.txt. When I run it I get no output, but no error message either. I've included a link to a screenshot showing my code and the results.
When I go into Ambari Sandbox I cannot find any files created. I'm assuming the directory the file is in is where the csv files will be downloaded too. I've tried using -P as well with no luck. I've checked in man wget but it did not help.
So I have several questions:
How do I show the output from running wget?
Where is the default directory that wget stores files?
Do I need additional data in the file other than just the URLs?
Screenshot: Code and Output for %sh
Thanks for any and all help.
%sh
wget -i /tmp/test2.txt
%sh
# list the current working directory
pwd # output: home/zeppelin
# make a new folder, created in "tmp" because it is temporary
mkdir -p /home/zeppelin/tmp/Folder_Name
# change directory to new folder
cd /home/zeppelin/tmp/Folder_Name
# transfer the file from the sandbox to the current working directory
hadoop fs -get /tmp/test2.txt /home/zeppelin/tmp/Folder_Name/
# download the URL
wget -i test2.txt

Basic MySQL PATH question

In the Terminal prompt, I have to type in $ PATH=/usr/local/mysql/bin:$PATH to run MySQL commands.
Where do I need to save this path in the MySQL files, such that I don't need to type in this path every time I enter into the terminal path. What file, and where should I type this in?
Thank you.
Where can I find the .bashrc file? when I do a cd ~, then ls -a, it does not show up (although I do see a .bash_history.)
You don't have to save $PATH in mysql, you need to save it in your .profile or .bashrc (substitute for your own shell if not Bash) files, found in your home directory.
You have files like these without the dot in frontne in /etc, but they're the system wide ones (they are the default to all users). You should have a file .bashrc or .profile (or you could create them if they don't exist) in your /home/David542 directory (with your own username, of course).
Caveat: depending on your system, you could be using a shell different from bash, so you'd have to create a different dot file (.kshrc, .cshrc, .shrc, etc).
.bashrc in your home directory