This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Funtions: | |
| Writing Functions: | |
| Normal function: | |
| get_name() { | |
| echo "John" | |
| } | |
| echo "You are $(get_name)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dockerizing Any Application Using Dockerfile - Full Step by Step Process to make docker image: | |
| What is the Dockerfile? | |
| Dockerfiles are instructions. They contains all of the commands used to build an image. | |
| Docker images consist of read-only layers. | |
| Each represents a Dockerfile instruction. | |
| Layers are stacked. | |
| Each layer is a result of the changes from the previous layer. | |
| Images are built using the docker image build command. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Basic Linux Shell Scripting: | |
| What is Shell? | |
| The shell executes a program in response to its prompt. When you give a command, the shell searches for the program, and then executes it. For example, when you give the command ls, the shell searches for the utility/program named ls, and then runs it in the shell. The arguments and the options that you provide with the utilities can impact the result that you get. The shell is also known as a CLI, or command line interface. | |
| Types of shells: | |
| Primaryly there is two types of shell: | |
| Bourne shell − If you are using a Bourne-type shell, the $ character is the default prompt. | |
| It has sub categories: Bourne shell (sh), Korn shell (ksh), Bourne Again shell (bash), POSIX shell (sh) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Linux Series part 2: File & Folder Permission Management: | |
| To see file list, their crrent permission level and much more, you can run: | |
| ls -la -lh -lt | |
| (To know more on ls commands check tutorial: https://www.youtube.com/watch?v=h6sDtGN5hYs) | |
| chmod <specification> filename : Change the file permissions. Specifications = u user/owner, g group, o other, + add permission, - remove, r read, w write,x execute. | |
| chmod -R <specification> dir-name: Change the permissions of a directory recursively. To change permission of a directory and everything within that directory, use this command. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Ivan Carvalho | |
| // Problem A - Educational Dynamic Programming Contest - AtCoder | |
| // Link : https://atcoder.jp/contests/dp | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int MAXN = 1e5 + 10; | |
| const int INF = 2*1e9; | |
| int dp[MAXN],N,K,h[MAXN]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spinners = ( | |
| Spinner.objects | |
| .using(request.customer.name) | |
| .annotate( | |
| avg_duration=Avg('owned_spinners__spins__duration')) | |
| .order_by('-avg_duration')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from buckets.fields import S3FileField | |
| from datetime import datetime, timezone, timedelta | |
| from django.conf import settings | |
| from django.db import models | |
| from django.dispatch import receiver | |
| from django.utils.translation import ugettext as _ | |
| from django.core.mail import send_mail | |
| from django.template.loader import render_to_string | |
| import django.contrib.auth.models as auth | |
| import django.contrib.auth.base_user as auth_base |
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
NewerOlder