List of helpful shortcuts for faster coding
This file contains 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
chmod +x filename | |
sudo mv /usr/local/bin | |
chmod 400 file To protect a file against accidental overwriting. | |
chmod 500 directory To protect yourself from accidentally removing, renaming or moving files from this directory. | |
chmod 600 file A private file only changeable by the user who entered this command. | |
chmod 644 file A publicly readable file that can only be changed by the issuing user. | |
chmod 660 file Users belonging to your group can change this file, others don't have any access to it at all. | |
chmod 700 file Protects a file against any access from other users, while the issuing user still has full access. |
This file contains 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
CREATE USER "username" WITH PASSWORD "your_pass" WITH ALL PRIVILEGES | |
set password for "username" = "pass" | |
show databases; | |
use db_name | |
show measurements |
This file contains 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
install docker: | |
curl https://get.docker.com | sh | |
sudo usermod -aG docker $(whoami) | |
docker --info | |
docker --version |
This file contains 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
adduser your_username | |
usermod -aG sudo your_username >> add user to sudo user group | |
type >> visudo | |
add this below to the file: | |
your_username ALL=(ALL) ALL |
People
![]() :bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
This file contains 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
# version: '3.7' | |
# services: | |
# localstack: | |
# container_name: my-localstack | |
# privileged: true | |
# image: localstack/localstack | |
# ports: | |
# - "4567-4593:4567-4593" | |
# - "${PORT_WEB_UI-7777}:${PORT_WEB_UI-7777}" |
This file contains 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
arr = [99,85,75,46,45,8,3,93,68,49,34,78,28,66,97,58,100,4,22,74,79,26,94,52,13,39,90,60,10,36,55,7,54,25,1,47,31,3,88,2,84,14,21,9,86,70,65,71,56,6,32,88,7,69,44,89,67,98,29,16,61,5,43,63,33,92,35,50,76,37,42,59,15,80,96,48,24,64,11, 62,27,23,20,40,53,30,57,19] | |
class InsertionSort: | |
def __init__(self, arr: list): | |
self.arr = arr | |
def insertion(self) -> list: |
This file contains 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 motor.motor_asyncio import AsyncIOMotorClient | |
from bson.objectid import ObjectId | |
from bson.json_util import loads as bson_loads, dumps as bson_dumps | |
import asyncio | |
import pprint | |
from pymongo import ReturnDocument | |
import json | |
loop = asyncio.get_event_loop() |
This file contains 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
//show databases | |
show dbs | |
//Use Database test | |
use test | |
// show collections from the database | |
show collections | |
// show counts of records in collection |
OlderNewer