Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 

Repository files navigation

Update Google Chrome on Ubuntu

sudo apt update
sudo apt --only-upgrade install google-chrome-stable

Install package in pythonanywhere.com

pip3.10 install --user jdatetime

or

pip3.10 install -r requirements.txt --user

⚠️ Make sure to use the pip version that matches your project's Python version. For example, if your project runs on Python 3.12, use pip3.12 instead of pip3.10


Failure to display warnings

import warnings
warnings.filterwarnings("ignore")

Show warnings :

warnings.filterwarnings("default")

Delete All __pycache__ Folders

find . -type d -name "__pycache__" -exec rm -r {} +

Update Jupyter Output

from IPython.display import clear_output, display

for i in range(10):
    clear_output(wait=True)
    display(f"Current value: {i}")

Using fireducks instead of pandas to increase speed

pip install fireducks
import fireducks.pandas as pd

Convert HTML to PDF

from weasyprint import HTML
HTML('https://google.com').write_pdf(f'google.pdf')

Show history of latest command in terminal

history | grep httpd : filter history by "httpd"

Kill a port in ubuntu

sudo kill -9 $(sudo lsof -t -i:8000)

Installation using pip without description and with description

without description:

pip install -q <something>

with description:

pip install -v <something>

Changing the Phpmyadmin Theme

  • step 1 : Download theme from here
  • step 2 : Place the desired theme in the /theme/‍‍‍ docker folder
    docker cp <theme_folder_name> <phpmyadmin_container_name>:/var/www/html/themes/

Inserting numbers into text in Python:

  1. F-String :
    age = 23
    print(f"I'm {age} years old")
  2. Format String :
    age = 23
    print("I'm {} years old".format(age))
  3. String Formatting With %d
    age = 23
    print("I'm %d years old" % (age))

Open a port

sudo ufw allow <port>

Change Jupyter Notebook Theam

https://saturncloud.io/blog/jupyter-notebook-dark-mode-a-step-by-step-guide/

Give access to files and folders

chmod [مجوزها] [فایل یا پوشه]

chmod -R 777 'FOLDER NAME'

در اینجا، [مجوزها] می‌تواند به چندین شکل مختلف باشد، از جمله:

  • حالت عددی (مثل ۷۵۵)
  • حالت نمادی (مثل u+rwx)
  • حالت مختصر (مثل u+x)

مجوزهای مهم در این دستور به شرح زیر است:

  • نمایانگر صاحب فایل (کاربر) u

  • نمایانگر گروه فایل g

  • نمایانگر دیگران o

  • نمایانگر تمام افراد (صاحب، گروه و دیگران) a و همچنین:

  • +برای افزودن مجوز

    • برای حذف مجوز
  • = برای تنظیم مجوز به صورت دقیق


About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors