Skip to content

Instantly share code, notes, and snippets.

View blackzphoenix's full-sized avatar
🎯
Focusing

Black ZPhoenix blackzphoenix

🎯
Focusing
View GitHub Profile
@blackzphoenix
blackzphoenix / if_shell.sh
Created March 27, 2019 17:29
If execution of code
if condition if test var == value if test -f /file/exists
then then then
command1 command1 command1
command2 command2 command2
... ... ...
commandN commandN commandN
fi fi fi
╔══════════════╦═════════════════════════════════════════════════╦═════════════════════════╗
║ System ║ Meaning ║ Variable Value Type ║
║ Variable ║ ║ ║
╠══════════════╬═════════════════════════════════════════════════╬═════════════════════════╣
║ BASH_VERSION ║ Holds the version of this instance of bash. ║ echo $BASH_VERSION ║
║ HOSTNAME ║ The name of the your computer. ║ echo $HOSTNAME ║
║ HOME ║ The home directory of the current u ║ echo $HOSTNAME ║
║ HISTSIZE ║ The number of commands to remember in the ║ echo $HISTSIZE ║
║ ║ command history.Default value is 500. ║ ║
║ HISTFILESIZE ║ The maximum lines contained in the history file.║ echo $HISTFILESIZE ║
@blackzphoenix
blackzphoenix / commenting.sh
Created March 26, 2019 16:48
how to comment
#!/bin/bash
#This is an Example of Single line Comment!
echo "Welcome !!"
#!/bin/bash
echo "Welcome!!"
<<COMMENT
Multiple line Comment : Usage
Commenting two or more lines of a script
@blackzphoenix
blackzphoenix / System.sh
Last active March 26, 2019 16:47
Gives the description of our System
#!/bin/bash -x
echo "Hello ${LOGNAME}"
echo "Today is $(date)"
echo "Users currently on the machine, and their processes:"
@blackzphoenix
blackzphoenix / Shell Scripting.txt
Last active March 26, 2019 15:39
Table of Contents.
Introduction to Shell Scripting
Variables and environment
Decision making
Loops (bash Loops)
Pipes and traps
Functions
Extra concepts
@blackzphoenix
blackzphoenix / gnu-linux_blog.md
Last active March 26, 2019 15:54
Introduction to GNU/linux and terminal commands

The World Around GNU/Linux

by MS1029

What is GNU/Linux?

It is an Operating System that manages a computer. It is entirely free and large number of developers spread over the world who always contribute for its development and existence till date. GNU/Linux is the core component and have different products which are distributions(distros) that vary with

from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World'
if __name__ == "__main__":
app.run
@blackzphoenix
blackzphoenix / BeautifulSoup.py
Last active August 6, 2018 18:44
Have explained how to start and how to request to scrape data from a website and print those in different ways
import requests
import bs4
# We create request variable in which we store the content fetched from the website
request = requests.get("https://en.wikipedia.org/wiki/Deep_learning")
# In order to know what type the request
type(request)
# This below line of code gives us the complete data requested from the website
@blackzphoenix
blackzphoenix / data.py
Created July 12, 2018 10:44
The database of the Blogs
def Blog():
Blog = [
{
'id' : KB1,
'title' : 'Blog 1',
'body' : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
'author' : 'Kartic Rao',
'create date' : '10-07-2018'
'likes' : ""
},
@blackzphoenix
blackzphoenix / blog.html
Created July 12, 2018 10:42
The id part of the WebApp
{% extends 'layout.html' %}
{% block body %}
<h1>{{id}}</h1>
{% endblock%}