How to restore root directory permission to default?
Running chmod -R 777 / as root will break your system.
Running rm -rf / as root will result in a disaster!.
| def validation_required(validator_function): | |
| def decorator(function): | |
| async def error(websocket, err): | |
| await websocket.send(err) | |
| async def wrapper(websocket, data): | |
| status, err = validator_function(data) | |
| if status: |
| # A kind of range() but for float element | |
| def frange_core(start, stop=None, step=None): | |
| # Use float number in range() function | |
| # if stop and step argument is null set start=0.0 and step = 1.0 | |
| if stop == None: | |
| stop = start + 0.0 | |
| start = 0.0 | |
| if step == None: |
| from multiprocessing import Process | |
| import time | |
| from random import randint | |
| def func(pid, number): | |
| for i in range(1, 50): | |
| time.sleep(5) | |
| print('[+] Process -> '+str(pid)+': (' + str(number*i*pid) + ')') | |
| from flask import Flask, escape, url_for, request, redirect, session | |
| from werkzeug.utils import secure_filename | |
| #Instancier une application Flask | |
| app = Flask(__name__) | |
| # Set the secret key to some random bytes. Keep this really secret! | |
| app.secret_key = b'_5#y2L"F4Q8z\n\xec]/' | |
| ########################## |
| from threading import Thread, Event | |
| event = Event() | |
| def worker(number, outputs, exit_code): | |
| msg = "=== Table de mulitiplication par {}".format(number) | |
| outputs.append(msg) |
| import signal | |
| import resource | |
| import os | |
| import random | |
| # To Limit CPU time | |
| def time_exceeded(signo, frame): | |
| print("CPU exceeded...") | |
| raise SystemExit(1) |
| import difflib | |
| print("Levenshtein distance implementation !") | |
| _str = 'appel' | |
| difflib.get_close_matches('appel', ['ape', 'apple', 'peach', 'puppy'], n=2) | |
| # returns ['apple', 'ape'] | |
| # difflib.get_close_matches finds the best "good enough" matches. | |
| # Here, first argument is being matched against the second one. |
| import logging | |
| import pika | |
| import configparser | |
| LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) ' | |
| '-35s %(lineno) -5d: %(message)s') | |
| LOGGER = logging.getLogger(__name__) | |
| class RabbitmqManager: |
The rm -rf command is one of the fastest way to delete a folder and its contents. But a little typo or ignorance may result into unrecoverable system damage. The some of options used with rm command are.
rm command in Linux is used to delete files.
rm -r command deletes the folder recursively, even the empty folder.
rm -f command removes ‘Read only File’ without asking.
rm -rf / : Force deletion of everything in root directory.
rm -rf * : Force deletion of everything in current directory/working directory.
rm -rf . : Force deletion of current folder and sub folders.\