margaret mason

margaret mason


Hire The Best Back End Developers

Each advanced site requires a capable backend engineer to guarantee everything in the background is of the best expectations.

A #backend  engineer is one of the most basic jobs in your improvement group. This individual will be liable for making and keeping up with your site's server.

A Back-end designer is liable for the usefulness that is undetectable to the clients.

#back end developer should get their discipline and your organization's customizing dialects and programming.

The fundamental explanation that organizations need a back-end engineer is to guarantee that their site or applications work flawlessly consistently.

Assuming that you really want to enlist backend designers, have practical experience in a specific innovation or are searching for full-stack developers, Data EximIT will love to be your enrollment accomplice abroad.

Hire Dedicates Backend Developers from us with adaptable commitment models.

Our specialists have delayed insight recorded as hard copy precise, confounded, and quality codes for immaculate relocation to any backend innovation at the best aggressive rates.

Our Back end #developers have broad innovative ability in growing great stages and backends for both; web and versatile applications.

Our profoundly experienced Backend developers convenient convey portability arrangements fitting your particular venture necessities.

Our engineers are capable, savvy, and deft, and they can address your issues, based on your conditions.

Contact us, If you are seeking to recruit backend developers for backend improvement with most recent advancements and dialects.

Hire The Best Back End Developers
Nat  Grady

Nat Grady


Mkdocs-with-pdf: Generate A Single PDF File From MkDocs Repository

PDF Generate Plugin for MkDocs

This plugin will generate a single PDF file from your MkDocs repository. This plugin is inspired by MkDocs PDF Export Plugin.


  • Cover and Table of Contents integrated in the PDF
  • Automatically numbers on heading(h1-h3).
  • Shift down sub-page headings level.
  • using WeasyPrint.



  1. This package requires MkDocs version 1.0 or higher (0.17 works as well)
  2. Python 3.6 or higher
  3. WeasyPrint depends on cairo, Pango and GDK-PixBuf which need to be installed separately. Please follow the installation instructions for your platform carefully:

How to use


Install the package with pip:

pip install mkdocs-with-pdf

Enable the plugin in your mkdocs.yml:

    - with-pdf

More information about plugins in the MkDocs documentation.


When building your repository with mkdocs build, you should now see the following message at the end of your build output:

Converting 10 articles to PDF took 7.1s


You may customize the plugin by passing options in mkdocs.yml:

    - with-pdf:
        #author: WHO
        #copyright: ANY TEXT
        #cover: false
        #back_cover: true
        #cover_title: TITLE TEXT
        #cover_subtitle: SUBTITLE TEXT
        #custom_template_path: TEMPLATES PATH
        #toc_title: TOC TITLE TEXT
        #heading_shift: false
        #toc_level: 3
        #ordered_chapter_level: 2
        #    - 'release-notes/:upgrading'
        #    - 'release-notes/:changelog'
        #    - 'bugs/'
        #    - 'appendix/contribute/'
        #    - src: IFRAME SRC
        #      img: POSTER IMAGE URL
        #      text: ALTERNATE TEXT
        #    - src: ...
        #two_columns_level: 3
        #render_js: true
        #headless_chrome_path: headless-chromium
        #output_path: any-place/document.pdf
        #enabled_if_env: ENABLE_PDF_EXPORT
        #debug_html: true
        #show_anchors: true
        #verbose: true


for Properties


Set the author text.
default: use site_author in your project mkdocs.yml


Set the author text.
default: use copyright in your project mkdocs.yml

author and copyright values are drawn in Cover, and you can use '@page' content.

@page {  @bottom-left {    content: string(author) !important;  }  @bottom-right {    content: string(copyright) !important;  } }

for Cover


Set the value to false if you don't need a cover page.
default: true


Set the value to true if you need a back cover page.
default: false
since: v0.8.0

You would be better to install the qrcode package:

pip install qrcode


Set the title text in cover page.
default: use site_name in your project mkdocs.yml


Set the subtitle text in cover page.
default: None


Set the logo image in cover page. This value is URL or simply specify the relative path to the docs directory.
default: None
since: v0.8.0

for Heading and TOC


Set the title text of Table of Content.
default: Table of Content
since: v0.4.0


Set this value to false, disable shift heading in child page.
default: true

In this flags enable, heading move down one level in child page.


Set the level of Table of Content. This value is enabled in the range of from 1 to 3.
default: 3


Set the level of heading number addition. This value is enabled in the range of from 1 to 3.
default: 3


Set the page id of nav url. If the id matches in this list, it will be excluded from the heading number addition and table of contents.
default: []

for Page


Set the page id of nav url. If the id matches in this list, it will be excluded page contents.
default: []
since: v0.3.0


List of iframe to a conversions. Every iframe that matches a src in this list will be replace to a contains each img and/or text. it's using for such as embedded VIDEO.
default: []
since: v0.6.0

@see Sample of MkDocs Material

two_columns_level (Experimental)

Set the heading level of Two Column Layout. Currently only 0(disable) or 3 is valid for this value. So slow processing, but a little nice.

default: 0
since: v0.7.0

@see Sample of MkDocs Material

Renderer for JavaScript


Set the value to true if you're using 'MathJax', 'Twemoji' or any more.
Require "Chrome" which has "headless" mode.

default: false
since: v0.7.0


Set the "Headless Chrome" program path.
If render_js is false, this value will be ignored.

default: chromium-browser

Check on your system:

$ <PROGRAM_PATH> --headless \
   --disable-gpu \
   --dump-dom \
   <ANY_SITE_URL(eg. '')>

... and more


This option allows you to use a different destination for the PDF file.
default: pdf/document.pdf


The path where your custom cover.html and/or styles.scss are located. default: templates
since: v0.8.0


Setting this option will enable the build only if there is an environment variable set to 1. This is useful to disable building the PDF files during development, since it can take a long time to export all files.
default: None

PDF generation can take significantly longer than HTML generation which can slow down mkdocs's built-in dev-server.

Adding enabled_if_env: ENABLE_PDF_EXPORT under - with-pdf: disables PDF generation during development. Run the dev-server normally:

$ mkdocs serve
INFO    -  Browser Connected:
INFO    -  Running task: builder (delay: None)
INFO    -  Building documentation...
WARNING -  without generate PDF(set environment variable ENABLE_PDF_EXPORT to 1 to enable)
... 2 seconds later ...
INFO    -  Reload 1 waiters: /.../

and to build files to deploy specify ENABLE_PDF_EXPORT=1 at the command line:

$ ENABLE_PDF_EXPORT=1 mkdocs build
INFO    -  Converting 10 articles to PDF took 7.1s
INFO    -  Documentation built in 8.29 seconds


Setting this to true will out HTML to stdout on build time.
default: false

You can try this:

mkdocs build > for_pdf_print.html

...and browse output with Google Chrome. Chrome DevTools Into Print Preview Mode will you help.

Note: WeasyPrint and Google Chrome are not fully compatible.


Setting this to true will list out of anchor points provided during the build as info message.
default: false
since: v0.7.4


Setting this to true will show all WeasyPrint debug messages during the build.
default: false

Custom cover page and document style

It is possible to create a custom cover page for the document. You can also add a custom style sheet to modify the whole document.

To do so, add a templates folder at the root level of your mkdocs project and place a cover.html and/or a styles.scss inside. Alternatively, you can specify a different location with the custom_template_path option.

Custom cover page

Using jinja2 syntax, you can access all data from your mkdocs.yml. To make template creation easier, you can use plugin_some_plugin to access variables from plugins. E.g. use {{ author }} to get the author from your mkdocs.yml that looks like:

    - with-pdf:
        author: WHO

You can use custom variables extra: in your mkdocs.yml And, you can check it in the log if run with verbose or debug_html options.

Custom stylesheet

Since your stylesheet is appended to the default ones, you can override every setting from them.

Tip: setting the debug_html option to true to get the generated html that is passed to weasyprint can help you determine the html tags, classes or identifiers you want to modify in your stylesheet.

Advanced Rendering Hooks (Experimental)

You can hook the PDF rendering process by creating a pdf_event_hook/ in your working directory (usually the same directory as mkdocs.yml).
since: v0.8.2

Sample (or pdf_event_hook/

import logging

from bs4 import BeautifulSoup
from mkdocs.structure.pages import Page

def inject_link(html: str, href: str,
                page: Page, logger: logging) -> str:
    """Adding PDF View button on navigation bar(using material theme)"""

    def _pdf_icon():
        _ICON = '''
<svg xmlns="" viewBox="0 0 512 512">
<path d="M128,0c-17.6,0-32,14.4-32,32v448c0,17.6,14.4,32,32,32h320c17.6,0,32-14.4,32-32V128L352,0H128z" fill="#E2E5E7"/>
<path d="m384 128h96l-128-128v96c0 17.6 14.4 32 32 32z" fill="#B0B7BD"/>
<polygon points="480 224 384 128 480 128" fill="#CAD1D8"/>
<path d="M416,416c0,8.8-7.2,16-16,16H48c-8.8,0-16-7.2-16-16V256c0-8.8,7.2-16,16-16h352c8.8,0,16,7.2,16,16  V416z" fill="#F15642"/>
<g fill="#fff">
<path d="m101.74 303.15c0-4.224 3.328-8.832 8.688-8.832h29.552c16.64 0 31.616 11.136 31.616 32.48 0 20.224-14.976 31.488-31.616 31.488h-21.36v16.896c0 5.632-3.584 8.816-8.192 8.816-4.224 0-8.688-3.184-8.688-8.816v-72.032zm16.88 7.28v31.872h21.36c8.576 0 15.36-7.568 15.36-15.504 0-8.944-6.784-16.368-15.36-16.368h-21.36z"/>
<path d="m196.66 384c-4.224 0-8.832-2.304-8.832-7.92v-72.672c0-4.592 4.608-7.936 8.832-7.936h29.296c58.464 0 57.184 88.528 1.152 88.528h-30.448zm8.064-72.912v57.312h21.232c34.544 0 36.08-57.312 0-57.312h-21.232z"/>
<path d="m303.87 312.11v20.336h32.624c4.608 0 9.216 4.608 9.216 9.072 0 4.224-4.608 7.68-9.216 7.68h-32.624v26.864c0 4.48-3.184 7.92-7.664 7.92-5.632 0-9.072-3.44-9.072-7.92v-72.672c0-4.592 3.456-7.936 9.072-7.936h44.912c5.632 0 8.96 3.344 8.96 7.936 0 4.096-3.328 8.704-8.96 8.704h-37.248v0.016z"/>
<path d="m400 432h-304v16h304c8.8 0 16-7.2 16-16v-16c0 8.8-7.2 16-16 16z" fill="#CAD1D8"/>
'''  # noqa: E501
        return BeautifulSoup(_ICON, 'html.parser')'(hook on inject_link: {page.title})')
    soup = BeautifulSoup(html, 'html.parser')

    nav = soup.find(class_='md-header-nav')
    if not nav:
        # after 7.x
        nav = soup.find('nav', class_='md-header__inner')
    if nav:
        a = soup.new_tag('a', href=href, title='PDF',
                         **{'class': 'md-header__button md-header-nav__button md-icon'})
        return str(soup)

    return html

# def pre_js_render(soup: BeautifulSoup, logger: logging) -> BeautifulSoup:
#'(hook on pre_js_render)')
#     return soup

# def pre_pdf_render(soup: BeautifulSoup, logger: logging) -> BeautifulSoup:
#'(hook on pre_pdf_render)')
#     tag = soup.find(lambda tag: ==
#                     'body' and 'data-md-color-scheme' in tag.attrs)
#     if tag:
#         tag['data-md-color-scheme'] = 'print'
#     return soup

... and check log:

$ mkdocs build
INFO    -  Found PDF rendering event hook module.
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /tmp/sample/site
INFO    -  (hook on inject_link: Home)


From reporting a bug to submitting a pull request: every contribution is appreciated and welcome. Report bugs, ask questions and request features using Github issues. If you want to contribute to the code of this project, please read the Contribution Guidelines.

Special thanks to

Author: Orzih
Source Code: 
License: MIT License

#python #pdf 

Mkdocs-with-pdf: Generate A Single PDF File From MkDocs Repository
Java Questions

Java Questions


The Linux Commands Handbook

The Linux Commands Handbook follows the 80/20 rule: you’ll learn 80% of a topic in around 20% of the time you spend studying it.

I find that this approach gives you a well-rounded overview.

This handbook does not try to cover everything under the sun related to Linux and its commands. It focuses on the small core commands that you will use the 80% or 90% of the time, and tries to simplify the usage of the more complex ones.

All these commands work on Linux, macOS, WSL, and anywhere you have a UNIX environment.

I hope the contents of this handbook will help you achieve what you want: getting comfortable with Linux.

Click here to download this handbook in PDF / ePUB / Mobi format.



  • Introduction to Linux and shells
  • The man command
  • The ls command
  • The cd command
  • The pwd command
  • The mkdir command
  • The rmdir command
  • The mv command
  • The cp command
  • The open command
  • The touch command
  • The find command
  • The ln command
  • The gzip command
  • The gunzip command
  • The tar command
  • The alias command
  • The cat command
  • The less command
  • The tail command
  • The wc command
  • The grep command
  • The sort command
  • The uniq command
  • The diff command
  • The echo command
  • The chown command
  • The chmod command
  • The umask command
  • The du command
  • The df command
  • The basename command
  • The dirname command
  • The ps command
  • The top command
  • The kill command
  • The killall command
  • The jobs command
  • The bg command
  • The fg command
  • The type command
  • The which command
  • The nohup command
  • The xargs command
  • The vim command
  • The emacs command
  • The nano command
  • The whoami command
  • The who command
  • The su command
  • The sudo command
  • The passwd command
  • The ping command
  • The traceroute command
  • The clear command
  • The history command
  • The export command
  • The crontab command
  • The uname command
  • The env command
  • The printenv command
  • Conclusion

Introduction to Linux and shells

What is Linux?

Linux is an operating system, like macOS or Windows.

It is also the most popular Open Source operating system, and it gives you a lot of freedom.

It powers the vast majority of the servers that compose the Internet. It’s the base upon which everything is built. But not just that. Android is based on (a modified version of) Linux.

The Linux “core” (called a kernel) was born in 1991 in Finland, and it has come a really long way from its humble beginnings. It went on to be the kernel of the GNU Operating System, creating the duo GNU/Linux.

There’s one thing about Linux that corporations like Microsoft, Apple, and Google will never be able to offer: the freedom to do whatever you want with your computer.

They’re actually going in the opposite direction, building walled gardens, especially on the mobile side.

Linux is the ultimate freedom.

It is developed by volunteers, some paid by companies that rely on it, some independently. But there’s no single commercial company that can dictate what goes into Linux, or the project’s priorities.

You can also use Linux as your day to day computer. I use macOS because I really enjoy the applications and design (and I also used to be an iOS and Mac apps developer). But before using macOS I used Linux as my main computer Operating System.

No one can dictate which apps you can run, or “call home” with apps that track you, your position, and more.

Linux is also special because there’s not just “one Linux”, like is the case with Windows or macOS. Instead, we have distributions.

A “distro” is made by a company or organization and packages the Linux core with additional programs and tooling.

For example you have Debian, Red Hat, and Ubuntu, probably the most popular distributions.

But many, many more exist. You can create your own distribution, too. But most likely you’ll use a popular one that has lots of users and a community of people around it. This lets you do what you need to do without losing too much time reinventing the wheel and figuring out answers to common problems.

Some desktop computers and laptops ship with Linux preinstalled. Or you can install it on your Windows-based computer, or on a Mac.

But you don’t need to disrupt your existing computer just to get an idea of how Linux works.

I don’t have a Linux computer.

If you use a Mac, you just need to know that under the hood macOS is a UNIX Operating System. It shares a lot of the same ideas and software that a GNU/Linux system uses, because GNU/Linux is a free alternative to UNIX.

UNIX is an umbrella term that groups many operating systems used in big corporations and institutions, starting from the 70’s

The macOS terminal gives you access to the same exact commands I’ll describe in the rest of this handbook.

Microsoft has an official Windows Subsystem for Linux which you can (and should!) install on Windows. This will give you the ability to run Linux in a very easy way on your PC.

But the vast majority of the time you will run a Linux computer in the cloud via a VPS (Virtual Private Server) like DigitalOcean.

What is a shell?

A shell is a command interpreter that exposes an interface to the user to work with the underlying operating system.

It allows you to execute operations using text and commands, and it provides users advanced features like being able to create scripts.

This is important: shells let you perform things in a more optimized way than a GUI (Graphical User Interface) could ever possibly let you do. Command line tools can offer many different configuration options without being too complex to use.

There are many different kind of shells. This post focuses on Unix shells, the ones that you will find commonly on Linux and macOS computers.

Many different kind of shells were created for those systems over time, and a few of them dominate the space: Bash, Csh, Zsh, Fish and many more!

All shells originate from the Bourne Shell, called sh. “Bourne” because its creator was Steve Bourne.

Bash means Bourne-again shell. sh was proprietary and not open source, and Bash was created in 1989 to create a free alternative for the GNU project and the Free Software Foundation. Since projects had to pay to use the Bourne shell, Bash became very popular.

If you use a Mac, try opening your Mac terminal. By default it runs ZSH (or, pre-Catalina, Bash).

You can set up your system to run any kind of shell – for example I use the Fish shell.

Each single shell has its own unique features and advanced usage, but they all share a common functionality: they can let you execute programs, and they can be programmed.

In the rest of this handbook we’ll see in detail the most common commands you will use.

The man command

The first command I’ll introduce will help you understand all the other commands.

Every time I don’t know how to use a command, I type man <command> to get the manual:

This is a man (from manual) page. Man pages are an essential tool to learn as a developer. They contain so much information that sometimes it’s almost too much.

The above screenshot is just 1 of 14 screens of explanation for the ls command.

Most of the time when I need to learn a command quickly I use this site called tldr pages: It’s a command you can install, which you then run like this: tldr <command>. It gives you a very quick overview of a command, with some handy examples of common usage scenarios:

This is not a substitute for man, but a handy tool to avoid losing yourself in the huge amount of information present in a man page. Then you can use the man page to explore all the different options and parameters you can use on a command.

The ls command

Inside a folder you can list all the files that the folder contains using the ls command:


If you add a folder name or path, it will print that folder’s contents:

ls /bin


ls accepts a lot of options. One of my favorite combinations is -al. Try it:

ls -al /bin


Compared to the plain ls command, this returns much more information.

You have, from left to right:

  • the file permissions (and if your system supports ACLs, you get an ACL flag as well)
  • the number of links to that file
  • the owner of the file
  • the group of the file
  • the file size in bytes
  • the file’s last modified datetime
  • the file name

This set of data is generated by the l option. The a option instead also shows the hidden files.

Hidden files are files that start with a dot (.).

The cd command

Once you have a folder, you can move into it using the cd command. cd means change directory. You invoke it specifying a folder to move into. You can specify a folder name, or an entire path.


mkdir fruits
cd fruits

Now you are in the fruits folder.

You can use the .. special path to indicate the parent folder:

cd .. #back to the home folder

The ## character indicates the start of the comment, which lasts for the entire line after it’s found.

You can use it to form a path:

mkdir fruits
mkdir cars
cd fruits
cd ../cars

There is another special path indicator which is ., and indicates the current folder.

You can also use absolute paths, which start from the root folder /:

cd /etc

The pwd command

Whenever you feel lost in the filesystem, call the pwd command to know where you are:


It will print the current folder path.

The mkdir command

You create folders using the mkdir command:

mkdir fruits

You can create multiple folders with one command:

mkdir dogs cars

You can also create multiple nested folders by adding the -p option:

mkdir -p fruits/apples

Options in UNIX commands commonly take this form. You add them right after the command name, and they change how the command behaves. You can often combine multiple options, too.

You can find which options a command supports by typing man <commandname>. Try now with man mkdir for example (press the q key to esc the man page). Man pages are the amazing built-in help for UNIX.

The rmdir command

Just as you can create a folder using mkdir, you can delete a folder using rmdir:

mkdir fruits
rmdir fruits

You can also delete multiple folders at once:

mkdir fruits cars
rmdir fruits cars

The folder you delete must be empty.

To delete folders with files in them, we’ll use the more generic rm command which deletes files and folders, using the -rf option:

rm -rf fruits cars

Be careful as this command does not ask for confirmation and it will immediately remove anything you ask it to remove.

There is no bin when removing files from the command line, and recovering lost files can be hard.

The mv command

Once you have a file, you can move it around using the mv command. You specify the file current path, and its new path:

touch test
mv pear new_pear

The pear file is now moved to new_pear. This is how you rename files and folders.

If the last parameter is a folder, the file located at the first parameter path is going to be moved into that folder. In this case, you can specify a list of files and they will all be moved in the folder path identified by the last parameter:

touch pear
touch apple
mkdir fruits
mv pear apple fruits #pear and apple moved to the fruits folder

The cp command

You can copy a file using the cp command:

touch test
cp apple another_apple

To copy folders you need to add the -r option to recursively copy the whole folder contents:

mkdir fruits
cp -r fruits cars

The open command

The open command lets you open a file using this syntax:

open <filename>

You can also open a directory, which on macOS opens the Finder app with the current directory open:

open <directory name>

I use it all the time to open the current directory:

open .

The special . symbol points to the current directory, as .. points to the parent directory

The same command can also be be used to run an application:

open <application name>

The touch command

You can create an empty file using the touch command:

touch apple

If the file already exists, it opens the file in write mode, and the timestamp of the file is updated.

The find command

The find command can be used to find files or folders matching a particular search pattern. It searches recursively.

Let’s learn how to use it by example.

Find all the files under the current tree that have the .js extension and print the relative path of each file that matches:

find . -name '*.js'

It’s important to use quotes around special characters like * to avoid the shell interpreting them.

Find directories under the current tree matching the name “src”:

find . -type d -name src

Use -type f to search only files, or -type l to only search symbolic links.

-name is case sensitive. use -iname to perform a case-insensitive search.

You can search under multiple root trees:

find folder1 folder2 -name filename.txt

Find directories under the current tree matching the name “node_modules” or ‘public’:

find . -type d -name node_modules -or -name public

You can also exclude a path using -not -path:

find . -type d -name '*.md' -not -path 'node_modules/*'

You can search files that have more than 100 characters (bytes) in them:

find . -type f -size +100c

Search files bigger than 100KB but smaller than 1MB:

find . -type f -size +100k -size -1M

Search files edited more than 3 days ago:

find . -type f -mtime +3

Search files edited in the last 24 hours:

find . -type f -mtime -1

You can delete all the files matching a search by adding the -delete option. This deletes all the files edited in the last 24 hours:

find . -type f -mtime -1 -delete

You can execute a command on each result of the search. In this example we run cat to print the file content:

find . -type f -exec cat {} \;

Notice the terminating \;. {} is filled with the file name at execution time.

Original article source at

#linux #ubuntu #developer

The Linux Commands Handbook