Bash commands you can never live without!

This is more of a generic post. I am posting some of the Bash/Linux/Windows commands i find useful everyday!

Source Control :Git

When you want to push your local project to GitHub, create a repository (Don’t add a Readme file yet) on GitHub.

On your local workstation, fire the bash utility in the root folder of your project on your windows file system.

On the Git Bash, run:

git init
git remote add origin https:// (link to your online repository)
git remote -v (Just to confirm your remote repo)
echo 'node_modules'>>.gitignore (Files you want to ignore to pushing to GitHub)
git add .
git commit -m "First commit"
git push origin master

A times you may have commit issues due to file conflicts:

Open the conflicting file -edit and merge the head accordingly. Then;

git add filename
git commit -m "merged file A and B"git push origin master

Other commands:

Ngrok: (helps you expose your localhost to public internet)

http localhost:<port>  (Windows, where port is your port number)

./ngrok http <port> (Linux, where port is your port number)

In Oracle compute, you might want to run a “screen” command to run the ngrok  on detached mode:

screen-S <name of the new screen> This opens a new Screen.

Deploy ngrok on this screen. When done press Ctrl +A+ D to exit.

To confirm the the screen got created:

screen -ls  (shows you all the screens and their ids named "Detached")

To re-access the screen:

screen -r <screen_ID>

To quit:

screen -X -S <screen_id> quit

What other commands do you use daily… but you keep forgetting?

Happy coding! Keep Innovating!

 

 

 

Author: Labanish

I am a Senior Cloud Solutions Architect at Oracle. Am interested in Cloud Automation, Cloud Native Applications dev and Emerging Tech. I have over 6 years work experience handling different tech roles in East Africa, Romania & now in United Kingdom. All views are mine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: