index.html 44 KB

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