@indah_sekar/loka 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +234 -0
- package/bin/cli.js +287 -0
- package/package.json +58 -0
- package/src/data/commands.js +258 -0
- package/src/data/commands.json +258 -0
package/README.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# LokaIndex - Quick commands for IT, DevOps & Troubleshooting
|
|
2
|
+
|
|
3
|
+
Quick access to commands for **Windows**, **Linux**, **macOS**,
|
|
4
|
+
**networking**, **web development**, **security**, and **troubleshooting**.
|
|
5
|
+
|
|
6
|
+
Available as a **web app** and a **CLI tool**.
|
|
7
|
+
|
|
8
|
+
## Install (CLI)
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i -g @indah_sekar/loka
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## CLI Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
loka --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Output:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
OS Troubleshooter - Quick troubleshooting commands for Windows, Linux & macOS
|
|
24
|
+
|
|
25
|
+
Usage:
|
|
26
|
+
loka [options] [command-id | command-name]
|
|
27
|
+
|
|
28
|
+
Options:
|
|
29
|
+
--help, -h Show this help message
|
|
30
|
+
--list, -l List all available commands
|
|
31
|
+
--os <os> Filter by OS (windows, linux, macos)
|
|
32
|
+
--category <cat> Filter by category
|
|
33
|
+
--search <query> Search commands by name/description
|
|
34
|
+
--copy Copy command to clipboard
|
|
35
|
+
|
|
36
|
+
Placeholder Flags (override default values):
|
|
37
|
+
--ip <ip> IP address (default: 8.8.8.8)
|
|
38
|
+
--domain <domain> Domain name (default: google.com)
|
|
39
|
+
--interface <iface> Network interface (default: en0/eth0)
|
|
40
|
+
--url <url> Full URL
|
|
41
|
+
--port <port> Port number (default: 80)
|
|
42
|
+
--protocol <proto> Protocol (default: https)
|
|
43
|
+
--user <user> Username (default: john)
|
|
44
|
+
--password <pass> Password
|
|
45
|
+
--project <name> Project name (default: my-app)
|
|
46
|
+
--token <token> npm auth token
|
|
47
|
+
--device <dev> Block device (default: /dev/sda)
|
|
48
|
+
--volume <vol> Disk volume (default: disk0s1)
|
|
49
|
+
--drive <drive> Drive letter (default: C:)
|
|
50
|
+
--process <name> Process name (default: notepad)
|
|
51
|
+
--service <name> Service name (default: nginx)
|
|
52
|
+
--pid <pid> Process ID (default: 1234)
|
|
53
|
+
--appname <name> Application name (default: Safari)
|
|
54
|
+
--path <path> File/directory path (default: /var/www/html)
|
|
55
|
+
--chain <chain> Firewall chain (default: INPUT)
|
|
56
|
+
|
|
57
|
+
Examples:
|
|
58
|
+
loka --list
|
|
59
|
+
loka w1
|
|
60
|
+
loka --os linux --list
|
|
61
|
+
loka --search ping
|
|
62
|
+
loka --copy w1
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Listing Commands
|
|
66
|
+
|
|
67
|
+
### By OS
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
loka --os windows --list
|
|
71
|
+
loka --os linux --list
|
|
72
|
+
loka --os macos --list
|
|
73
|
+
loka --os website --list
|
|
74
|
+
loka --os software --list
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### By Category
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Windows
|
|
81
|
+
loka --os windows --category Network --list
|
|
82
|
+
loka --os windows --category System --list
|
|
83
|
+
loka --os windows --category "Process & Services" --list
|
|
84
|
+
loka --os windows --category "Windows Update" --list
|
|
85
|
+
loka --os windows --category Driver --list
|
|
86
|
+
loka --os windows --category Power --list
|
|
87
|
+
|
|
88
|
+
# Linux
|
|
89
|
+
loka --os linux --category Network --list
|
|
90
|
+
loka --os linux --category System --list
|
|
91
|
+
loka --os linux --category "Process & Services" --list
|
|
92
|
+
loka --os linux --category "Disk & Filesystem" --list
|
|
93
|
+
loka --os linux --category "User & Permissions" --list
|
|
94
|
+
loka --os linux --category Power --list
|
|
95
|
+
loka --os linux --category "Logs & Diagnostics" --list
|
|
96
|
+
|
|
97
|
+
# macOS
|
|
98
|
+
loka --os macos --category Network --list
|
|
99
|
+
loka --os macos --category System --list
|
|
100
|
+
loka --os macos --category "Process & Services" --list
|
|
101
|
+
loka --os macos --category "Disk & Filesystem" --list
|
|
102
|
+
loka --os macos --category "User & Permissions" --list
|
|
103
|
+
loka --os macos --category Power --list
|
|
104
|
+
loka --os macos --category "Logs & Diagnostics" --list
|
|
105
|
+
|
|
106
|
+
# Website
|
|
107
|
+
loka --os website --category "Enumeration (Kali Linux)" --list
|
|
108
|
+
|
|
109
|
+
# Software
|
|
110
|
+
loka --os software --category "ReactJS - Vite" --list
|
|
111
|
+
loka --os software --category "Publish Package" --list
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Search
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
loka --search ping
|
|
118
|
+
loka --search dns
|
|
119
|
+
loka --search "system update"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Command IDs
|
|
123
|
+
|
|
124
|
+
Each command has a short ID for quick access:
|
|
125
|
+
|
|
126
|
+
| OS | Format | Example |
|
|
127
|
+
| -------- | ------- | -------------- |
|
|
128
|
+
| Windows | `w{N}` | `w1`, `w27` |
|
|
129
|
+
| Linux | `l{N}` | `l1`, `l42` |
|
|
130
|
+
| macOS | `m{N}` | `m1`, `m45` |
|
|
131
|
+
| Website | `s{N}` | `s1`, `s8` |
|
|
132
|
+
| Software | `sf{N}` | `sf1`, `sf9` |
|
|
133
|
+
|
|
134
|
+
## Using Commands with Placeholders
|
|
135
|
+
|
|
136
|
+
Some commands contain `{PLACEHOLDER}` values. In the **web app**, commands display with sensible defaults. In the **CLI**, defaults are used automatically, or you can override them with flags.
|
|
137
|
+
|
|
138
|
+
### How it works
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Run with default values (no extra flags needed)
|
|
142
|
+
loka w7 # → ping 8.8.8.8
|
|
143
|
+
loka l6 # → sudo ping -c 4 8.8.8.8
|
|
144
|
+
loka sf1 # → npm create vite@latest my-app
|
|
145
|
+
|
|
146
|
+
# Override with flags
|
|
147
|
+
loka w7 --ip 192.168.1.1 # → ping 192.168.1.1
|
|
148
|
+
loka sf1 --project react-app # → npm create vite@latest react-app
|
|
149
|
+
loka l23 --service apache2 # → sudo systemctl restart apache2
|
|
150
|
+
loka s7 --ip 10.0.0.1 --port 443 # → sudo nikto -host 10.0.0.1:443 -C all
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Available Placeholder Flags
|
|
154
|
+
|
|
155
|
+
| Flag | Placeholder | Default | Example |
|
|
156
|
+
| --------------- | -------------- | ------------- | ------------------------------ |
|
|
157
|
+
| `--ip` | `{IP}` | `8.8.8.8` | `--ip 192.168.1.1` |
|
|
158
|
+
| `--domain` | `{DOMAIN}` | `google.com` | `--domain github.com` |
|
|
159
|
+
| `--interface` | `{INTERFACE}` | `en0` | `--interface eth0` |
|
|
160
|
+
| `--url` | `{URL}` | (required) | `--url https://target.com` |
|
|
161
|
+
| `--port` | `{PORT}` | `80` | `--port 443` |
|
|
162
|
+
| `--protocol` | `{PROTOCOL}` | `https` | `--protocol http` |
|
|
163
|
+
| `--user` | `{USERNAME}` | `john` | `--user admin` |
|
|
164
|
+
| `--password` | `{PASSWORD}` | | `--password MyP@ss` |
|
|
165
|
+
| `--project` | `{PROJECT_NAME}`| `my-app` | `--project react-app` |
|
|
166
|
+
| `--token` | `{NPMJS_TOKEN}`| | `--token npm_xxx` |
|
|
167
|
+
| `--device` | `{DEVICE}` | `/dev/sda` | `--device /dev/nvme0n1` |
|
|
168
|
+
| `--volume` | `{VOLUME}` | `disk0s1` | `--volume disk0s2` |
|
|
169
|
+
| `--drive` | `{DRIVE}` | `C:` | `--drive D:` |
|
|
170
|
+
| `--process` | `{PROCESS}` | `notepad` | `--process chrome` |
|
|
171
|
+
| `--service` | `{SERVICE}` | `nginx` | `--service apache2` |
|
|
172
|
+
| `--pid` | `{PID}` | `1234` | `--pid 5678` |
|
|
173
|
+
| `--appname` | `{APPNAME}` | `Safari` | `--appname Firefox` |
|
|
174
|
+
| `--path` | `{PATH}` | `/var/www/html`| `--path /home/user` |
|
|
175
|
+
| `--chain` | `{CHAIN}` | `INPUT` | `--chain OUTPUT` |
|
|
176
|
+
|
|
177
|
+
### More Examples
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Network diagnostics
|
|
181
|
+
loka w7 --ip 10.0.0.1
|
|
182
|
+
loka l6 --ip 10.0.0.1
|
|
183
|
+
loka m5 --ip 10.0.0.1
|
|
184
|
+
|
|
185
|
+
# Service management
|
|
186
|
+
loka w18 --service spooler
|
|
187
|
+
loka l23 --service sshd
|
|
188
|
+
loka l23 --service mysql
|
|
189
|
+
|
|
190
|
+
# Process management
|
|
191
|
+
loka w16 --process chrome
|
|
192
|
+
loka l21 --pid 5678
|
|
193
|
+
loka m22 --appname Firefox
|
|
194
|
+
|
|
195
|
+
# Software development
|
|
196
|
+
loka sf1 --project my-vite-app
|
|
197
|
+
loka sf7 --token npm_abc123
|
|
198
|
+
|
|
199
|
+
# Website enumeration
|
|
200
|
+
loka s1 --url https://target.com
|
|
201
|
+
loka s3 --ip 192.168.1.100
|
|
202
|
+
loka s7 --ip 192.168.1.100 --port 8080
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Web App
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
npm install
|
|
209
|
+
npm run dev
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Open [http://localhost:5173](http://localhost:5173) in your browser.
|
|
213
|
+
|
|
214
|
+
## Build
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
npm run build
|
|
218
|
+
npm run preview
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Features
|
|
222
|
+
|
|
223
|
+
- **Multiple Platforms** — Windows, Linux, macOS, and more
|
|
224
|
+
- **Short IDs** — Run commands with `w1`, `l6`, `m5`
|
|
225
|
+
- **Default Values** — Commands with placeholders include sensible defaults
|
|
226
|
+
- **Placeholder Flags** — Override defaults with `--ip`, `--user`, `--project`, etc.
|
|
227
|
+
- **One-Click Copy** — Copy any command to clipboard
|
|
228
|
+
- **Command Execution** — Run commands directly from the web app
|
|
229
|
+
- **Terminal Output** — View execution results with export option
|
|
230
|
+
- **CLI Tool** — Use from terminal after `npm install -g`
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { readFileSync } from "fs";
|
|
4
|
+
import { execSync } from "child_process";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
import { dirname, join } from "path";
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
|
|
10
|
+
let commands;
|
|
11
|
+
try {
|
|
12
|
+
commands = JSON.parse(readFileSync(join(__dirname, "..", "dist", "data", "commands.json"), "utf-8"));
|
|
13
|
+
} catch {
|
|
14
|
+
commands = JSON.parse(readFileSync(join(__dirname, "..", "src", "data", "commands.json"), "utf-8"));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const args = process.argv.slice(2);
|
|
18
|
+
|
|
19
|
+
const FLAG_MAP = {
|
|
20
|
+
"--ip": "{IP}",
|
|
21
|
+
"--domain": "{DOMAIN}",
|
|
22
|
+
"--interface": "{INTERFACE}",
|
|
23
|
+
"--device": "{DEVICE}",
|
|
24
|
+
"--volume": "{VOLUME}",
|
|
25
|
+
"--drive": "{DRIVE}",
|
|
26
|
+
"--process": "{PROCESS}",
|
|
27
|
+
"--service": "{SERVICE}",
|
|
28
|
+
"--pid": "{PID}",
|
|
29
|
+
"--appname": "{APPNAME}",
|
|
30
|
+
"--user": "{USERNAME}",
|
|
31
|
+
"--password": "{PASSWORD}",
|
|
32
|
+
"--path": "{PATH}",
|
|
33
|
+
"--chain": "{CHAIN}",
|
|
34
|
+
"--url": "{URL}",
|
|
35
|
+
"--port": "{PORT}",
|
|
36
|
+
"--protocol": "{PROTOCOL}",
|
|
37
|
+
"--project": "{PROJECT_NAME}",
|
|
38
|
+
"--token": "{NPMJS_TOKEN}",
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function printHelp() {
|
|
42
|
+
console.log(`
|
|
43
|
+
OS Troubleshooter - Quick troubleshooting commands for Windows, Linux & macOS
|
|
44
|
+
|
|
45
|
+
Usage:
|
|
46
|
+
loka [options] [command-id | command-name]
|
|
47
|
+
|
|
48
|
+
Options:
|
|
49
|
+
--help, -h Show this help message
|
|
50
|
+
--list, -l List all available commands
|
|
51
|
+
--os <os> Filter by OS (windows, linux, macos)
|
|
52
|
+
--category <cat> Filter by category
|
|
53
|
+
--search <query> Search commands by name/description
|
|
54
|
+
--copy Copy command to clipboard
|
|
55
|
+
|
|
56
|
+
Placeholder Flags (override default values):
|
|
57
|
+
--ip <ip> IP address (default: 8.8.8.8)
|
|
58
|
+
--domain <domain> Domain name (default: google.com)
|
|
59
|
+
--interface <iface> Network interface (default: en0/eth0)
|
|
60
|
+
--url <url> Full URL (default: https://example.com)
|
|
61
|
+
--port <port> Port number (default: 80)
|
|
62
|
+
--protocol <proto> Protocol (default: https)
|
|
63
|
+
--user <user> Username (default: john)
|
|
64
|
+
--password <pass> Password
|
|
65
|
+
--project <name> Project name (default: my-app)
|
|
66
|
+
--token <token> npm auth token
|
|
67
|
+
--device <dev> Block device (default: /dev/sda)
|
|
68
|
+
--volume <vol> Disk volume (default: disk0s1)
|
|
69
|
+
--drive <drive> Drive letter (default: C:)
|
|
70
|
+
--process <name> Process name (default: notepad)
|
|
71
|
+
--service <name> Service name (default: nginx)
|
|
72
|
+
--pid <pid> Process ID (default: 1234)
|
|
73
|
+
--appname <name> Application name (default: Safari)
|
|
74
|
+
--path <path> File/directory path (default: /var/www/html)
|
|
75
|
+
--chain <chain> Firewall chain (default: INPUT)
|
|
76
|
+
|
|
77
|
+
Examples:
|
|
78
|
+
loka --list
|
|
79
|
+
loka w1 # Run by ID (uses default values)
|
|
80
|
+
loka --os linux --list
|
|
81
|
+
loka --search ping
|
|
82
|
+
loka --copy w1
|
|
83
|
+
loka s1 --url https://target.com
|
|
84
|
+
loka sf1 --project my-vite-app
|
|
85
|
+
loka l23 --service apache2
|
|
86
|
+
loka s7 --ip 192.168.1.1 --port 443
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function getFilteredCommands(osFilter, categoryFilter, searchQuery) {
|
|
91
|
+
const osList = osFilter ? [osFilter] : Object.keys(commands);
|
|
92
|
+
let allCmds = [];
|
|
93
|
+
|
|
94
|
+
for (const os of osList) {
|
|
95
|
+
if (!commands[os]) continue;
|
|
96
|
+
for (const cat of commands[os]) {
|
|
97
|
+
if (categoryFilter && cat.category.toLowerCase() !== categoryFilter.toLowerCase()) continue;
|
|
98
|
+
let cmds = cat.commands;
|
|
99
|
+
if (searchQuery) {
|
|
100
|
+
const q = searchQuery.toLowerCase();
|
|
101
|
+
cmds = cmds.filter((c) =>
|
|
102
|
+
c.name.toLowerCase().includes(q) ||
|
|
103
|
+
c.description.toLowerCase().includes(q) ||
|
|
104
|
+
c.command.toLowerCase().includes(q) ||
|
|
105
|
+
c.id.toLowerCase().includes(q)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
allCmds.push(...cmds.map((c) => ({ os, category: cat.category, ...c })));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return allCmds;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function printResults(results) {
|
|
115
|
+
if (results.length === 0) return;
|
|
116
|
+
|
|
117
|
+
const maxNo = Math.max(...results.map((r) => r.id.length), 2);
|
|
118
|
+
const maxName = Math.max(...results.map((r) => r.name.length), 4);
|
|
119
|
+
const maxCmd = Math.max(...results.map((r) => r.command.length), 7);
|
|
120
|
+
|
|
121
|
+
let currentOs = null;
|
|
122
|
+
for (const r of results) {
|
|
123
|
+
if (r.os !== currentOs) {
|
|
124
|
+
console.log(`\n ${r.os.toUpperCase()}`);
|
|
125
|
+
console.log(` ${"no".padEnd(maxNo)} ${"name".padEnd(maxName)} ${"command".padEnd(maxCmd)} description`);
|
|
126
|
+
console.log(` ${"-".repeat(maxNo)} ${"-".repeat(maxName)} ${"-".repeat(maxCmd)} -----------`);
|
|
127
|
+
currentOs = r.os;
|
|
128
|
+
}
|
|
129
|
+
console.log(` ${r.id.padEnd(maxNo)} ${r.name.padEnd(maxName)} ${r.command.padEnd(maxCmd)} ${r.description}`);
|
|
130
|
+
}
|
|
131
|
+
console.log(`\n Found: ${results.length} command(s)`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function findById(id) {
|
|
135
|
+
const q = id.toLowerCase();
|
|
136
|
+
for (const [os, categories] of Object.entries(commands)) {
|
|
137
|
+
for (const cat of categories) {
|
|
138
|
+
for (const cmd of cat.commands) {
|
|
139
|
+
if (cmd.id.toLowerCase() === q) return { os, category: cat.category, ...cmd };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function parsePlaceholderFlags(args) {
|
|
147
|
+
const values = {};
|
|
148
|
+
for (const [flag, placeholder] of Object.entries(FLAG_MAP)) {
|
|
149
|
+
const idx = args.indexOf(flag);
|
|
150
|
+
if (idx !== -1 && args[idx + 1]) {
|
|
151
|
+
values[placeholder] = args[idx + 1];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return values;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function replacePlaceholders(command, defaultCmd, flagValues) {
|
|
158
|
+
let result = command;
|
|
159
|
+
let hasUnresolved = false;
|
|
160
|
+
|
|
161
|
+
for (const [placeholder, value] of Object.entries(flagValues)) {
|
|
162
|
+
result = result.replaceAll(placeholder, value);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
for (const placeholder of Object.keys(FLAG_MAP)) {
|
|
166
|
+
if (result.includes(placeholder)) {
|
|
167
|
+
hasUnresolved = true;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (hasUnresolved && defaultCmd) {
|
|
173
|
+
return defaultCmd;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function prepareCommand(cmd, os, flagValues) {
|
|
180
|
+
const base = cmd.command;
|
|
181
|
+
const defaultCmd = cmd.default || null;
|
|
182
|
+
let final = replacePlaceholders(base, defaultCmd, flagValues);
|
|
183
|
+
|
|
184
|
+
if ((os === "linux" || os === "macos") && !final.startsWith("sudo ")) {
|
|
185
|
+
return `sudo ${final}`;
|
|
186
|
+
}
|
|
187
|
+
return final;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function copyToClipboard(text) {
|
|
191
|
+
try {
|
|
192
|
+
const platform = process.platform;
|
|
193
|
+
if (platform === "darwin") execSync("pbcopy", { input: text });
|
|
194
|
+
else if (platform === "linux") {
|
|
195
|
+
try { execSync("xclip -selection clipboard", { input: text }); }
|
|
196
|
+
catch { execSync("xsel --clipboard --input", { input: text }); }
|
|
197
|
+
}
|
|
198
|
+
else if (platform === "win32") execSync("clip", { input: text });
|
|
199
|
+
return true;
|
|
200
|
+
} catch {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function handleResult(cmd, shouldCopy, flagValues) {
|
|
206
|
+
const finalCmd = prepareCommand(cmd, cmd.os, flagValues);
|
|
207
|
+
if (shouldCopy) {
|
|
208
|
+
const copied = copyToClipboard(finalCmd);
|
|
209
|
+
console.log(copied ? " Command copied to clipboard!" : " Failed to copy. Install xclip/xsel/pbcopy.");
|
|
210
|
+
} else {
|
|
211
|
+
console.log(`\n Executing: $ ${finalCmd}\n`);
|
|
212
|
+
try { execSync(finalCmd, { stdio: "inherit", shell: true }); } catch {}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function main() {
|
|
217
|
+
if (args.includes("--help") || args.includes("-h") || args.length === 0) {
|
|
218
|
+
printHelp();
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const osFlag = args.indexOf("--os");
|
|
223
|
+
const catFlag = args.indexOf("--category");
|
|
224
|
+
const searchFlag = args.indexOf("--search");
|
|
225
|
+
const shouldCopy = args.includes("--copy");
|
|
226
|
+
|
|
227
|
+
const osFilter = osFlag !== -1 ? args[osFlag + 1]?.toLowerCase() : null;
|
|
228
|
+
const categoryFilter = catFlag !== -1 ? args[catFlag + 1] : null;
|
|
229
|
+
const searchQuery = searchFlag !== -1 ? args[searchFlag + 1] : null;
|
|
230
|
+
|
|
231
|
+
const flagValues = parsePlaceholderFlags(args);
|
|
232
|
+
|
|
233
|
+
const skipArgs = new Set([
|
|
234
|
+
"--os", "--category", "--search", "--copy",
|
|
235
|
+
...Object.keys(FLAG_MAP),
|
|
236
|
+
]);
|
|
237
|
+
|
|
238
|
+
let filteredArgs = args.filter((a, i) => {
|
|
239
|
+
if (skipArgs.has(a)) return false;
|
|
240
|
+
if (osFlag !== -1 && i === osFlag + 1) return false;
|
|
241
|
+
if (catFlag !== -1 && i === catFlag + 1) return false;
|
|
242
|
+
if (searchFlag !== -1 && i === searchFlag + 1) return false;
|
|
243
|
+
if (Object.values(FLAG_MAP).includes(a)) return false;
|
|
244
|
+
return true;
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const isList = filteredArgs.includes("--list") || filteredArgs.includes("-l");
|
|
248
|
+
const query = filteredArgs.join(" ");
|
|
249
|
+
|
|
250
|
+
if (isList) {
|
|
251
|
+
printResults(getFilteredCommands(osFilter, categoryFilter, searchQuery));
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (!query && !searchQuery && !categoryFilter) {
|
|
256
|
+
printHelp();
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Try find by ID first
|
|
261
|
+
if (query && !searchQuery && !categoryFilter) {
|
|
262
|
+
const byId = findById(query);
|
|
263
|
+
if (byId) {
|
|
264
|
+
if (osFilter && byId.os !== osFilter) {
|
|
265
|
+
console.log(`\n Command "${query}" is for ${byId.os}, not ${osFilter}`);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
printResults([byId]);
|
|
269
|
+
handleResult(byId, shouldCopy, flagValues);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const results = getFilteredCommands(osFilter, categoryFilter, searchQuery || query);
|
|
275
|
+
if (results.length === 0) {
|
|
276
|
+
console.log(`\n No commands found matching "${searchQuery || query}"`);
|
|
277
|
+
console.log(" Try: loka --list to see all available commands\n");
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
printResults(results);
|
|
282
|
+
if (shouldCopy || results.length === 1) {
|
|
283
|
+
handleResult(results[0], shouldCopy, flagValues);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@indah_sekar/loka",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Quick troubleshooting commands for Windows, Linux & macOS. CLI tool + web app.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"troubleshooting",
|
|
7
|
+
"windows",
|
|
8
|
+
"linux",
|
|
9
|
+
"macos",
|
|
10
|
+
"commands",
|
|
11
|
+
"cli",
|
|
12
|
+
"system-admin",
|
|
13
|
+
"network",
|
|
14
|
+
"diagnostics"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://github.com/indah0503/os-t#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/indah0503/os-t/issues"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/indah0503/os-t.git"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "indah sekar",
|
|
26
|
+
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./src/data/commands.json",
|
|
29
|
+
"./data": "./src/data/commands.json"
|
|
30
|
+
},
|
|
31
|
+
"main": "./src/data/commands.json",
|
|
32
|
+
"bin": {
|
|
33
|
+
"loka": "bin/cli.js"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"bin/",
|
|
37
|
+
"src/data/commands.json",
|
|
38
|
+
"src/data/commands.js"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "vite",
|
|
42
|
+
"build": "vite build",
|
|
43
|
+
"start": "node server.js",
|
|
44
|
+
"lint": "oxlint",
|
|
45
|
+
"preview": "vite preview"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"react": "^19.2.7",
|
|
49
|
+
"react-dom": "^19.2.7"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/react": "^19.2.17",
|
|
53
|
+
"@types/react-dom": "^19.2.3",
|
|
54
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
55
|
+
"oxlint": "^1.71.0",
|
|
56
|
+
"vite": "^8.1.1"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
export const troubleshootingCommands = {
|
|
2
|
+
windows: [
|
|
3
|
+
{
|
|
4
|
+
category: "Network",
|
|
5
|
+
commands: [
|
|
6
|
+
{ id: "w1", name: "Flush DNS Cache", command: "ipconfig /flushdns", description: "Clear the DNS resolver cache" },
|
|
7
|
+
{ id: "w2", name: "Reset Winsock", command: "netsh winsock reset", description: "Reset Winsock catalog to default" },
|
|
8
|
+
{ id: "w3", name: "Release IP", command: "ipconfig /release", description: "Release current IP address" },
|
|
9
|
+
{ id: "w4", name: "Renew IP", command: "ipconfig /renew", description: "Renew IP address from DHCP" },
|
|
10
|
+
{ id: "w5", name: "Reset Firewall", command: "netsh advfirewall reset", description: "Reset Windows Firewall to default" },
|
|
11
|
+
{ id: "w6", name: "Show Network Config", command: "ipconfig /all", description: "Display full network configuration" },
|
|
12
|
+
{ id: "w7", name: "Ping Test", command: "ping {IP}", default: "ping 8.8.8.8", description: "Test connectivity to IP address" },
|
|
13
|
+
{ id: "w8", name: "Traceroute", command: "tracert {DOMAIN}", default: "tracert google.com", description: "Trace route to destination" },
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
category: "System",
|
|
18
|
+
commands: [
|
|
19
|
+
{ id: "w9", name: "System File Checker", command: "sfc /scannow", description: "Scan and repair system files" },
|
|
20
|
+
{ id: "w10", name: "DISM Repair", command: "DISM /Online /Cleanup-Image /RestoreHealth", description: "Repair Windows image" },
|
|
21
|
+
{ id: "w11", name: "Check Disk", command: "chkdsk {DRIVE} /f /r", default: "chkdsk C: /f /r", description: "Check disk for errors and bad sectors" },
|
|
22
|
+
{ id: "w12", name: "Disk Cleanup", command: "cleanmgr /sagerun:1", description: "Run disk cleanup utility" },
|
|
23
|
+
{ id: "w13", name: "System Info", command: "systeminfo", description: "Display system information" },
|
|
24
|
+
{ id: "w14", name: "Event Viewer", command: "eventvwr.msc", description: "Open Event Viewer" },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
category: "Process & Services",
|
|
29
|
+
commands: [
|
|
30
|
+
{ id: "w15", name: "List Running Processes", command: "tasklist", description: "Show all running processes" },
|
|
31
|
+
{ id: "w16", name: "Kill Process by Name", command: "taskkill /F /IM {PROCESS}.exe", default: "taskkill /F /IM notepad.exe", description: "Force kill process by name" },
|
|
32
|
+
{ id: "w17", name: "List Services", command: "sc query type= service state= all", description: "List all services" },
|
|
33
|
+
{ id: "w18", name: "Restart Service", command: "net stop {SERVICE} && net start {SERVICE}", default: "net stop spooler && net start spooler", description: "Restart a Windows service" },
|
|
34
|
+
{ id: "w19", name: "Check Ports", command: "netstat -ano", description: "Show active connections and ports" },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
category: "Windows Update",
|
|
39
|
+
commands: [
|
|
40
|
+
{ id: "w20", name: "Check Updates", command: "wuauclt /detectnow", description: "Force check for Windows Updates" },
|
|
41
|
+
{ id: "w21", name: "Reset Update Components", command: "net stop wuauserv && net start wuauserv", description: "Restart Windows Update service" },
|
|
42
|
+
{ id: "w22", name: "View Update History", command: "wmic qfe list brief /format:table", description: "List installed updates" },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
category: "Driver",
|
|
47
|
+
commands: [
|
|
48
|
+
{ id: "w23", name: "List Drivers", command: "driverquery", description: "List all installed drivers" },
|
|
49
|
+
{ id: "w24", name: "Update Driver", command: "pnputil /scan-devices", description: "Scan for hardware changes" },
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
category: "Power",
|
|
54
|
+
commands: [
|
|
55
|
+
{ id: "w25", name: "Shutdown", command: "shutdown /s /t 0", description: "Immediate shutdown" },
|
|
56
|
+
{ id: "w26", name: "Restart", command: "shutdown /r /t 0", description: "Immediate restart" },
|
|
57
|
+
{ id: "w27", name: "Cancel Shutdown", command: "shutdown /a", description: "Abort scheduled shutdown" },
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
linux: [
|
|
62
|
+
{
|
|
63
|
+
category: "Network",
|
|
64
|
+
commands: [
|
|
65
|
+
{ id: "l1", name: "Flush DNS Cache", command: "systemd-resolve --flush-caches", description: "Clear the DNS resolver cache" },
|
|
66
|
+
{ id: "l2", name: "Restart Network", command: "systemctl restart networking", description: "Restart networking service" },
|
|
67
|
+
{ id: "l3", name: "Renew DHCP", command: "dhclient -r && dhclient", description: "Release and renew DHCP lease" },
|
|
68
|
+
{ id: "l4", name: "Show IP", command: "ip addr show", description: "Display network interfaces" },
|
|
69
|
+
{ id: "l5", name: "Show Routing", command: "ip route show", description: "Display routing table" },
|
|
70
|
+
{ id: "l6", name: "Ping Test", command: "ping -c 4 {IP}", default: "ping -c 4 8.8.8.8", description: "Test connectivity to IP address" },
|
|
71
|
+
{ id: "l7", name: "Traceroute", command: "traceroute {DOMAIN}", default: "traceroute google.com", description: "Trace route to destination" },
|
|
72
|
+
{ id: "l8", name: "Open Ports", command: "ss -tuln", description: "Show listening ports" },
|
|
73
|
+
{ id: "l9", name: "Firewall Rules", command: "iptables -L {CHAIN}", default: "iptables -L INPUT", description: "List firewall rules for chain" },
|
|
74
|
+
{ id: "l10", name: "DNS Lookup", command: "nslookup {DOMAIN}", default: "nslookup google.com", description: "Query DNS records" },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
category: "System",
|
|
79
|
+
commands: [
|
|
80
|
+
{ id: "l11", name: "System Update (Debian/Ubuntu)", command: "apt update && apt upgrade -y", description: "Update package lists and upgrade" },
|
|
81
|
+
{ id: "l12", name: "System Update (Fedora/RHEL)", command: "dnf upgrade -y", description: "Upgrade packages with dnf" },
|
|
82
|
+
{ id: "l13", name: "System Update (Arch)", command: "pacman -Syu", description: "System update with pacman" },
|
|
83
|
+
{ id: "l14", name: "Check Disk Space", command: "df -h", description: "Display disk usage" },
|
|
84
|
+
{ id: "l15", name: "Check Memory", command: "free -h", description: "Display memory usage" },
|
|
85
|
+
{ id: "l16", name: "System Info", command: "uname -a", description: "Display kernel information" },
|
|
86
|
+
{ id: "l17", name: "Uptime", command: "uptime", description: "Show system uptime and load" },
|
|
87
|
+
{ id: "l18", name: "List Block Devices", command: "lsblk", description: "List block devices" },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
category: "Process & Services",
|
|
92
|
+
commands: [
|
|
93
|
+
{ id: "l19", name: "List Processes", command: "ps aux", description: "Show all running processes" },
|
|
94
|
+
{ id: "l20", name: "Top Processes", command: "top -bn1 | head -20", description: "Show top processes by CPU" },
|
|
95
|
+
{ id: "l21", name: "Kill Process", command: "kill -9 {PID}", default: "kill -9 1234", description: "Force kill process by PID" },
|
|
96
|
+
{ id: "l22", name: "List Services (systemd)", command: "systemctl list-units --type=service", description: "List all systemd services" },
|
|
97
|
+
{ id: "l23", name: "Restart Service", command: "systemctl restart {SERVICE}", default: "systemctl restart nginx", description: "Restart a systemd service" },
|
|
98
|
+
{ id: "l24", name: "Check Failed Services", command: "systemctl --failed", description: "Show failed services" },
|
|
99
|
+
{ id: "l25", name: "Journal Logs", command: "journalctl -xe", description: "View system journal logs" },
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
category: "Disk & Filesystem",
|
|
104
|
+
commands: [
|
|
105
|
+
{ id: "l26", name: "Check Disk Health", command: "smartctl -a {DEVICE}", default: "smartctl -a /dev/sda", description: "Check SMART disk status" },
|
|
106
|
+
{ id: "l27", name: "Repair Filesystem", command: "fsck {DEVICE}", default: "fsck /dev/sda1", description: "Check and repair filesystem" },
|
|
107
|
+
{ id: "l28", name: "Mount filesystem", command: "mount -a", description: "Mount all filesystems in fstab" },
|
|
108
|
+
{ id: "l29", name: "Find Large Files", command: "du -sh /* 2>/dev/null | sort -rh | head -10", description: "Find largest directories" },
|
|
109
|
+
{ id: "l30", name: "Check Inodes", command: "df -i", description: "Check inode usage" },
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
category: "User & Permissions",
|
|
114
|
+
commands: [
|
|
115
|
+
{ id: "l31", name: "List Users", command: "cat /etc/passwd | cut -d: -f1", description: "List all system users" },
|
|
116
|
+
{ id: "l32", name: "Fix Permissions", command: "chown -R $(whoami) {PATH}", default: "chown -R $(whoami) /var/www/html", description: "Change ownership recursively" },
|
|
117
|
+
{ id: "l33", name: "Check Sudo Access", command: "sudo -l", description: "List sudo permissions" },
|
|
118
|
+
{ id: "l34", name: "Unlock User", command: "passwd -u {USERNAME}", default: "passwd -u john", description: "Unlock a user account" },
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
category: "Power",
|
|
123
|
+
commands: [
|
|
124
|
+
{ id: "l35", name: "Shutdown", command: "shutdown now", description: "Immediate shutdown" },
|
|
125
|
+
{ id: "l36", name: "Restart", command: "reboot", description: "Restart the system" },
|
|
126
|
+
{ id: "l37", name: "Schedule Shutdown", command: "shutdown +10 'Shutdown in 10 minutes'", description: "Schedule shutdown in 10 minutes" },
|
|
127
|
+
{ id: "l38", name: "Cancel Shutdown", command: "shutdown -c", description: "Cancel scheduled shutdown" },
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
category: "Logs & Diagnostics",
|
|
132
|
+
commands: [
|
|
133
|
+
{ id: "l39", name: "System Logs", command: "tail -f /var/log/syslog", description: "Follow system logs" },
|
|
134
|
+
{ id: "l40", name: "Kernel Messages", command: "dmesg | tail -50", description: "Show recent kernel messages" },
|
|
135
|
+
{ id: "l41", name: "Boot Logs", command: "journalctl -b", description: "Show current boot logs" },
|
|
136
|
+
{ id: "l42", name: "Hardware Info", command: "lshw -short", description: "List hardware components" },
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
macos: [
|
|
141
|
+
{
|
|
142
|
+
category: "Network",
|
|
143
|
+
commands: [
|
|
144
|
+
{ id: "m1", name: "Flush DNS Cache", command: "dscacheutil -flushcache && killall -HUP mDNSResponder", description: "Clear the DNS resolver cache" },
|
|
145
|
+
{ id: "m2", name: "Renew DHCP", command: "ipconfig set {INTERFACE} DHCP", default: "ipconfig set en0 DHCP", description: "Renew DHCP lease on interface" },
|
|
146
|
+
{ id: "m3", name: "Show IP", command: "ifconfig {INTERFACE}", default: "ifconfig en0", description: "Display network interface configuration" },
|
|
147
|
+
{ id: "m4", name: "Show Routing", command: "netstat -rn", description: "Display routing table" },
|
|
148
|
+
{ id: "m5", name: "Ping Test", command: "ping -c 4 {IP}", default: "ping -c 4 8.8.8.8", description: "Test connectivity to IP address" },
|
|
149
|
+
{ id: "m6", name: "Traceroute", command: "traceroute {DOMAIN}", default: "traceroute google.com", description: "Trace route to destination" },
|
|
150
|
+
{ id: "m7", name: "Open Ports", command: "lsof -i -P | grep LISTEN", description: "Show listening ports" },
|
|
151
|
+
{ id: "m8", name: "DNS Lookup", command: "nslookup {DOMAIN}", default: "nslookup google.com", description: "Query DNS records" },
|
|
152
|
+
{ id: "m9", name: "Wi-Fi Info", command: "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I", description: "Show current Wi-Fi connection details" },
|
|
153
|
+
{ id: "m10", name: "Network Reset", command: "ifconfig {INTERFACE} down && ifconfig {INTERFACE} up", default: "ifconfig en0 down && ifconfig en0 up", description: "Toggle network interface off and on" },
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
category: "System",
|
|
158
|
+
commands: [
|
|
159
|
+
{ id: "m11", name: "System Update", command: "softwareupdate --list", description: "Check for available macOS updates" },
|
|
160
|
+
{ id: "m12", name: "Install Updates", command: "softwareupdate --install --all", description: "Install all available updates" },
|
|
161
|
+
{ id: "m13", name: "Check Disk Space", command: "df -h", description: "Display disk usage" },
|
|
162
|
+
{ id: "m14", name: "Check Memory", command: "vm_stat", description: "Display virtual memory statistics" },
|
|
163
|
+
{ id: "m15", name: "System Info", command: "system_profiler SPSoftwareDataType", description: "Display detailed system information" },
|
|
164
|
+
{ id: "m16", name: "Uptime", command: "uptime", description: "Show system uptime and load" },
|
|
165
|
+
{ id: "m17", name: "List Block Devices", command: "diskutil list", description: "List all disk partitions" },
|
|
166
|
+
{ id: "m18", name: "Safe Boot", command: "nvram boot-args='-x'", description: "Enable safe boot on next restart" },
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
category: "Process & Services",
|
|
171
|
+
commands: [
|
|
172
|
+
{ id: "m19", name: "List Processes", command: "ps aux", description: "Show all running processes" },
|
|
173
|
+
{ id: "m20", name: "Top Processes", command: "top -l 1 -n 10 -o cpu", description: "Show top processes by CPU usage" },
|
|
174
|
+
{ id: "m21", name: "Kill Process", command: "kill -9 {PID}", default: "kill -9 1234", description: "Force kill process by PID" },
|
|
175
|
+
{ id: "m22", name: "Force Quit App", command: "killall {APPNAME}", default: "killall Safari", description: "Kill all instances of an application" },
|
|
176
|
+
{ id: "m23", name: "List Launch Agents", command: "ls ~/Library/LaunchAgents/", description: "List user launch agents" },
|
|
177
|
+
{ id: "m24", name: "List Launch Daemons", command: "ls /Library/LaunchDaemons/", description: "List system launch daemons" },
|
|
178
|
+
{ id: "m25", name: "Activity Monitor", command: "open -a 'Activity Monitor'", description: "Open Activity Monitor" },
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
category: "Disk & Filesystem",
|
|
183
|
+
commands: [
|
|
184
|
+
{ id: "m26", name: "Verify Disk", command: "diskutil verifyVolume /", description: "Verify startup disk integrity" },
|
|
185
|
+
{ id: "m27", name: "Repair Disk Permissions", command: "diskutil repairPermissions /", description: "Repair disk permissions" },
|
|
186
|
+
{ id: "m28", name: "First Aid", command: "diskutil verifyVolume {VOLUME}", default: "diskutil verifyVolume disk0s1", description: "Run First Aid on a partition" },
|
|
187
|
+
{ id: "m29", name: "Find Large Files", command: "find / -type f -size +100M 2>/dev/null | head -20", description: "Find files larger than 100MB" },
|
|
188
|
+
{ id: "m30", name: "Purge Disk Space", command: "purge", description: "Force purge disk cache" },
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
category: "User & Permissions",
|
|
193
|
+
commands: [
|
|
194
|
+
{ id: "m31", name: "List Users", command: "dscl . list /Users", description: "List all system users" },
|
|
195
|
+
{ id: "m32", name: "Fix Permissions", command: "chown -R $(whoami) {PATH}", default: "chown -R $(whoami) /var/www/html", description: "Change ownership recursively" },
|
|
196
|
+
{ id: "m33", name: "Check Sudo Access", command: "sudo -l", description: "List sudo permissions" },
|
|
197
|
+
{ id: "m34", name: "Reset Password", command: "dscl . -passwd /Users/{USERNAME} {PASSWORD}", default: "dscl . -passwd /Users/john MyP@ssw0rd", description: "Reset user password" },
|
|
198
|
+
{ id: "m35", name: "Unlock User Account", command: "dscl . -delete /Users/{USERNAME} AuthenticationAuthority", default: "dscl . -delete /Users/john AuthenticationAuthority", description: "Remove authentication restrictions" },
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
category: "Power",
|
|
203
|
+
commands: [
|
|
204
|
+
{ id: "m36", name: "Shutdown", command: "shutdown -h now", description: "Immediate shutdown" },
|
|
205
|
+
{ id: "m37", name: "Restart", command: "shutdown -r now", description: "Restart the system" },
|
|
206
|
+
{ id: "m38", name: "Schedule Shutdown", command: "shutdown +10", description: "Schedule shutdown in 10 minutes" },
|
|
207
|
+
{ id: "m39", name: "Cancel Shutdown", command: "shutdown -c", description: "Cancel scheduled shutdown" },
|
|
208
|
+
{ id: "m40", name: "Sleep", command: "pmset sleepnow", description: "Put system to sleep immediately" },
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
category: "Logs & Diagnostics",
|
|
213
|
+
commands: [
|
|
214
|
+
{ id: "m41", name: "System Logs", command: "log show --predicate 'eventMessage contains \"error\"' --last 1h", description: "Show recent error log entries" },
|
|
215
|
+
{ id: "m42", name: "Console Logs", command: "log show --predicate 'process == \"kernel\"' --last 30m", description: "Show recent kernel log entries" },
|
|
216
|
+
{ id: "m43", name: "Crash Reports", command: "ls ~/Library/Logs/DiagnosticReports/", description: "List crash report files" },
|
|
217
|
+
{ id: "m44", name: "Hardware Info", command: "system_profiler SPHardwareDataType", description: "Display hardware specifications" },
|
|
218
|
+
{ id: "m45", name: "System Diagnostics", command: "sysdiagnose", description: "Generate comprehensive system diagnostics" },
|
|
219
|
+
],
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
website: [
|
|
223
|
+
{
|
|
224
|
+
category: "Enumeration (Kali Linux)",
|
|
225
|
+
commands: [
|
|
226
|
+
{ id: "s1", name: "Fetch URL Content", command: "curl {URL}", description: "Downloads and prints the page content" },
|
|
227
|
+
{ id: "s2", name: "WhatWeb Scan", command: "whatweb -a 4 {IP}", description: "General web scanner" },
|
|
228
|
+
{ id: "s3", name: "Nmap TCP Scan", command: "nmap -Pn -sV {IP}", description: "Scan which TCP port/s active in website" },
|
|
229
|
+
{ id: "s4", name: "Nmap UDP Scan", command: "sudo nmap -sU {IP}", description: "Scan which UDP port/s active in website" },
|
|
230
|
+
{ id: "s5", name: "WordPress Scan", command: "wpscan --url {PROTOCOL}://{IP} --enumerate ap,at,cb,dbe", description: "WordPress Enumeration" },
|
|
231
|
+
{ id: "s6", name: "Directories Scan", command: "dirsearch -u {URL} -e php,html,js", description: "Search directory using basic wordlists" },
|
|
232
|
+
{ id: "s7", name: "Nikto Scan", command: "nikto -host {IP}:{PORT} -C all", description: "Basic Site Info" },
|
|
233
|
+
{ id: "s8", name: "Website Crawling", command: "cewl {URL}", description: "Basic crawling wordlists from pages" },
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
software: [
|
|
238
|
+
{
|
|
239
|
+
category: "ReactJS - Vite",
|
|
240
|
+
commands: [
|
|
241
|
+
{ id: "sf1", name: "Create Project", command: "npm create vite@latest {PROJECT_NAME}", default: "npm create vite@latest my-app", description: "Create a new Vite project" },
|
|
242
|
+
{ id: "sf2", name: "Install Dependencies", command: "npm install", description: "Install all project dependencies" },
|
|
243
|
+
{ id: "sf3", name: "Start Development Server", command: "npm run dev", description: "Start Vite development server" },
|
|
244
|
+
{ id: "sf4", name: "Build for Production", command: "npm run build", description: "Build optimized production bundle" },
|
|
245
|
+
],
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
category: "Publish Package",
|
|
249
|
+
commands: [
|
|
250
|
+
{ id: "sf5", name: "Initialize Package", command: "npm init", description: "Initialize a new npm package" },
|
|
251
|
+
{ id: "sf6", name: "Login to npm", command: "npm login", description: "Authenticate with npm registry" },
|
|
252
|
+
{ id: "sf7", name: "Set Auth Token", command: "npm set //registry.npmjs.org/:_authToken={NPMJS_TOKEN}", default: "npm set //registry.npmjs.org/:_authToken=your-token-here", description: "Set npm authentication token" },
|
|
253
|
+
{ id: "sf8", name: "Publish Package", command: "npm publish", description: "Publish package to npm registry" },
|
|
254
|
+
{ id: "sf9", name: "Publish Public Package", command: "npm publish --access public", description: "Publish scoped package as public" },
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
]
|
|
258
|
+
};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
{
|
|
2
|
+
"windows": [
|
|
3
|
+
{
|
|
4
|
+
"category": "Network",
|
|
5
|
+
"commands": [
|
|
6
|
+
{ "id": "w1", "name": "Flush DNS Cache", "command": "ipconfig /flushdns", "description": "Clear the DNS resolver cache" },
|
|
7
|
+
{ "id": "w2", "name": "Reset Winsock", "command": "netsh winsock reset", "description": "Reset Winsock catalog to default" },
|
|
8
|
+
{ "id": "w3", "name": "Release IP", "command": "ipconfig /release", "description": "Release current IP address" },
|
|
9
|
+
{ "id": "w4", "name": "Renew IP", "command": "ipconfig /renew", "description": "Renew IP address from DHCP" },
|
|
10
|
+
{ "id": "w5", "name": "Reset Firewall", "command": "netsh advfirewall reset", "description": "Reset Windows Firewall to default" },
|
|
11
|
+
{ "id": "w6", "name": "Show Network Config", "command": "ipconfig /all", "description": "Display full network configuration" },
|
|
12
|
+
{ "id": "w7", "name": "Ping Test", "command": "ping {IP}", "description": "Test connectivity to IP address" },
|
|
13
|
+
{ "id": "w8", "name": "Traceroute", "command": "tracert {DOMAIN}", "description": "Trace route to destination" }
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"category": "System",
|
|
18
|
+
"commands": [
|
|
19
|
+
{ "id": "w9", "name": "System File Checker", "command": "sfc /scannow", "description": "Scan and repair system files" },
|
|
20
|
+
{ "id": "w10", "name": "DISM Repair", "command": "DISM /Online /Cleanup-Image /RestoreHealth", "description": "Repair Windows image" },
|
|
21
|
+
{ "id": "w11", "name": "Check Disk", "command": "chkdsk {DRIVE} /f /r", "description": "Check disk for errors and bad sectors" },
|
|
22
|
+
{ "id": "w12", "name": "Disk Cleanup", "command": "cleanmgr /sagerun:1", "description": "Run disk cleanup utility" },
|
|
23
|
+
{ "id": "w13", "name": "System Info", "command": "systeminfo", "description": "Display system information" },
|
|
24
|
+
{ "id": "w14", "name": "Event Viewer", "command": "eventvwr.msc", "description": "Open Event Viewer" }
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"category": "Process & Services",
|
|
29
|
+
"commands": [
|
|
30
|
+
{ "id": "w15", "name": "List Running Processes", "command": "tasklist", "description": "Show all running processes" },
|
|
31
|
+
{ "id": "w16", "name": "Kill Process by Name", "command": "taskkill /F /IM {PROCESS}.exe", "description": "Force kill process by name" },
|
|
32
|
+
{ "id": "w17", "name": "List Services", "command": "sc query type= service state= all", "description": "List all services" },
|
|
33
|
+
{ "id": "w18", "name": "Restart Service", "command": "net stop {SERVICE} && net start {SERVICE}", "description": "Restart a Windows service" },
|
|
34
|
+
{ "id": "w19", "name": "Check Ports", "command": "netstat -ano", "description": "Show active connections and ports" }
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"category": "Windows Update",
|
|
39
|
+
"commands": [
|
|
40
|
+
{ "id": "w20", "name": "Check Updates", "command": "wuauclt /detectnow", "description": "Force check for Windows Updates" },
|
|
41
|
+
{ "id": "w21", "name": "Reset Update Components", "command": "net stop wuauserv && net start wuauserv", "description": "Restart Windows Update service" },
|
|
42
|
+
{ "id": "w22", "name": "View Update History", "command": "wmic qfe list brief /format:table", "description": "List installed updates" }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"category": "Driver",
|
|
47
|
+
"commands": [
|
|
48
|
+
{ "id": "w23", "name": "List Drivers", "command": "driverquery", "description": "List all installed drivers" },
|
|
49
|
+
{ "id": "w24", "name": "Update Driver", "command": "pnputil /scan-devices", "description": "Scan for hardware changes" }
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"category": "Power",
|
|
54
|
+
"commands": [
|
|
55
|
+
{ "id": "w25", "name": "Shutdown", "command": "shutdown /s /t 0", "description": "Immediate shutdown" },
|
|
56
|
+
{ "id": "w26", "name": "Restart", "command": "shutdown /r /t 0", "description": "Immediate restart" },
|
|
57
|
+
{ "id": "w27", "name": "Cancel Shutdown", "command": "shutdown /a", "description": "Abort scheduled shutdown" }
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"linux": [
|
|
62
|
+
{
|
|
63
|
+
"category": "Network",
|
|
64
|
+
"commands": [
|
|
65
|
+
{ "id": "l1", "name": "Flush DNS Cache", "command": "systemd-resolve --flush-caches", "description": "Clear the DNS resolver cache" },
|
|
66
|
+
{ "id": "l2", "name": "Restart Network", "command": "systemctl restart networking", "description": "Restart networking service" },
|
|
67
|
+
{ "id": "l3", "name": "Renew DHCP", "command": "dhclient -r && dhclient", "description": "Release and renew DHCP lease" },
|
|
68
|
+
{ "id": "l4", "name": "Show IP", "command": "ip addr show", "description": "Display network interfaces" },
|
|
69
|
+
{ "id": "l5", "name": "Show Routing", "command": "ip route show", "description": "Display routing table" },
|
|
70
|
+
{ "id": "l6", "name": "Ping Test", "command": "ping -c 4 {IP}", "description": "Test connectivity to IP address" },
|
|
71
|
+
{ "id": "l7", "name": "Traceroute", "command": "traceroute {DOMAIN}", "description": "Trace route to destination" },
|
|
72
|
+
{ "id": "l8", "name": "Open Ports", "command": "ss -tuln", "description": "Show listening ports" },
|
|
73
|
+
{ "id": "l9", "name": "Firewall Rules", "command": "iptables -L {CHAIN}", "description": "List firewall rules for chain" },
|
|
74
|
+
{ "id": "l10", "name": "DNS Lookup", "command": "nslookup {DOMAIN}", "description": "Query DNS records" }
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"category": "System",
|
|
79
|
+
"commands": [
|
|
80
|
+
{ "id": "l11", "name": "System Update (Debian/Ubuntu)", "command": "apt update && apt upgrade -y", "description": "Update package lists and upgrade" },
|
|
81
|
+
{ "id": "l12", "name": "System Update (Fedora/RHEL)", "command": "dnf upgrade -y", "description": "Upgrade packages with dnf" },
|
|
82
|
+
{ "id": "l13", "name": "System Update (Arch)", "command": "pacman -Syu", "description": "System update with pacman" },
|
|
83
|
+
{ "id": "l14", "name": "Check Disk Space", "command": "df -h", "description": "Display disk usage" },
|
|
84
|
+
{ "id": "l15", "name": "Check Memory", "command": "free -h", "description": "Display memory usage" },
|
|
85
|
+
{ "id": "l16", "name": "System Info", "command": "uname -a", "description": "Display kernel information" },
|
|
86
|
+
{ "id": "l17", "name": "Uptime", "command": "uptime", "description": "Show system uptime and load" },
|
|
87
|
+
{ "id": "l18", "name": "List Block Devices", "command": "lsblk", "description": "List block devices" }
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"category": "Process & Services",
|
|
92
|
+
"commands": [
|
|
93
|
+
{ "id": "l19", "name": "List Processes", "command": "ps aux", "description": "Show all running processes" },
|
|
94
|
+
{ "id": "l20", "name": "Top Processes", "command": "top -bn1 | head -20", "description": "Show top processes by CPU" },
|
|
95
|
+
{ "id": "l21", "name": "Kill Process", "command": "kill -9 {PID}", "description": "Force kill process by PID" },
|
|
96
|
+
{ "id": "l22", "name": "List Services (systemd)", "command": "systemctl list-units --type=service", "description": "List all systemd services" },
|
|
97
|
+
{ "id": "l23", "name": "Restart Service", "command": "systemctl restart {SERVICE}", "description": "Restart a systemd service" },
|
|
98
|
+
{ "id": "l24", "name": "Check Failed Services", "command": "systemctl --failed", "description": "Show failed services" },
|
|
99
|
+
{ "id": "l25", "name": "Journal Logs", "command": "journalctl -xe", "description": "View system journal logs" }
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"category": "Disk & Filesystem",
|
|
104
|
+
"commands": [
|
|
105
|
+
{ "id": "l26", "name": "Check Disk Health", "command": "smartctl -a {DEVICE}", "description": "Check SMART disk status" },
|
|
106
|
+
{ "id": "l27", "name": "Repair Filesystem", "command": "fsck {DEVICE}", "description": "Check and repair filesystem" },
|
|
107
|
+
{ "id": "l28", "name": "Mount filesystem", "command": "mount -a", "description": "Mount all filesystems in fstab" },
|
|
108
|
+
{ "id": "l29", "name": "Find Large Files", "command": "du -sh /* 2>/dev/null | sort -rh | head -10", "description": "Find largest directories" },
|
|
109
|
+
{ "id": "l30", "name": "Check Inodes", "command": "df -i", "description": "Check inode usage" }
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"category": "User & Permissions",
|
|
114
|
+
"commands": [
|
|
115
|
+
{ "id": "l31", "name": "List Users", "command": "cat /etc/passwd | cut -d: -f1", "description": "List all system users" },
|
|
116
|
+
{ "id": "l32", "name": "Fix Permissions", "command": "chown -R $(whoami) {PATH}", "description": "Change ownership recursively" },
|
|
117
|
+
{ "id": "l33", "name": "Check Sudo Access", "command": "sudo -l", "description": "List sudo permissions" },
|
|
118
|
+
{ "id": "l34", "name": "Unlock User", "command": "passwd -u {USERNAME}", "description": "Unlock a user account" }
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"category": "Power",
|
|
123
|
+
"commands": [
|
|
124
|
+
{ "id": "l35", "name": "Shutdown", "command": "shutdown now", "description": "Immediate shutdown" },
|
|
125
|
+
{ "id": "l36", "name": "Restart", "command": "reboot", "description": "Restart the system" },
|
|
126
|
+
{ "id": "l37", "name": "Schedule Shutdown", "command": "shutdown +10 'Shutdown in 10 minutes'", "description": "Schedule shutdown in 10 minutes" },
|
|
127
|
+
{ "id": "l38", "name": "Cancel Shutdown", "command": "shutdown -c", "description": "Cancel scheduled shutdown" }
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"category": "Logs & Diagnostics",
|
|
132
|
+
"commands": [
|
|
133
|
+
{ "id": "l39", "name": "System Logs", "command": "tail -f /var/log/syslog", "description": "Follow system logs" },
|
|
134
|
+
{ "id": "l40", "name": "Kernel Messages", "command": "dmesg | tail -50", "description": "Show recent kernel messages" },
|
|
135
|
+
{ "id": "l41", "name": "Boot Logs", "command": "journalctl -b", "description": "Show current boot logs" },
|
|
136
|
+
{ "id": "l42", "name": "Hardware Info", "command": "lshw -short", "description": "List hardware components" }
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"macos": [
|
|
141
|
+
{
|
|
142
|
+
"category": "Network",
|
|
143
|
+
"commands": [
|
|
144
|
+
{ "id": "m1", "name": "Flush DNS Cache", "command": "dscacheutil -flushcache && killall -HUP mDNSResponder", "description": "Clear the DNS resolver cache" },
|
|
145
|
+
{ "id": "m2", "name": "Renew DHCP", "command": "ipconfig set {INTERFACE} DHCP", "description": "Renew DHCP lease on interface" },
|
|
146
|
+
{ "id": "m3", "name": "Show IP", "command": "ifconfig {INTERFACE}", "description": "Display network interface configuration" },
|
|
147
|
+
{ "id": "m4", "name": "Show Routing", "command": "netstat -rn", "description": "Display routing table" },
|
|
148
|
+
{ "id": "m5", "name": "Ping Test", "command": "ping -c 4 {IP}", "description": "Test connectivity to IP address" },
|
|
149
|
+
{ "id": "m6", "name": "Traceroute", "command": "traceroute {DOMAIN}", "description": "Trace route to destination" },
|
|
150
|
+
{ "id": "m7", "name": "Open Ports", "command": "lsof -i -P | grep LISTEN", "description": "Show listening ports" },
|
|
151
|
+
{ "id": "m8", "name": "DNS Lookup", "command": "nslookup {DOMAIN}", "description": "Query DNS records" },
|
|
152
|
+
{ "id": "m9", "name": "Wi-Fi Info", "command": "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I", "description": "Show current Wi-Fi connection details" },
|
|
153
|
+
{ "id": "m10", "name": "Network Reset", "command": "ifconfig {INTERFACE} down && ifconfig {INTERFACE} up", "description": "Toggle network interface off and on" }
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"category": "System",
|
|
158
|
+
"commands": [
|
|
159
|
+
{ "id": "m11", "name": "System Update", "command": "softwareupdate --list", "description": "Check for available macOS updates" },
|
|
160
|
+
{ "id": "m12", "name": "Install Updates", "command": "softwareupdate --install --all", "description": "Install all available updates" },
|
|
161
|
+
{ "id": "m13", "name": "Check Disk Space", "command": "df -h", "description": "Display disk usage" },
|
|
162
|
+
{ "id": "m14", "name": "Check Memory", "command": "vm_stat", "description": "Display virtual memory statistics" },
|
|
163
|
+
{ "id": "m15", "name": "System Info", "command": "system_profiler SPSoftwareDataType", "description": "Display detailed system information" },
|
|
164
|
+
{ "id": "m16", "name": "Uptime", "command": "uptime", "description": "Show system uptime and load" },
|
|
165
|
+
{ "id": "m17", "name": "List Block Devices", "command": "diskutil list", "description": "List all disk partitions" },
|
|
166
|
+
{ "id": "m18", "name": "Safe Boot", "command": "nvram boot-args='-x'", "description": "Enable safe boot on next restart" }
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"category": "Process & Services",
|
|
171
|
+
"commands": [
|
|
172
|
+
{ "id": "m19", "name": "List Processes", "command": "ps aux", "description": "Show all running processes" },
|
|
173
|
+
{ "id": "m20", "name": "Top Processes", "command": "top -l 1 -n 10 -o cpu", "description": "Show top processes by CPU usage" },
|
|
174
|
+
{ "id": "m21", "name": "Kill Process", "command": "kill -9 {PID}", "description": "Force kill process by PID" },
|
|
175
|
+
{ "id": "m22", "name": "Force Quit App", "command": "killall {APPNAME}", "description": "Kill all instances of an application" },
|
|
176
|
+
{ "id": "m23", "name": "List Launch Agents", "command": "ls ~/Library/LaunchAgents/", "description": "List user launch agents" },
|
|
177
|
+
{ "id": "m24", "name": "List Launch Daemons", "command": "ls /Library/LaunchDaemons/", "description": "List system launch daemons" },
|
|
178
|
+
{ "id": "m25", "name": "Activity Monitor", "command": "open -a 'Activity Monitor'", "description": "Open Activity Monitor" }
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"category": "Disk & Filesystem",
|
|
183
|
+
"commands": [
|
|
184
|
+
{ "id": "m26", "name": "Verify Disk", "command": "diskutil verifyVolume /", "description": "Verify startup disk integrity" },
|
|
185
|
+
{ "id": "m27", "name": "Repair Disk Permissions", "command": "diskutil repairPermissions /", "description": "Repair disk permissions" },
|
|
186
|
+
{ "id": "m28", "name": "First Aid", "command": "diskutil verifyVolume {VOLUME}", "description": "Run First Aid on a partition" },
|
|
187
|
+
{ "id": "m29", "name": "Find Large Files", "command": "find / -type f -size +100M 2>/dev/null | head -20", "description": "Find files larger than 100MB" },
|
|
188
|
+
{ "id": "m30", "name": "Purge Disk Space", "command": "purge", "description": "Force purge disk cache" }
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"category": "User & Permissions",
|
|
193
|
+
"commands": [
|
|
194
|
+
{ "id": "m31", "name": "List Users", "command": "dscl . list /Users", "description": "List all system users" },
|
|
195
|
+
{ "id": "m32", "name": "Fix Permissions", "command": "chown -R $(whoami) {PATH}", "description": "Change ownership recursively" },
|
|
196
|
+
{ "id": "m33", "name": "Check Sudo Access", "command": "sudo -l", "description": "List sudo permissions" },
|
|
197
|
+
{ "id": "m34", "name": "Reset Password", "command": "dscl . -passwd /Users/{USERNAME} {PASSWORD}", "description": "Reset user password" },
|
|
198
|
+
{ "id": "m35", "name": "Unlock User Account", "command": "dscl . -delete /Users/{USERNAME} AuthenticationAuthority", "description": "Remove authentication restrictions" }
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"category": "Power",
|
|
203
|
+
"commands": [
|
|
204
|
+
{ "id": "m36", "name": "Shutdown", "command": "shutdown -h now", "description": "Immediate shutdown" },
|
|
205
|
+
{ "id": "m37", "name": "Restart", "command": "shutdown -r now", "description": "Restart the system" },
|
|
206
|
+
{ "id": "m38", "name": "Schedule Shutdown", "command": "shutdown +10", "description": "Schedule shutdown in 10 minutes" },
|
|
207
|
+
{ "id": "m39", "name": "Cancel Shutdown", "command": "shutdown -c", "description": "Cancel scheduled shutdown" },
|
|
208
|
+
{ "id": "m40", "name": "Sleep", "command": "pmset sleepnow", "description": "Put system to sleep immediately" }
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"category": "Logs & Diagnostics",
|
|
213
|
+
"commands": [
|
|
214
|
+
{ "id": "m41", "name": "System Logs", "command": "log show --predicate 'eventMessage contains \"error\"' --last 1h", "description": "Show recent error log entries" },
|
|
215
|
+
{ "id": "m42", "name": "Console Logs", "command": "log show --predicate 'process == \"kernel\"' --last 30m", "description": "Show recent kernel log entries" },
|
|
216
|
+
{ "id": "m43", "name": "Crash Reports", "command": "ls ~/Library/Logs/DiagnosticReports/", "description": "List crash report files" },
|
|
217
|
+
{ "id": "m44", "name": "Hardware Info", "command": "system_profiler SPHardwareDataType", "description": "Display hardware specifications" },
|
|
218
|
+
{ "id": "m45", "name": "System Diagnostics", "command": "sysdiagnose", "description": "Generate comprehensive system diagnostics" }
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
"website": [
|
|
223
|
+
{
|
|
224
|
+
"category": "Enumeration (Kali Linux)",
|
|
225
|
+
"commands": [
|
|
226
|
+
{ "id": "s1", "name": "Fetch URL Content", "command": "curl {URL}", "description": "Downloads and prints the page content" },
|
|
227
|
+
{ "id": "s2", "name": "WhatWeb Scan", "command": "whatweb -a 4 {IP}", "description": "General web scanner" },
|
|
228
|
+
{ "id": "s3", "name": "Nmap TCP Scan", "command": "nmap -Pn -sV {IP}", "description": "Scan which TCP port/s active in website" },
|
|
229
|
+
{ "id": "s4", "name": "Nmap UDP Scan", "command": "sudo nmap -sU {IP}", "description": "Scan which UDP port/s active in website" },
|
|
230
|
+
{ "id": "s5", "name": "WordPress Scan", "command": "wpscan --url {PROTOCOL}://{IP} --enumerate ap,at,cb,dbe", "description": "WordPress Enumeration" },
|
|
231
|
+
{ "id": "s6", "name": "Directories Scan", "command": "dirsearch -u {URL} -e php,html,js", "description": "Search directory using basic wordlists" },
|
|
232
|
+
{ "id": "s7", "name": "Nikto Scan", "command": "nikto -host {IP}:{PORT} -C all", "description": "Basic Site Info" },
|
|
233
|
+
{ "id": "s8", "name": "Website Crawling", "command": "cewl {URL}", "description": "Basic crawling wordlists from pages" }
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"software": [
|
|
238
|
+
{
|
|
239
|
+
"category": "ReactJS - Vite",
|
|
240
|
+
"commands": [
|
|
241
|
+
{ "id": "sf1", "name": "Create Project", "command": "npm create vite@latest {PROJECT_NAME}", "default": "npm create vite@latest my-app", "description": "Create a new Vite project" },
|
|
242
|
+
{ "id": "sf2", "name": "Install Dependencies", "command": "npm install", "description": "Install all project dependencies" },
|
|
243
|
+
{ "id": "sf3", "name": "Start Dev Server", "command": "npm run dev", "description": "Start Vite development server" },
|
|
244
|
+
{ "id": "sf4", "name": "Build for Production", "command": "npm run build", "description": "Build optimized production bundle" }
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"category": "Publish Package",
|
|
249
|
+
"commands": [
|
|
250
|
+
{ "id": "sf5", "name": "Initialize Package", "command": "npm init", "description": "Initialize a new npm package" },
|
|
251
|
+
{ "id": "sf6", "name": "Login to npm", "command": "npm login", "description": "Authenticate with npm registry" },
|
|
252
|
+
{ "id": "sf7", "name": "Set Auth Token", "command": "npm set //registry.npmjs.org/:_authToken={NPMJS_TOKEN}", "default": "npm set //registry.npmjs.org/:_authToken=your-token-here", "description": "Set npm authentication token" },
|
|
253
|
+
{ "id": "sf8", "name": "Publish Package", "command": "npm publish", "description": "Publish package to npm registry" },
|
|
254
|
+
{ "id": "sf9", "name": "Publish Public Package", "command": "npm publish --access public", "description": "Publish scoped package as public" }
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
}
|