index.html 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>🐭 Bye Bye Mouse</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <style>
  8. :root {
  9. /* MacOS-like Light Theme */
  10. --primary-light: #0070E0;
  11. --accent-light: #FF9500;
  12. --bg-light: #f5f5f7;
  13. --text-light: #333;
  14. --card-light: #ffffff;
  15. --border-light: #e0e0e0;
  16. --code-bg-light: #f8f8f8;
  17. --kbd-bg-light: #f0f0f0;
  18. --kbd-text-light: #222;
  19. --shadow-light: 0 4px 32px rgba(0,0,0,0.07);
  20. /* Linux-like Dark Theme */
  21. --primary-dark: #3AD900;
  22. --accent-dark: #FF7700;
  23. --bg-dark: #0a0a0a;
  24. --text-dark: #e0e0e0;
  25. --card-dark: #1a1a1a;
  26. --border-dark: #333;
  27. --code-bg-dark: #23272e;
  28. --kbd-bg-dark: #222;
  29. --kbd-text-dark: #e0e0e0;
  30. --shadow-dark: 0 4px 32px rgba(0,0,0,0.3);
  31. }
  32. html {
  33. scroll-behavior: smooth;
  34. }
  35. body {
  36. font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Arial, sans-serif;
  37. background: var(--bg-light);
  38. color: var(--text-light);
  39. margin: 0;
  40. padding: 0;
  41. transition: background 0.3s, color 0.3s;
  42. }
  43. body.dark {
  44. font-family: 'Ubuntu Mono', 'Fira Code', monospace;
  45. background: var(--bg-dark);
  46. color: var(--text-dark);
  47. }
  48. header {
  49. background: linear-gradient(90deg, var(--primary-light) 0%, var(--accent-light) 100%);
  50. color: #fff;
  51. padding: 2rem 0 1rem 0;
  52. text-align: center;
  53. position: relative;
  54. }
  55. body.dark header {
  56. background: linear-gradient(90deg, var(--primary-dark) 0%, var(--accent-dark) 100%);
  57. }
  58. .toggle-mode {
  59. position: absolute;
  60. top: 1.5rem;
  61. right: 2rem;
  62. background: rgba(255,255,255,0.15);
  63. border: none;
  64. border-radius: 2rem;
  65. padding: 0.5rem 1.2rem;
  66. color: #fff;
  67. font-size: 1rem;
  68. cursor: pointer;
  69. transition: background 0.2s;
  70. }
  71. .toggle-mode:hover {
  72. background: rgba(0,0,0,0.15);
  73. }
  74. .repo-link {
  75. position: absolute;
  76. top: 1.5rem;
  77. right: 10rem;
  78. background: rgba(255,255,255,0.15);
  79. border: none;
  80. border-radius: 2rem;
  81. padding: 0.5rem 1.2rem;
  82. color: #fff;
  83. font-size: 1rem;
  84. cursor: pointer;
  85. transition: background 0.2s;
  86. text-decoration: none;
  87. display: inline-block;
  88. }
  89. .repo-link:hover {
  90. background: rgba(0,0,0,0.15);
  91. }
  92. h1 {
  93. font-size: 2.5rem;
  94. margin: 0 0 0.5rem 0;
  95. letter-spacing: -1px;
  96. }
  97. .marquee {
  98. font-size: 1.1rem;
  99. color: #fff;
  100. background: rgba(0,0,0,0.08);
  101. padding: 0.5rem 0;
  102. border-radius: 1rem;
  103. margin: 0 auto 1rem auto;
  104. max-width: 600px;
  105. overflow: hidden;
  106. white-space: nowrap;
  107. box-sizing: border-box;
  108. animation: marquee 15s linear infinite;
  109. }
  110. @keyframes marquee {
  111. 0% { text-indent: 100% }
  112. 100% { text-indent: -100% }
  113. }
  114. main {
  115. max-width: 900px;
  116. margin: 2rem auto;
  117. padding: 2rem;
  118. background: var(--card-light);
  119. border-radius: 1.5rem;
  120. box-shadow: var(--shadow-light);
  121. border: 1px solid var(--border-light);
  122. transition: background 0.3s, border 0.3s;
  123. }
  124. body.dark main {
  125. background: var(--card-dark);
  126. border: 1px solid var(--border-dark);
  127. box-shadow: var(--shadow-dark);
  128. }
  129. h2, h3 {
  130. color: var(--primary-light);
  131. margin-top: 2.5rem;
  132. margin-bottom: 1rem;
  133. font-weight: 700;
  134. }
  135. body.dark h2, body.dark h3 {
  136. color: var(--primary-dark);
  137. }
  138. h3 {
  139. font-size: 1.3rem;
  140. margin-top: 2rem;
  141. }
  142. p {
  143. line-height: 1.7;
  144. margin: 1rem 0;
  145. }
  146. ul, ol {
  147. margin: 1rem 0 1rem 2rem;
  148. }
  149. a {
  150. color: var(--primary-light);
  151. text-decoration: none;
  152. transition: color 0.2s;
  153. }
  154. body.dark a {
  155. color: var(--primary-dark);
  156. }
  157. a:hover {
  158. color: var(--accent-light);
  159. text-decoration: underline;
  160. }
  161. body.dark a:hover {
  162. color: var(--accent-dark);
  163. }
  164. .toc {
  165. background: var(--code-bg-light);
  166. border-radius: 1rem;
  167. padding: 1.2rem 1.5rem;
  168. margin-bottom: 2rem;
  169. border: 1px solid var(--border-light);
  170. font-size: 1.05rem;
  171. box-shadow: 0 2px 8px 0 rgba(0,0,0,0.03);
  172. }
  173. body.dark .toc {
  174. background: var(--code-bg-dark);
  175. border: 1px solid var(--border-dark);
  176. }
  177. .toc ol {
  178. margin: 0;
  179. padding-left: 1.2rem;
  180. }
  181. .toc li {
  182. margin-bottom: 0.3rem;
  183. }
  184. code, pre {
  185. font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  186. background: var(--code-bg-light);
  187. color: #2d2d2d;
  188. border-radius: 0.5rem;
  189. padding: 0.2em 0.5em;
  190. font-size: 1em;
  191. transition: background 0.3s, color 0.3s;
  192. }
  193. pre {
  194. display: block;
  195. padding: 1em;
  196. margin: 1.2em 0;
  197. overflow-x: auto;
  198. background: var(--code-bg-light);
  199. color: #2d2d2d;
  200. border: 1px solid var(--border-light);
  201. }
  202. body.dark code, body.dark pre {
  203. background: var(--code-bg-dark);
  204. color: #f7f8fa;
  205. border-color: var(--border-dark);
  206. }
  207. .note {
  208. background: var(--accent-light);
  209. color: #222;
  210. padding: 0.7em 1em;
  211. border-radius: 0.7em;
  212. margin: 1em 0;
  213. font-size: 1.05em;
  214. font-weight: 500;
  215. display: inline-block;
  216. }
  217. body.dark .note {
  218. background: var(--accent-dark);
  219. }
  220. .table-wrap {
  221. overflow-x: auto;
  222. margin: 2em 0;
  223. }
  224. table {
  225. width: 100%;
  226. border-collapse: collapse;
  227. margin: 1.5em 0;
  228. font-size: 1em;
  229. background: var(--code-bg-light);
  230. border-radius: 1em;
  231. overflow: hidden;
  232. box-shadow: 0 2px 8px 0 rgba(0,0,0,0.03);
  233. transition: background 0.3s;
  234. }
  235. body.dark table {
  236. background: var(--code-bg-dark);
  237. }
  238. th, td {
  239. padding: 0.7em 1em;
  240. border-bottom: 1px solid var(--border-light);
  241. text-align: left;
  242. }
  243. body.dark th, body.dark td {
  244. border-bottom: 1px solid var(--border-dark);
  245. }
  246. th {
  247. background: var(--primary-light);
  248. color: #fff;
  249. font-weight: 700;
  250. }
  251. body.dark th {
  252. background: var(--primary-dark);
  253. }
  254. kbd {
  255. background: var(--kbd-bg-light);
  256. color: var(--kbd-text-light);
  257. border-radius: 0.3em;
  258. padding: 0.2em 0.5em;
  259. font-size: 1em;
  260. font-family: inherit;
  261. border: 1px solid var(--border-light);
  262. box-shadow: 0 1px 2px 0 rgba(0,0,0,0.04);
  263. margin: 0 0.1em;
  264. display: inline-block;
  265. transition: background 0.3s, color 0.3s, border 0.3s;
  266. }
  267. body.dark kbd {
  268. background: var(--kbd-bg-dark);
  269. color: var(--kbd-text-dark);
  270. border: 1px solid var(--border-dark);
  271. }
  272. .back-to-top {
  273. display: inline-block;
  274. margin-top: 1.5em;
  275. font-size: 0.95em;
  276. color: var(--primary-light);
  277. text-decoration: none;
  278. border-bottom: 1px dashed var(--primary-light);
  279. transition: color 0.2s, border 0.2s;
  280. }
  281. body.dark .back-to-top {
  282. color: var(--primary-dark);
  283. border-bottom: 1px dashed var(--primary-dark);
  284. }
  285. .back-to-top:hover {
  286. color: var(--accent-light);
  287. border-bottom: 1px dashed var(--accent-light);
  288. }
  289. body.dark .back-to-top:hover {
  290. color: var(--accent-dark);
  291. border-bottom: 1px dashed var(--accent-dark);
  292. }
  293. footer {
  294. text-align: center;
  295. padding: 2rem 0;
  296. margin-top: 2rem;
  297. }
  298. .love-btn {
  299. background: linear-gradient(90deg, var(--primary-light) 0%, var(--accent-light) 100%);
  300. color: white;
  301. padding: 0.8rem 2rem;
  302. border-radius: 2rem;
  303. text-decoration: none;
  304. font-weight: 600;
  305. box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  306. transition: transform 0.2s, box-shadow 0.2s;
  307. display: inline-block;
  308. }
  309. body.dark .love-btn {
  310. background: linear-gradient(90deg, var(--primary-dark) 0%, var(--accent-dark) 100%);
  311. }
  312. .love-btn:hover {
  313. transform: translateY(-2px);
  314. box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  315. text-decoration: none;
  316. }
  317. .theme-indicator {
  318. position: fixed;
  319. bottom: 10px;
  320. right: 10px;
  321. padding: 5px 10px;
  322. border-radius: 3px;
  323. font-size: 12px;
  324. font-family: monospace;
  325. z-index: 1000;
  326. background: var(--primary-light);
  327. color: white;
  328. }
  329. body.dark .theme-indicator {
  330. background: var(--primary-dark);
  331. color: #0a0a0a;
  332. }
  333. @media (max-width: 700px) {
  334. main {
  335. padding: 1rem;
  336. margin: 1rem;
  337. }
  338. .toc {
  339. padding: 1rem;
  340. }
  341. header {
  342. padding: 1.5rem 0 0.7rem 0;
  343. }
  344. .toggle-mode, .repo-link {
  345. position: static;
  346. display: block;
  347. margin: 0.5rem auto;
  348. width: fit-content;
  349. }
  350. h1 {
  351. font-size: 2rem;
  352. }
  353. .marquee {
  354. font-size: 1rem;
  355. max-width: 90%;
  356. }
  357. }
  358. </style>
  359. <!-- Enhanced 3D and theme polish -->
  360. <style>
  361. /* ---------- THEME TUNE-UP ---------- */
  362. :root {
  363. /* Light theme tune-up */
  364. --primary-light: #2563eb; /* richer blue */
  365. --accent-light: #f97316; /* warm orange */
  366. --bg-light: #f6f8fb; /* softer background */
  367. --text-light: #0f172a;
  368. --card-light: #ffffff;
  369. --border-light: #e6e8ee;
  370. --code-bg-light: #f2f5f9;
  371. --kbd-bg-light: #eef2f6;
  372. --kbd-text-light: #0f172a;
  373. --shadow-light-1: 0 2px 10px rgba(28, 35, 49, 0.08), 0 8px 32px rgba(28, 35, 49, 0.08);
  374. --shadow-light-2: 0 12px 30px rgba(28, 35, 49, 0.12), 0 30px 60px rgba(28, 35, 49, 0.10);
  375. }
  376. body.dark {
  377. /* Dark theme tune-up */
  378. --primary-dark: #30e06a; /* softer neon green */
  379. --accent-dark: #ff7a18; /* warm orange */
  380. --bg-dark: #0b1220; /* deep navy */
  381. --text-dark: #e6edf3;
  382. --card-dark: #0f172a; /* slate */
  383. --border-dark: #1a2333;
  384. --code-bg-dark: #0b1324; /* midnight */
  385. --kbd-bg-dark: #0e1a2b;
  386. --kbd-text-dark: #e6edf3;
  387. --shadow-dark-1: 0 12px 30px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 0, 0, 0.35);
  388. --shadow-dark-2: 0 24px 60px rgba(0, 0, 0, 0.55), 0 12px 24px rgba(0, 0, 0, 0.45);
  389. }
  390. /* Background ambiance */
  391. body {
  392. background:
  393. radial-gradient(1200px 400px at -10% -10%, rgba(37, 99, 235, 0.08), transparent 60%),
  394. radial-gradient(700px 300px at 110% 110%, rgba(249, 115, 22, 0.08), transparent 65%),
  395. var(--bg-light);
  396. }
  397. body.dark {
  398. background:
  399. radial-gradient(1000px 400px at -10% -10%, rgba(48, 224, 106, 0.08), transparent 60%),
  400. radial-gradient(900px 500px at 110% 120%, rgba(255, 122, 24, 0.06), transparent 70%),
  401. var(--bg-dark);
  402. }
  403. /* Optional noise texture for subtle texture */
  404. body::after {
  405. content: "";
  406. position: fixed; inset: 0;
  407. pointer-events: none;
  408. background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='.0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0 0 .06'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  409. opacity: .4;
  410. mix-blend-mode: soft-light;
  411. }
  412. /* Header with 3D sheen */
  413. header {
  414. position: relative;
  415. overflow: hidden;
  416. border-bottom: 1px solid var(--border-light);
  417. box-shadow: var(--shadow-light-1);
  418. background: linear-gradient(120deg, var(--primary-light) 0%, #60a5fa 40%, var(--accent-light) 100%);
  419. }
  420. body.dark header {
  421. border-bottom: 1px solid var(--border-dark);
  422. box-shadow: var(--shadow-dark-1);
  423. background:
  424. radial-gradient(120% 100% at 10% -10%, rgba(48,224,106,0.25), transparent 60%),
  425. radial-gradient(100% 120% at 110% 120%, rgba(255,122,24,0.15), transparent 65%),
  426. linear-gradient(120deg, #0d1220, #101a2e 60%, #0d1326);
  427. }
  428. header::after {
  429. content: "";
  430. position: absolute; inset: 0;
  431. background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 40%);
  432. pointer-events: none;
  433. z-index: 1;
  434. }
  435. /* Keep header content above orbs */
  436. header .repo-link,
  437. header .toggle-mode,
  438. header h1,
  439. header .marquee,
  440. header p {
  441. position: relative;
  442. z-index: 2;
  443. }
  444. /* 3D parallax decorative orbs */
  445. .hero-orbs {
  446. position: absolute; inset: 0;
  447. overflow: hidden; pointer-events: none;
  448. z-index: 1;
  449. }
  450. .orb {
  451. position: absolute;
  452. border-radius: 50%;
  453. filter: blur(1px) saturate(1.1);
  454. transform: translateZ(0);
  455. transition: transform .2s ease-out;
  456. }
  457. .orb-1 { width: 160px; height: 160px; background: radial-gradient(circle at 30% 30%, #fff, rgba(37,99,235,.5) 30%, transparent 60%); top: -30px; left: -30px; opacity: .5; }
  458. .orb-2 { width: 220px; height: 220px; background: radial-gradient(circle at 60% 40%, #fff, rgba(48,224,106,.45) 35%, transparent 65%); bottom: -60px; right: -40px; opacity: .45; }
  459. .orb-3 { width: 120px; height: 120px; background: radial-gradient(circle at 40% 60%, #fff, rgba(255,122,24,.45) 35%, transparent 65%); top: 30px; right: 20%; opacity: .35; }
  460. body.dark .orb-1 { opacity: .35; }
  461. body.dark .orb-2 { opacity: .3; }
  462. body.dark .orb-3 { opacity: .25; }
  463. /* 3D main wrapper */
  464. main {
  465. border-radius: 1.25rem;
  466. border: 1px solid var(--border-light);
  467. background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,.7)) !important;
  468. box-shadow: var(--shadow-light-2);
  469. backdrop-filter: blur(8px) saturate(1.05);
  470. }
  471. body.dark main {
  472. border: 1px solid var(--border-dark);
  473. background:
  474. radial-gradient(200% 140% at 0% 0%, rgba(48,224,106,0.03), transparent 35%),
  475. radial-gradient(180% 140% at 100% 100%, rgba(255,122,24,0.03), transparent 40%),
  476. linear-gradient(180deg, rgba(12,19,35,.85), rgba(14,21,41,.85)) !important;
  477. box-shadow: var(--shadow-dark-2);
  478. backdrop-filter: blur(10px) saturate(1.1);
  479. }
  480. /* Sections as 3D cards with tilt */
  481. main { perspective: 900px; }
  482. main section {
  483. background: var(--card-light);
  484. border: 1px solid var(--border-light);
  485. border-radius: 1rem;
  486. padding: 1.1rem 1rem 1.2rem;
  487. margin: 1.25rem 0;
  488. box-shadow: var(--shadow-light-1);
  489. transform-style: preserve-3d;
  490. will-change: transform;
  491. transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  492. }
  493. main section:hover {
  494. box-shadow: 0 12px 35px rgba(28, 35, 49, 0.14);
  495. }
  496. body.dark main section {
  497. background: linear-gradient(180deg, rgba(18,26,44,.9), rgba(16,24,42,.9));
  498. border: 1px solid var(--border-dark);
  499. box-shadow: var(--shadow-dark-1);
  500. }
  501. body.dark main section:hover {
  502. box-shadow: 0 26px 60px rgba(0,0,0,.55), 0 8px 20px rgba(0,0,0,.45);
  503. }
  504. /* Headings */
  505. h2, h3 {
  506. letter-spacing: -0.2px;
  507. text-shadow: 0 1px 0 rgba(255,255,255,.35);
  508. }
  509. body.dark h2, body.dark h3 {
  510. text-shadow: 0 0 0 transparent;
  511. }
  512. /* Glassy buttons with 3D depth */
  513. .repo-link,
  514. .toggle-mode {
  515. position: absolute;
  516. background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  517. border: 1px solid rgba(255,255,255,.35);
  518. box-shadow: 0 8px 16px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.35);
  519. backdrop-filter: blur(6px) saturate(1.1);
  520. color: #fff;
  521. text-shadow: 0 1px 0 rgba(0,0,0,.25);
  522. }
  523. body.dark .repo-link,
  524. body.dark .toggle-mode {
  525. background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  526. border: 1px solid rgba(255,255,255,.12);
  527. box-shadow: 0 12px 22px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  528. }
  529. /* 3D toggle switch style */
  530. .toggle-mode {
  531. right: 2rem;
  532. padding: .5rem 2.6rem .5rem .9rem;
  533. border-radius: 999px;
  534. font-weight: 600;
  535. transform: translateZ(0);
  536. }
  537. .toggle-mode::before {
  538. content: "";
  539. position: absolute;
  540. right: .4rem; top: 50%;
  541. width: 1.6rem; height: 1.6rem;
  542. border-radius: 50%;
  543. transform: translateY(-50%);
  544. background: radial-gradient(circle at 30% 30%, #fff, rgba(255,255,255,.3) 40%, rgba(0,0,0,.02) 60%);
  545. box-shadow: 0 6px 12px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.5);
  546. transition: right .25s ease, background .2s ease, transform .2s ease;
  547. }
  548. body.dark .toggle-mode {
  549. padding-left: 2.6rem; padding-right: .9rem;
  550. }
  551. body.dark .toggle-mode::before {
  552. right: auto; left: .4rem;
  553. background: radial-gradient(circle at 35% 35%, #7cffb0, rgba(48,224,106,.35) 35%, rgba(0,0,0,.05) 60%);
  554. }
  555. /* Notes with depth */
  556. .note {
  557. border-radius: .8rem;
  558. background: linear-gradient(180deg, #ffedcc, #ffd39b);
  559. color: #4b2c00;
  560. border: 1px solid #f8c887;
  561. box-shadow: 0 10px 22px rgba(255,149,0,.18), inset 0 1px 0 rgba(255,255,255,.6);
  562. }
  563. body.dark .note {
  564. background: linear-gradient(180deg, rgba(255,122,24,.18), rgba(255,122,24,.12));
  565. color: #ffe9d5;
  566. border: 1px solid rgba(255,122,24,.35);
  567. box-shadow: 0 10px 22px rgba(255,122,24,.22), inset 0 1px 0 rgba(255,255,255,.06);
  568. }
  569. /* Code blocks with accent edge and glow */
  570. pre {
  571. background: var(--code-bg-light);
  572. border-left: 3px solid var(--primary-light);
  573. box-shadow: 0 12px 24px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.4);
  574. }
  575. body.dark pre {
  576. background: linear-gradient(180deg, rgba(12,19,35,.6), rgba(12,19,35,.5));
  577. border-color: var(--primary-dark);
  578. box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 0 1px rgba(48,224,106,.08) inset;
  579. }
  580. /* Tables and kbd tweaks */
  581. table {
  582. box-shadow: 0 8px 24px rgba(0,0,0,.06);
  583. }
  584. body.dark table {
  585. box-shadow: 0 16px 40px rgba(0,0,0,.35);
  586. }
  587. kbd {
  588. box-shadow: 0 2px 4px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.5);
  589. }
  590. body.dark kbd {
  591. box-shadow: 0 2px 4px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  592. }
  593. /* Smooth marquee (GPU-friendly) */
  594. .marquee {
  595. overflow: hidden;
  596. white-space: nowrap;
  597. display: block;
  598. animation: marqueeX 16s linear infinite;
  599. }
  600. @keyframes marqueeX {
  601. 0% { transform: translateX(100%); }
  602. 100% { transform: translateX(-100%); }
  603. }
  604. /* Theme indicator badge */
  605. .theme-indicator {
  606. box-shadow: 0 8px 20px rgba(0,0,0,.15);
  607. }
  608. /* Scrollbar (webkit) */
  609. *::-webkit-scrollbar { height: 10px; width: 10px; }
  610. *::-webkit-scrollbar-thumb {
  611. background: linear-gradient(180deg, var(--primary-light), var(--accent-light));
  612. border-radius: 999px;
  613. }
  614. body.dark *::-webkit-scrollbar-thumb {
  615. background: linear-gradient(180deg, var(--primary-dark), var(--accent-dark));
  616. }
  617. /* Mobile polishing */
  618. @media (max-width: 700px) {
  619. main section { padding: 1rem; }
  620. .repo-link, .toggle-mode { position: static; margin: .5rem .5rem 0 0; display: inline-flex; }
  621. }
  622. /* Accessibility: respect reduced motion */
  623. @media (prefers-reduced-motion: reduce) {
  624. .marquee, .orb { animation: none; transition: none; }
  625. main section { transition: none; }
  626. }
  627. </style>
  628. </head>
  629. <body>
  630. <header>
  631. <a href="https://gitgog.alwaysdata.net/parv.ashwani/ByeByeMouse.git"
  632. class="repo-link"
  633. target="_blank">📁 Repo Link</a>
  634. <button class="toggle-mode" id="toggleModeBtn" aria-label="Toggle light/dark mode">🌙 Dark</button>
  635. <h1>🐭 Bye Bye Mouse</h1>
  636. <div class="marquee">Because real power users don't double-click—they type :)</div>
  637. <!-- 3D floating orbs (decorative) -->
  638. <div class="hero-orbs" aria-hidden="true">
  639. <span class="orb orb-1"></span>
  640. <span class="orb orb-2"></span>
  641. <span class="orb orb-3"></span>
  642. </div>
  643. <p style="margin:0.5em 0 0 0; font-size:1.1em; font-weight:500;">Escape the tyranny of the GUI one command at a time! This repo is your golden ticket to slick shell tricks, terminal wizardry, and keyboard-fueled productivity. Unplug that mouse and watch your workflow sprint.</p>
  644. </header>
  645. <main>
  646. <section class="toc" id="quick-links">
  647. <h2 style="margin-top:0;">Quick Links</h2>
  648. <ol>
  649. <li><a href="#copy-a-file">copy a file</a></li>
  650. <li><a href="#duplicate-a-file">duplicate a file</a></li>
  651. <li><a href="#copy-a-directory">copy a directory</a></li>
  652. <li><a href="#duplicate-a-directory">duplicate a directory</a></li>
  653. <li><a href="#move-a-file">move a file</a></li>
  654. <li><a href="#rename-a-file">rename a file</a></li>
  655. <li><a href="#move-a-directory">move a directory</a></li>
  656. <li><a href="#rename-a-directory">rename a directory</a></li>
  657. <li><a href="#merge-directories">merge directories</a></li>
  658. <li><a href="#create-a-new-file">create a new file</a></li>
  659. <li><a href="#create-a-new-directory">create a new directory</a></li>
  660. <li><a href="#show-filedirectory-size">show file/directory size</a></li>
  661. <li><a href="#show-filedirectory-info">show file/directory info</a></li>
  662. <li><a href="#open-a-file-with-the-default-program">open a file with the default program</a></li>
  663. <li><a href="#open-a-file-in-any-application">open a file in any application</a></li>
  664. <li><a href="#zip-a-directory">zip a directory</a></li>
  665. <li><a href="#unzip-a-directory">unzip a directory</a></li>
  666. <li><a href="#peek-files-in-a-zip-file">peek files in a zip file</a></li>
  667. <li><a href="#remove-a-file">remove a file</a></li>
  668. <li><a href="#remove-a-directory">remove a directory</a></li>
  669. <li><a href="#remove-all-files-of-certain-criteria">remove all files of certain criteria</a></li>
  670. <li><a href="#list-directory-contents">list directory contents</a></li>
  671. <li><a href="#tree-view-a-directory-and-its-subdirectories">tree view a directory and its subdirectories</a></li>
  672. <li><a href="#find-a-stale-file">find a stale file</a></li>
  673. <li><a href="#show-a-calendar">show a calendar</a></li>
  674. <li><a href="#find-a-future-date">find a future date</a></li>
  675. <li><a href="#use-a-calculator">use a calculator</a></li>
  676. <li><a href="#force-quit-a-program">force quit a program</a></li>
  677. <li><a href="#check-server-response">check server response</a></li>
  678. <li><a href="#view-content-of-a-file">view content of a file</a></li>
  679. <li><a href="#search-for-a-text-in-a-file">search for a text in a file</a></li>
  680. <li><a href="#search-in-all-files-in-current-working-directory-quickly-entire-disk-in-less-than-15-minutes">search in all files in current working directory, quickly (entire disk in less than 15 minutes)</a></li>
  681. <li><a href="#view-an-image">view an image</a></li>
  682. <li><a href="#show-disk-size">show disk size</a></li>
  683. <li><a href="#check-cpu-usage-processes-and-ram">check cpu usage, processes and RAM</a></li>
  684. <li><a href="#know-whether-your-computer-is-under-load-and-whether-its-due-to-memory-or-cpu">know whether your computer is under load, and whether it's due to memory or CPU</a></li>
  685. <li><a href="#poweroff-or-reboot-your-computer">poweroff or reboot your computer</a></li>
  686. <li><a href="#locate-usb-drives">locate USB drives</a></li>
  687. <li><a href="#unmount-usb-drives">unmount USB drives</a></li>
  688. <li><a href="#format-usb-drives">format USB drives</a></li>
  689. <li><a href="#check-usb-format">check USB format</a></li>
  690. <li><a href="#run-command-on-all-files-of-a-directory">run command on all files of a directory</a></li>
  691. <li><a href="#check-network-connectivity-to-a-remote-address-and-port">check network connectivity to a remote address and port</a></li>
  692. <li><a href="#check-dns-config-of-a-domain">check DNS config of a domain</a></li>
  693. <li><a href="#check-the-ownership-and-registration-of-a-domain">check the ownership and registration of a domain</a></li>
  694. <li><a href="#hotkeys">Hotkeys</a></li>
  695. <li><a href="#i-cant-remember-these-cryptic-commands">I can't remember these cryptic commands</a></li>
  696. </ol>
  697. </section>
  698. <section id="copy-a-file">
  699. <h3>copy a file</h3>
  700. <div class="note">STOP DRAG AND DROPPING A FILE, OR CMD/CTRL + C, CMD/CTRL + V A FILE 👎</div>
  701. <p>Copy <code>readme.txt</code> to the <code>documents</code> directory</p>
  702. <pre><code>$ cp readme.txt documents/</code></pre>
  703. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  704. </section>
  705. <section id="duplicate-a-file">
  706. <h3>duplicate a file</h3>
  707. <div class="note">STOP RIGHT CLICKING AND DUPLICATE A FILE 👎</div>
  708. <pre><code>$ cp readme.txt readme.bak.txt</code></pre>
  709. <p>More advanced:</p>
  710. <pre><code>$ cp readme{,.bak}.txt
  711. # Note: learn how the {} works with touch foo{1,2,3}.txt and see what happens.</code></pre>
  712. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  713. </section>
  714. <section id="copy-a-directory">
  715. <h3>copy a directory</h3>
  716. <div class="note">STOP DRAG AND DROPPING A DIRECTORY, OR CMD/CTRL + C, CMD/CTRL + V A DIRECTORY 👎</div>
  717. <p>Copy <code>myMusic</code> directory to the <code>myMedia</code> directory</p>
  718. <pre><code>$ cp -a myMusic myMedia/
  719. # or
  720. $ cp -a myMusic/ myMedia/myMusic/</code></pre>
  721. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  722. </section>
  723. <section id="duplicate-a-directory">
  724. <h3>duplicate a directory</h3>
  725. <div class="note">STOP RIGHT CLICKING AND DUPLICATE A DIRECTORY 👎</div>
  726. <pre><code>$ cp -a myMusic/ myMedia/
  727. # or if `myMedia` folder doesn't exist
  728. $ cp -a myMusic myMedia/</code></pre>
  729. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  730. </section>
  731. <section id="move-a-file">
  732. <h3>move a file</h3>
  733. <div class="note">STOP DRAG AND DROPPING A FILE, OR CMD/CTRL + X, CMD/CTRL + V A FILE 👎</div>
  734. <pre><code>$ mv readme.txt documents/</code></pre>
  735. <p><b>Always</b> use a trailing slash when moving files, <a href="http://unix.stackexchange.com/a/50533" target="_blank">for this reason</a>.</p>
  736. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  737. </section>
  738. <section id="rename-a-file">
  739. <h3>rename a file</h3>
  740. <div class="note">STOP RIGHT CLICKING AND RENAME A FILE 👎</div>
  741. <pre><code>$ mv readme.txt README.md</code></pre>
  742. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  743. </section>
  744. <section id="move-a-directory">
  745. <h3>move a directory</h3>
  746. <div class="note">STOP DRAG AND DROPPING A DIRECTORY, OR CMD/CTRL + X, CMD/CTRL + V A DIRECTORY 👎</div>
  747. <pre><code>$ mv myMedia myMusic/
  748. # or
  749. $ mv myMedia/ myMusic/myMedia</code></pre>
  750. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  751. </section>
  752. <section id="rename-a-directory">
  753. <h3>rename a directory</h3>
  754. <div class="note">STOP RIGHT CLICKING AND RENAME A DIRECTORY 👎</div>
  755. <pre><code>$ mv myMedia/ myMusic/</code></pre>
  756. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  757. </section>
  758. <section id="merge-directories">
  759. <h3>merge directories</h3>
  760. <div class="note">STOP DRAG AND DROPPING TO MERGE DIRECTORIES 👎</div>
  761. <pre><code>$ rsync -a /images/ /images2/ # note: may over-write files with the same name, so be careful!</code></pre>
  762. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  763. </section>
  764. <section id="create-a-new-file">
  765. <h3>create a new file</h3>
  766. <div class="note">STOP RIGHT CLICKING AND CREATE A NEW FILE 👎</div>
  767. <pre><code>$ touch 'new file' # updates the file's access and modification timestamp if it already exists
  768. # or
  769. $ > 'new file' # note: erases the content if it already exists</code></pre>
  770. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  771. </section>
  772. <section id="create-a-new-directory">
  773. <h3>create a new directory</h3>
  774. <div class="note">STOP RIGHT CLICKING AND CREATE A NEW DIRECTORY 👎</div>
  775. <pre><code>$ mkdir 'untitled folder'
  776. # or
  777. $ mkdir -p 'path/may/not/exist/untitled folder'</code></pre>
  778. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  779. </section>
  780. <section id="show-filedirectory-size">
  781. <h3>show file/directory size</h3>
  782. <div class="note">STOP RIGHT CLICKING AND SHOW FILE/directory INFO 👎</div>
  783. <pre><code>$ du -sh node_modules/</code></pre>
  784. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  785. </section>
  786. <section id="show-filedirectory-info">
  787. <h3>show file/directory info</h3>
  788. <div class="note">STOP RIGHT CLICKING AND SHOW FILE/DIRECTORY INFO 👎</div>
  789. <pre><code>$ stat -x readme.md # on macOS
  790. $ stat readme.md # on Linux</code></pre>
  791. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  792. </section>
  793. <section id="open-a-file-with-the-default-program">
  794. <h3>open a file with the default program</h3>
  795. <div class="note">STOP DOUBLE CLICKING ON A FILE 👎</div>
  796. <pre><code>$ xdg-open file # on Linux
  797. $ open file # on MacOS
  798. $ start file # on Windows</code></pre>
  799. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  800. </section>
  801. <section id="open-a-file-in-any-application">
  802. <h3>open a file in any application</h3>
  803. <div class="note">STOP RIGHT CLICKING AND OPEN WITH 👎</div>
  804. <pre><code>$ open -a appName file</code></pre>
  805. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  806. </section>
  807. <section id="zip-a-directory">
  808. <h3>zip a directory</h3>
  809. <div class="note">STOP RIGHT CLICKING AND COMPRESS DIRECTORY 👎</div>
  810. <pre><code>$ zip -r archive_name.zip folder_to_compress</code></pre>
  811. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  812. </section>
  813. <section id="unzip-a-directory">
  814. <h3>unzip a directory</h3>
  815. <div class="note">STOP RIGHT CLICKING AND UNCOMPRESS DIRECTORY 👎</div>
  816. <pre><code>$ unzip archive_name.zip</code></pre>
  817. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  818. </section>
  819. <section id="peek-files-in-a-zip-file">
  820. <h3>peek files in a zip file</h3>
  821. <div class="note">STOP USING WinRAR 👎</div>
  822. <pre><code>$ zipinfo archive_name.zip
  823. # or
  824. $ unzip -l archive_name.zip</code></pre>
  825. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  826. </section>
  827. <section id="remove-a-file">
  828. <h3>remove a file</h3>
  829. <div class="note">STOP RIGHT CLICKING AND DELETE A FILE PERMANENTLY 👎</div>
  830. <pre><code>$ rm my_useless_file</code></pre>
  831. <p><b>IMPORTANT</b>: The <code>rm</code> command deletes <code>my_useless_file</code> permanently, which is equivalent to move <code>my_useless_file</code> to Recycle Bin and hit Empty Recycle Bin.</p>
  832. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  833. </section>
  834. <section id="remove-a-directory">
  835. <h3>remove a directory</h3>
  836. <div class="note">STOP RIGHT CLICKING AND DELETE A DIRECTORY PERMANENTLY 👎</div>
  837. <pre><code>$ rm -r my_useless_folder</code></pre>
  838. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  839. </section>
  840. <section id="remove-all-files-of-certain-criteria">
  841. <h3>remove all files of certain criteria</h3>
  842. <pre><code>$ find . -name "*.bak" -type f -delete</code></pre>
  843. <p><b>IMPORTANT</b>: run <code>find . -name "*.bak" -type f</code> first to see exactly which files you will remove.</p>
  844. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  845. </section>
  846. <section id="list-directory-contents">
  847. <h3>list directory contents</h3>
  848. <div class="note">STOP OPENING YOUR FINDER OR FILE EXPLORER 👎</div>
  849. <pre><code>$ ls my_folder # Simple
  850. $ ls -la my_folder # -l: show in list format. -a: show all files, including hidden. -la combines those options.
  851. $ ls -ltrha my_folder # -r: reverse output. -t: sort by time (modified). -h: output human-readable sizes.</code></pre>
  852. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  853. </section>
  854. <section id="tree-view-a-directory-and-its-subdirectories">
  855. <h3>tree view a directory and its subdirectories</h3>
  856. <div class="note">STOP OPENING YOUR FINDER OR FILE EXPLORER 👎</div>
  857. <pre><code>$ tree # on Linux
  858. $ find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' # on MacOS
  859. # Note: install homebrew (https://brew.sh) to be able to use (some) Linux utilities such as tree.
  860. # brew install tree</code></pre>
  861. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  862. </section>
  863. <section id="find-a-stale-file">
  864. <h3>find a stale file</h3>
  865. <div class="note">STOP USING YOUR FILE EXPLORER TO FIND A FILE 👎</div>
  866. <p>Find all files modified more than 5 days ago</p>
  867. <pre><code>$ find my_folder -mtime +5</code></pre>
  868. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  869. </section>
  870. <section id="show-a-calendar">
  871. <h3>show a calendar</h3>
  872. <div class="note">STOP LOOKING UP WHAT THIS MONTH LOOKS LIKE BY CALENDAR WIDGETS 👎</div>
  873. <p>Display a text calendar</p>
  874. <pre><code>$ cal</code></pre>
  875. <p>Display selected month and year calendar</p>
  876. <pre><code>$ cal 11 2018</code></pre>
  877. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  878. </section>
  879. <section id="find-a-future-date">
  880. <h3>find a future date</h3>
  881. <div class="note">STOP USING WEBAPPS TO CALCULATE FUTURE DATES 👎</div>
  882. <p>What is today's date?</p>
  883. <pre><code>$ date +%m/%d/%Y</code></pre>
  884. <p>What about a week from now?</p>
  885. <pre><code>$ date -d "+7 days" # on Linux
  886. $ date -j -v+7d # on MacOS</code></pre>
  887. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  888. </section>
  889. <section id="use-a-calculator">
  890. <h3>use a calculator</h3>
  891. <div class="note">STOP USING CALCULATOR WIDGET 👎</div>
  892. <pre><code>$ bc -l</code></pre>
  893. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  894. </section>
  895. <section id="force-quit-a-program">
  896. <h3>force quit a program</h3>
  897. <div class="note">STOP CTRL + ALT + DELETE and choose the program to kill 👎</div>
  898. <pre><code>$ killall -9 program_name</code></pre>
  899. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  900. </section>
  901. <section id="check-server-response">
  902. <h3>check server response</h3>
  903. <div class="note">STOP OPENING A BROWSER 👎</div>
  904. <pre><code>$ curl -i rbtreevi.web.app
  905. # curl's -i (--include) option includes HTTP response headers in its output.</code></pre>
  906. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  907. </section>
  908. <section id="view-content-of-a-file">
  909. <h3>view content of a file</h3>
  910. <div class="note">STOP DOUBLE CLICKING A FILE 👎</div>
  911. <pre><code>$ cat apps/settings.py
  912. # if the file is too big to fit on one page, you can use a 'pager' (less) which shows you one page at a time.
  913. $ less apps/settings.py</code></pre>
  914. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  915. </section>
  916. <section id="search-for-a-text-in-a-file">
  917. <h3>search for a text in a file</h3>
  918. <div class="note">STOP CMD/CTRL + F IN A FILE 👎</div>
  919. <pre><code>$ grep -i "Query" file.txt</code></pre>
  920. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  921. </section>
  922. <section id="search-in-all-files-in-current-working-directory-quickly-entire-disk-in-less-than-15-minutes">
  923. <h3>search in all files in current working directory, quickly (entire disk in less than 15 minutes)</h3>
  924. <div class="note">STOP CMD/CTRL + F IN A DIRECTORY 👎</div>
  925. <pre><code>$ ripgrep -i "Query"
  926. # brew install ripgrep</code></pre>
  927. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  928. </section>
  929. <section id="view-an-image">
  930. <h3>view an image</h3>
  931. <div class="note">STOP USING PREVIEW 👎</div>
  932. <pre><code>$ imgcat image.png
  933. # Note: requires iTerm2 terminal.</code></pre>
  934. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  935. </section>
  936. <section id="show-disk-size">
  937. <h3>show disk size</h3>
  938. <div class="note">STOP RIGHT CLICKING DISK ICON OR OPENING DISK UTILITY 👎</div>
  939. <pre><code>$ df -h</code></pre>
  940. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  941. </section>
  942. <section id="check-cpu-usage-processes-and-ram">
  943. <h3>check cpu usage, processes and RAM</h3>
  944. <div class="note">STOP OPENING YOUR ACTIVITY MONITOR OR TASK MANAGER 👎</div>
  945. <pre><code>$ top</code></pre>
  946. <p>if you want some more details:</p>
  947. <pre><code>$ htop</code></pre>
  948. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  949. </section>
  950. <section id="know-whether-your-computer-is-under-load-and-whether-its-due-to-memory-or-cpu">
  951. <h3>know whether your computer is under load, and whether it's due to memory or CPU</h3>
  952. <pre><code>$ glances
  953. # brew install glances
  954. # pip install --user 'glances[all]'</code></pre>
  955. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  956. </section>
  957. <section id="poweroff-or-reboot-your-computer">
  958. <h3>poweroff or reboot your computer</h3>
  959. <p>This can be useful when you're patching a server that is accessed via SSH and you don't have a GUI.</p>
  960. <pre><code># poweroff
  961. $ sudo shutdown -h now
  962. # reboot
  963. $ sudo shutdown -r now</code></pre>
  964. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  965. </section>
  966. <section id="locate-usb-drives">
  967. <h3>locate USB drives</h3>
  968. <pre><code>$ df</code></pre>
  969. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  970. </section>
  971. <section id="unmount-usb-drives">
  972. <h3>unmount USB drives</h3>
  973. <pre><code>$ sudo umount /dev/sdb1</code></pre>
  974. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  975. </section>
  976. <section id="format-usb-drives">
  977. <h3>format USB drives</h3>
  978. <pre><code># FAT32
  979. $ sudo mkfs.vfat /dev/sdb1
  980. # NTFS
  981. $ sudo mkfs.ntfs /dev/sdb1
  982. # exFAT
  983. $ sudo mkfs.exfat /dev/sdb1</code></pre>
  984. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  985. </section>
  986. <section id="check-usb-format">
  987. <h3>check USB format</h3>
  988. <pre><code>$ sudo fsck /dev/sdb1</code></pre>
  989. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  990. </section>
  991. <section id="run-command-on-all-files-of-a-directory">
  992. <h3>run command on all files of a directory</h3>
  993. <div class="note">STOP CLICKING THE FILES ONE BY ONE 👎</div>
  994. <pre><code>$ for FILE in *; do echo $FILE; done</code></pre>
  995. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  996. </section>
  997. <section id="check-network-connectivity-to-a-remote-address-and-port">
  998. <h3>check network connectivity to a remote address and port</h3>
  999. <div class="note">STOP USING NETWORK UTILITY</div>
  1000. <pre><code>$ nc -vz www.google.com 443
  1001. $ nc -vz 1.1.1.1 53</code></pre>
  1002. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  1003. </section>
  1004. <section id="check-dns-config-of-a-domain">
  1005. <h3>check DNS config of a domain</h3>
  1006. <div class="note">STOP USING NETWORK UTILITY</div>
  1007. <pre><code>$ dig www.google.com</code></pre>
  1008. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  1009. </section>
  1010. <section id="check-the-ownership-and-registration-of-a-domain">
  1011. <h3>check the ownership and registration of a domain</h3>
  1012. <div class="note">STOP USING NETWORK UTILITY AND THE WEBSITE OF DOMAIN REGISTRATION PROVIDERS</div>
  1013. <pre><code>$ whois www.google.com</code></pre>
  1014. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  1015. </section>
  1016. <section id="hotkeys">
  1017. <h3>Hotkeys</h3>
  1018. <div class="table-wrap">
  1019. <table>
  1020. <thead>
  1021. <tr>
  1022. <th>Hotkey</th>
  1023. <th>Description</th>
  1024. </tr>
  1025. </thead>
  1026. <tbody>
  1027. <tr><td><kbd>Ctrl</kbd>+<kbd>A</kbd></td><td>Go to the beginning of the line you are currently typing on</td></tr>
  1028. <tr><td><kbd>Ctrl</kbd>+<kbd>E</kbd></td><td>Go to the end of the line you are currently typing on</td></tr>
  1029. <tr><td><kbd>Ctrl</kbd>+<kbd>L</kbd></td><td>Clears the Screen, similar to the clear command</td></tr>
  1030. <tr><td><kbd>Ctrl</kbd>+<kbd>U</kbd></td><td>Clears the line before the cursor position. If you are at the end of the line, clears the entire line.</td></tr>
  1031. <tr><td><kbd>Ctrl</kbd>+<kbd>H</kbd></td><td>Same as backspace</td></tr>
  1032. <tr><td><kbd>Ctrl</kbd>+<kbd>R</kbd></td><td>Lets you search through previously used commands</td></tr>
  1033. <tr><td><kbd>Ctrl</kbd>+<kbd>C</kbd></td><td>Kill whatever you are running</td></tr>
  1034. <tr><td><kbd>Ctrl</kbd>+<kbd>D</kbd></td><td>Exit the current shell</td></tr>
  1035. <tr><td><kbd>Ctrl</kbd>+<kbd>Z</kbd></td><td>Puts whatever you are running into a suspended background process. fg restores it.</td></tr>
  1036. <tr><td><kbd>Ctrl</kbd>+<kbd>W</kbd></td><td>Delete the word before the cursor</td></tr>
  1037. <tr><td><kbd>Ctrl</kbd>+<kbd>K</kbd></td><td>Clear the line after the cursor</td></tr>
  1038. <tr><td><kbd>Ctrl</kbd>+<kbd>T</kbd></td><td>Swap the last two characters before the cursor</td></tr>
  1039. <tr><td><kbd>Ctrl</kbd>+<kbd>F</kbd></td><td>Move cursor forward one character</td></tr>
  1040. <tr><td><kbd>Ctrl</kbd>+<kbd>B</kbd></td><td>Move cursor backward one character</td></tr>
  1041. <tr><td><kbd>Esc</kbd>+<kbd>T</kbd></td><td>Swap the last two words before the cursor</td></tr>
  1042. <tr><td><kbd>Alt</kbd>+<kbd>T</kbd></td><td>Same as <kbd>Esc</kbd> + <kbd>T</kbd></td></tr>
  1043. <tr><td><kbd>Alt</kbd>+<kbd>F</kbd></td><td>Move cursor forward one word on the current line</td></tr>
  1044. <tr><td><kbd>Alt</kbd>+<kbd>B</kbd></td><td>Move cursor backward one word on the current line</td></tr>
  1045. <tr><td><kbd>Esc</kbd>+<kbd>F</kbd></td><td>Same as <kbd>Alt</kbd> + <kbd>F</kbd></td></tr>
  1046. <tr><td><kbd>Esc</kbd>+<kbd>B</kbd></td><td>Same as <kbd>Alt</kbd> + <kbd>B</kbd></td></tr>
  1047. <tr><td><kbd>Alt</kbd>+<kbd>.</kbd></td><td>Paste the last word of the most recently command</td></tr>
  1048. <tr><td><kbd>Tab</kbd></td><td>Auto-complete files and directory names</td></tr>
  1049. </tbody>
  1050. </table>
  1051. </div>
  1052. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  1053. </section>
  1054. <section id="i-cant-remember-these-cryptic-commands">
  1055. <h3>I can't remember these cryptic commands</h3>
  1056. <p>You can always google or <code>man</code> the commands you are not familiar with. Or, checkout <a href="https://github.com/tldr-pages/tldr" target="_blank">tldr</a>, a collection of simplified and community-driven man pages.</p>
  1057. <a class="back-to-top" href="#quick-links">Go to table of contents 🔼</a>
  1058. </section>
  1059. </main>
  1060. <footer>
  1061. <a href="https://instagram.com/parvcodes" class="love-btn" target="_blank">
  1062. Made With ❤️ by Parv Ashwani
  1063. </a>
  1064. </footer>
  1065. <div class="theme-indicator" id="themeIndicator">MacOS Theme</div>
  1066. <script>
  1067. // Theme toggle and indicator (upgraded)
  1068. const btn = document.getElementById('toggleModeBtn');
  1069. const themeIndicator = document.getElementById('themeIndicator');
  1070. const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
  1071. const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
  1072. function setMode(dark) {
  1073. document.body.classList.toggle('dark', dark);
  1074. btn.textContent = dark ? '☀️ Light' : '🌙 Dark';
  1075. localStorage.setItem('theme', dark ? 'dark' : 'light');
  1076. // Update theme indicator
  1077. themeIndicator.textContent = dark ? 'Linux Theme' : 'MacOS Theme';
  1078. // Subtle theme transition
  1079. document.body.style.transition = reduceMotion ? '' : 'background 0.5s ease, color 0.5s ease';
  1080. if (!reduceMotion) setTimeout(() => { document.body.style.transition = ''; }, 500);
  1081. }
  1082. (() => {
  1083. const saved = localStorage.getItem('theme');
  1084. if (saved) setMode(saved === 'dark');
  1085. else setMode(prefersDark);
  1086. })();
  1087. btn.onclick = () => setMode(!document.body.classList.contains('dark'));
  1088. // 3D tilt for sections
  1089. function enableTilt() {
  1090. if (reduceMotion) return;
  1091. const cards = document.querySelectorAll('main section');
  1092. const maxTilt = 6; // degrees
  1093. const perspective = 900;
  1094. const scale = 1.004;
  1095. cards.forEach(card => {
  1096. card.style.transform = `perspective(${perspective}px)`;
  1097. card.addEventListener('pointermove', (e) => {
  1098. const rect = card.getBoundingClientRect();
  1099. const x = e.clientX - rect.left;
  1100. const y = e.clientY - rect.top;
  1101. const px = (x / rect.width) - 0.5;
  1102. const py = (y / rect.height) - 0.5;
  1103. const rx = (-py * maxTilt).toFixed(2);
  1104. const ry = (px * maxTilt).toFixed(2);
  1105. card.style.transform = `perspective(${perspective}px) rotateX(${rx}deg) rotateY(${ry}deg) scale(${scale})`;
  1106. });
  1107. card.addEventListener('pointerleave', () => {
  1108. card.style.transform = `perspective(${perspective}px) rotateX(0) rotateY(0) scale(1)`;
  1109. });
  1110. });
  1111. }
  1112. // Parallax orbs
  1113. function enableOrbsParallax() {
  1114. if (reduceMotion) return;
  1115. const orbs = document.querySelectorAll('.orb');
  1116. if (!orbs.length) return;
  1117. document.addEventListener('pointermove', (e) => {
  1118. const cx = window.innerWidth / 2;
  1119. const cy = window.innerHeight / 2;
  1120. const dx = (e.clientX - cx) / cx;
  1121. const dy = (e.clientY - cy) / cy;
  1122. // Subtle movement with layers
  1123. orbs.forEach((orb, i) => {
  1124. const depth = (i + 1) * 6;
  1125. orb.style.transform = `translate(${dx * depth}px, ${dy * depth}px) translateZ(0)`;
  1126. });
  1127. });
  1128. }
  1129. // Init 3D niceties
  1130. enableTilt();
  1131. enableOrbsParallax();
  1132. </script>
  1133. </body>
  1134. </html>