Commands
Curated shell and tool commands for Linux, Windows, Python, Git, Django, SQL, and Nginx – searchable, filterable, and copyable with one click.
29 Commands found
No commands found. Try a different search or filter.
-
SQL SQL
Compare MySQL account identities
Compare the authenticated privilege account with the connection identity in a direct MySQL session. Do not share account details publicly.
SELECT CURRENT_USER(), USER(); -
SQL SQL
Compare MySQL time-zone settings
Read the session and global MySQL time-zone settings without changing them. SYSTEM refers to the server's system time zone.
SELECT @@session.time_zone, @@global.time_zone; -
SQL SQL
Count admin log entries per content type via an inner join
Joins django_admin_log to django_content_type on the real foreign key content_type_id, then groups by app and model name to show how many admin actions were recorded per model, without exposing any individual log message or username. Requires both Django system tables (django_admin_log, django_content_type) to exist and that at least one admin action has been logged to return rows; read-only.
SELECT ct.app_label, ct.model, COUNT(*) AS log_entries FROM django_admin_log AS log JOIN django_content_type AS ct ON log.content_type_id = ct.id GROUP BY ct.app_label, ct.model; -
SQL SQL
Count how many commands are currently published
Returns a single number: the total count of rows in website_command where is_published is true. Read-only; a very cheap query at this table size and a common building block for dashboards or health checks.
SELECT COUNT(*) FROM website_command WHERE is_published = 1; -
SQL SQL
Count how many commands exist per category
Groups all rows in website_command by category and counts how many commands fall into each one, returning one summary row per category. Read-only; at this table size the grouping is effectively instantaneous.
SELECT category, COUNT(*) AS command_count FROM website_command GROUP BY category; -
SQL SQL
Count how many distinct categories are in use
Combines COUNT with DISTINCT to return a single number representing how many different category values appear in website_command, rather than the total row count. Read-only; equivalent behavior in MySQL and MariaDB.
SELECT COUNT(DISTINCT category) FROM website_command; -
SQL SQL
Fetch one page of commands using LIMIT and OFFSET
Returns titles sorted alphabetically, skipping the first 20 matching rows and returning the next 10, simulating page 3 of a 10-item-per-page listing. Read-only; OFFSET-based pagination re-scans skipped rows on each call, so it can become slow on very large tables, though this is not a concern at the current table size.
SELECT title_en FROM website_command ORDER BY title_en LIMIT 10 OFFSET 20; -
SQL SQL
Find categories that contain more than one command
Groups commands by category and then uses HAVING to keep only the groups whose count exceeds 1, filtering on the aggregated result rather than on individual rows (which WHERE cannot do). Read-only; functionally equivalent in MySQL and MariaDB.
SELECT category, COUNT(*) AS command_count FROM website_command GROUP BY category HAVING COUNT(*) > 1; -
SQL SQL
Find commands whose command text starts with 'git '
Uses a LIKE pattern with a trailing % wildcard to match any command_text starting with the literal prefix "git ", returning the matching titles. Read-only; command_text currently has no secondary index at all (only the table's primary key on id exists), so this query always performs a full table scan regardless of wildcard position. A trailing-wildcard pattern like this one has a fixed prefix the engine could seek on if a suitable index were added later, unlike a leading wildcard (e.g. '%git%'), where no fixed prefix exists to seek on, so every row would still need to be examined even if an index existed.
SELECT title_en FROM website_command WHERE command_text LIKE 'git %'; -
SQL SQL
Find commands whose title contains the word 'static'
Uses a LIKE pattern with wildcards on both sides to match title_en values containing the substring "static" anywhere, such as commands about static files. Read-only; title_en currently has no secondary index at all (only the table's primary key on id exists), so this query already performs a full table scan today. Even if an index on title_en were added later, this particular pattern has no fixed prefix for the engine to seek on, so every row's value would still need to be examined to evaluate it, unlike a trailing-wildcard pattern (e.g. 'static%'), which has a fixed prefix an index could narrow a search on.
SELECT title_en FROM website_command WHERE title_en LIKE '%static%'; -
SQL SQL
Find content types that have no recorded admin log entries
Uses a LEFT JOIN from django_content_type to django_admin_log followed by a WHERE log.id IS NULL filter (an anti-join) to list every registered content type that has never had an admin action logged against it. Requires both Django system tables to exist; read-only.
SELECT ct.app_label, ct.model FROM django_content_type AS ct LEFT JOIN django_admin_log AS log ON log.content_type_id = ct.id WHERE log.id IS NULL; -
SQL SQL
Inspect the current MySQL account's grants
Show grants and assigned roles for the current MySQL account. This does not expand all role privileges; keep the output private.
SHOW GRANTS FOR CURRENT_USER; -
SQL SQL
Inspect the session SQL mode
Read the current MySQL session's SQL mode, including strict-mode flags, without changing server or session settings.
SELECT @@session.sql_mode; -
SQL SQL
List all commands ordered from newest to oldest
Returns every command's title and creation timestamp, sorted descending by created_at so the most recently added commands appear first. Read-only; sorting a small table like this has negligible cost, but would benefit from an index on created_at on much larger tables.
SELECT title_en, created_at FROM website_command ORDER BY created_at DESC; -
SQL SQL
List each distinct category currently in use
Returns each unique value found in the category column, with duplicates removed, regardless of how many commands share that category. Read-only; the engine must internally group or sort rows to remove duplicates, which is inexpensive at this table's size.
SELECT DISTINCT category FROM website_command; -
SQL SQL
List every table in the current database with its storage engine
Queries the standard INFORMATION_SCHEMA.TABLES view, filtered to the currently selected database, to list every table together with its storage engine (typically InnoDB for this project) and an approximate row count. Read-only; TABLE_ROWS is an estimate for InnoDB tables, not an exact count. Supported identically by MySQL and MariaDB.
SELECT TABLE_NAME, ENGINE, TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = DATABASE(); -
SQL SQL
List MySQL database tables
Lists the tables in the currently selected MySQL database. Requires an active database connection and a selected database.
SHOW TABLES; -
SQL SQL
List the columns of website_command via INFORMATION_SCHEMA
Queries INFORMATION_SCHEMA.COLUMNS for the website_command table, returning each column's name, data type, and whether it allows NULL, in their original definition order. Produces the same underlying information as DESCRIBE, but as an ordinary queryable result set that can be filtered or joined further. Read-only; supported identically by MySQL and MariaDB.
SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'website_command' ORDER BY ORDINAL_POSITION; -
SQL SQL
List the titles of all published commands
Filters website_command down to rows where is_published is true (stored as 1 in MySQL/MariaDB's tinyint(1) representation of BooleanField) and returns only their English titles. Read-only; result size depends on how many commands are currently published.
SELECT title_en FROM website_command WHERE is_published = 1; -
SQL SQL
Select the title, category, and shell of every command
Retrieves the English title, category, and shell columns for every row in website_command, without any filtering. Read-only; returns one row per stored command, including unpublished drafts; no special privileges beyond SELECT on the table.
SELECT title_en, category, shell FROM website_command; -
SQL SQL
Show all indexes defined on the website_command table
Lists every index on website_command, including the primary key, with details such as the indexed column, uniqueness, and cardinality estimate. Read-only; requires the table to exist. Currently the Command model defines no explicit secondary indexes, so only the primary key index on id is expected to appear.
SHOW INDEX FROM website_command; -
SQL SQL
Show MySQL server version
Returns the version string of the connected MySQL server.
SELECT VERSION(); -
SQL SQL
Show the character set and collation of the current database
Reads the character_set_database and collation_database session system variables, showing the default character encoding and sort order configured for the current database. Read-only; identical syntax in MySQL and MariaDB; requires no special privileges.
SELECT @@character_set_database, @@collation_database; -
SQL SQL
Show the column structure of the website_command table
Lists every column of the website_command table (the table backing the Command model of this project) along with its data type, nullability, key, default, and extra attributes. Requires the table to exist and SELECT-level visibility into its structure; read-only, negligible performance impact. DESCRIBE is a MySQL/MariaDB-specific shorthand for SHOW COLUMNS FROM.
DESCRIBE website_command; -
SQL SQL
Show the execution plan for a filtered SELECT
Shows how the database would execute the given SELECT (e.g. full table scan vs. index lookup, estimated rows examined) without actually running it as a normal query and returning its data rows. Read-only and does not execute the underlying query's result retrieval; distinct from EXPLAIN ANALYZE, which does execute it and is intentionally not used here. On this small, unindexed table, the plan will typically show a full table scan.
EXPLAIN SELECT * FROM website_command WHERE category = 'linux'; -
SQL SQL
Show the full CREATE TABLE statement of website_command
Returns the complete CREATE TABLE statement that would recreate the website_command table, including column definitions, keys, storage engine, and character set. Useful for understanding the table's real on-disk structure beyond what the Django model shows. Read-only; requires the table to exist; supported identically by MySQL and MariaDB.
SHOW CREATE TABLE website_command; -
SQL SQL
Show the name of the currently selected database
Returns the name of the database currently selected for the connection (or NULL if none is selected). Works identically in MySQL and MariaDB; read-only, requires no special privileges, and has negligible performance impact.
SELECT DATABASE(); -
SQL SQL
Show the server-wide configured maximum number of connections
Reads the max_connections server configuration variable using the GLOBAL scope, showing the upper limit on simultaneous client connections the whole server will accept. Read-only; available without special privileges; useful together with Threads_connected to judge how close the server is to its connection limit.
SHOW GLOBAL VARIABLES LIKE 'max_connections'; -
SQL SQL
Show the server-wide number of open connections
Reads the Threads_connected server status variable using the GLOBAL scope, showing how many client connections are currently open across the whole server rather than just the current session. Read-only; available to any connected user without special privileges; a lightweight diagnostic for spotting unexpectedly high connection counts.
SHOW GLOBAL STATUS LIKE 'Threads_connected';