Posts

Showing posts from November, 2018

Bash comands: Udacity intro to shell commands

I am using the command line daily now as a dev. Before starting as a dev I was a fulltime Windows user, because games, that's why. Since april I've been using MacOs and the terminal daily. Though I don't feel as expressive in the terminal as I feel in my IDE. So it's time to become more proficient. Deliberate practice! I found a basic course at Udemy to strengthen some fundamentals: https://classroom.udacity.com/courses/ud595/ [Lesson 1] Terminal emulator: nothing more than a data entry point BashShell: interpreter of terminal commands BashShell is a command line interface, like the python or ruby interpreter or js console date > prints date and time expr 2 + 2 > evaluates the expression 2 + 2 echo You rock > prints you rock uname > prints the unix flavour, for me "Darwin" hostname > prints hostname of current machine host cd udacity.com > prints info on the host bash --version > shows bash version history > shows b...

Command line basics

https://www.youtube.com/watch?v=5XgBd6rjuDQ base command~$ [program] [option] [argument] pwd > where am I? ls > list ls -l > list in long format press Tab > autocomplete clear > clear screen mkdir > make directory rmdir > remove direcory cd [directoryname] > enter directory cd ../ >go a directory back touch index.html > make the file rm index.html > remove the file nano index.html > open nano and create index.html ssh targetserver > get into a server scp /from/this/path/file0.zip /to/another/path/file0.zip > secure copy of target to destination

Terminal colors Mac and some handy add ons

In your bash profile (file ~/.bash_profile) paste the code below for colors and colors for list views. export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " export CLICOLOR=1 export LSCOLORS=ExFxBxDxCxegedabagacad export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 alias ls='ls -GFh' I should take a look at: https://natelandau.com/my-mac-osx-bash_profile/

MySQL trouble creating a new user

I had some problems with getting mysql and creating a new user. I expected to be prompted to enter credentials on installing mysql-server on the cli. First started mysql: sudo service mysql start Then wanted to get into the mysql shell sudo mysql -u $username -p For the first time $username = root and password is system root password. There was not password column in mysql.user table shown by: desc mysql.user So to check the present users I could not use: SELECT user, host, password FROM mysql.user To view the present users I had to use: SELECT user, host FROM mysql.user  From this piont on I could follow the below link to create a new user. https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql P.S. Appartently from mysql 5.7 onward the password field is replaced by authentication_field using the md5 encryption this encryption gives a false sense of security since it already has been cracked and can be decryp...