Posts

Mysql learning in terminal (WP Site was intended)

Image
This is some basic, Here’s a practical MySQL cheat sheet tailored for setting up a WordPress database from scratch via terminal , covering login → database → user → privileges → DDL → DML → common operations. 🐬 MySQL Cheat Sheet (WordPress Setup + Core Commands) 🔐 1. After Logging Into MySQL mysql -u root -p Check current user: SELECT USER (); Show databases: SHOW DATABASES ; 🏗️ 2. Create WordPress Database CREATE DATABASE wordpress_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; Use it: USE wordpress_db ; 👤 3. Create MySQL User for WordPress CREATE USER 'wp_user' @ 'localhost' IDENTIFIED BY 'strong_password' ; Grant privileges: GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user' @ 'localhost' ; Apply changes: FLUSH PRIVILEGES ; Check grants: SHOW GRANTS FOR 'wp_user' @ 'localhost' ; 🗑️ 4. Delete Database / User (if needed) DROP DATABASE wordpress_db; DROP ...

Oracle Date and time conversion

Here is a comprehensive guide to Oracle date and time formats, covering the fundamental data types and how to use them. The Core Data Types Oracle has three primary data types for storing date and time information: DATE: The classic data type. It stores both date and time down to the second. · Format: YYYY-MM-DD HH24:MI:SS (It always has these components, even if you don't see them). · Storage: It stores century, year, month, day, hour, minute, and second. It does not store fractional seconds or time zone information. · Example Storage: 2023-10-25 14:30:22 TIMESTAMP: An extension of DATE that includes fractional seconds. · Format: YYYY-MM-DD HH24:MI:SS.FF · Precision: By default, FF has 6 digits of precision (microseconds). You can specify a precision from 0 to 9 (e.g., TIMESTAMP(3) for milliseconds). · Example Storage: 2023-10-25 14:30:22.123456 TIMESTAMP WITH TIME ZONE: A TIMESTAMP that also stores the time zone region or time zone offset. · Format: YYYY-MM-DD HH24:MI:SS.FF...

Terminal-Based Writing

Terminal-Based Writing: From Termux to Professional Docs (A Beginner’s Guide to WordGrinder + Pandoc) Do you love writing in the terminal but need professional-looking PDFs or Word files? This guide will show you how to: Write in Termux using wordgrinder (a simple terminal word processor). Convert to Markdown for flexibility. Generate beautiful PDFs/DOCX files using pandoc . No complex setups—just clear, step-by-step instructions. Let’s begin! Step 1: Install Termux & Tools (Skip if you already have Termux!) Install Termux (Android terminal emulator). Update packages: pkg update && pkg upgrade Install WordGrinder (terminal word processor) and Pandoc (document converter): pkg install wordgrinder pandoc Step 2: Write in WordGrinder WordGrinder is a lightweight word processor with bold, italics, and underlines . Basic Commands Open a new file: wordgrinder my_note.zws Shortcuts: Ctrl+S → Save Ctrl+B → Bold Ctrl+I → Italics...

Taskwarrior Tutorial

Taskwarrior Tutorial: Master Your Tasks from the Terminal Taskwarrior is a powerful, flexible command-line task management tool that helps you track your todos efficiently. Here's how to get started: Installation Linux (Debian/Ubuntu): sudo apt install taskwarrior macOS: brew install task Windows (WSL): # Use package manager in WSL distro Basic Commands Adding Tasks # Simple task task add "Buy groceries" # Task with priority and due date task add "Prepare meeting notes" priority:H due:tomorrow # Task with project and tags task add "Fix login bug" project:work +bug +urgent Viewing Tasks # Show all tasks task list # Show only pending tasks (default) task # Show tasks by project task list project:work # Show tasks by tag task list +urgent # Show completed tasks task completed Modifying Tasks # Mark task as done task 1 done # Delete a task task 2 delete # Modify task attributes task 3 modify priority:H due:today # Annotate a task wi...

Markdown Quick Tutorial

Markdown Quick Tutorial: The Essentials in 5 Minutes Markdown is a lightweight markup language for formatting plain text. It’s perfect for notes, docs, and even websites (like GitHub READMEs). Here’s all you need to know: 1. Basic Formatting Style Markdown Output Bold **bold** bold Italic *italic* italic Strikethrough ~~strike~~ strike Code `code` code Link [text](URL) Google Image ![alt](image.png) (Shows image) 2. Headings # Heading 1 (Biggest) ## Heading 2 ### Heading 3 #### Heading 4 3. Lists Bullet Points - Item 1 - Item 2 - Sub-item (indent with 2 spaces) Numbered Lists 1. First 2. Second 3. Third 4. Code Blocks Inline Code Use `print("Hello")` in Python. Multi-line Code Use triple backticks + language name: ```python def hello(): print("World") ``` (Shows with syntax highlighting!) 5. Tables | Name | Age | Job | |---------|-----|----------| | Alice | 25 | Engineer | | Bob | 30...

Oracle 11g Cheat Sheet

Database Connection CONNECT username/password@hostname:port/SID CONNECT sys/password AS SYSDBA DISCONNECT Basic Queries SELECT * FROM table_name; SELECT column1, column2 FROM table_name; SELECT DISTINCT column1 FROM table_name; SELECT * FROM table_name WHERE condition; SELECT * FROM table_name ORDER BY column1 [ASC|DESC]; Filtering WHERE column = value WHERE column LIKE 'pattern%' WHERE column IN (value1, value2) WHERE column BETWEEN value1 AND value2 WHERE condition1 AND condition2 WHERE condition1 OR condition2 WHERE NOT condition Joins SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column SELECT * FROM table1 LEFT JOIN table2 ON table1.column = table2.column SELECT * FROM table1 RIGHT JOIN table2 ON table1.column = table2.column SELECT * FROM table1 FULL OUTER JOIN table2 ON table1.column = table2.column Aggregation SELECT COUNT(*) FROM table_name; SELECT SUM(column) FROM table_name; SELECT AVG(column) FROM table_name; SELECT MIN(column), MAX(colum...

To install Jupyter Notebook on Ubuntu (Linux)

To install Jupyter Notebook on Ubuntu 24, follow these steps: Update the system : sudo apt update && sudo apt upgrade -y Install Python and pip (Ubuntu 24 typically comes with Python pre-installed): sudo apt install python3 python3-pip -y Install Jupyter Notebook : pip3 install jupyter Verify the installation : jupyter notebook --version Launch Jupyter Notebook : jupyter notebook This will start the Jupyter server and open a browser window. If it doesn’t, navigate to http://localhost:8888 in your browser. Optional: Install in a virtual environment (recommended to avoid package conflicts): Install virtualenv: sudo apt install python3-venv -y Create and activate a virtual environment: python3 -m venv jupyter_env source jupyter_env/bin/activate Install Jupyter Notebook inside the virtual environment: pip install jupyter Run Jupyter Notebook as above. Notes : Ensure you have an active internet connection. If you encounter permission issues with pi...