├── .eslintignore ├── static └── favicon.ico ├── src ├── markdown │ ├── npm.md │ ├── apache.md │ ├── bmake.md │ ├── eclipse.md │ ├── nginx.md │ ├── ruby-on-rails.md │ ├── java.md │ ├── geany.md │ ├── gedit.md │ ├── php-gd.md │ ├── redis.md │ ├── sublime-text.md │ ├── php-mysql.md │ ├── postgresql.md │ ├── build-essential.md │ ├── homebrew.md │ ├── kotlin.md │ ├── curl.md │ ├── scoop.md │ ├── vlc.md │ ├── make.md │ ├── snap.md │ ├── wget.md │ ├── emacs.md │ ├── deluge.md │ ├── nvm.md │ ├── atom.md │ ├── brackets.md │ ├── vim.md │ ├── qbittorrent.md │ ├── transmission.md │ ├── php.md │ ├── virtualbox.md │ ├── zip.md │ ├── unzip.md │ ├── net-tools.md │ ├── tar.md │ ├── docker.md │ ├── git.md │ ├── python.md │ ├── yarn.md │ ├── nano.md │ ├── chocolatey.md │ ├── ruby.md │ ├── nodejs.md │ └── mongodb.md ├── utils │ ├── clamp.js │ └── classes.js ├── fonts │ ├── MontserratAlternates-Black.ttf │ ├── MontserratAlternates-Black.woff │ ├── MontserratAlternates-Black.woff2 │ ├── MontserratAlternates-Regular.ttf │ ├── MontserratAlternates-Regular.woff │ ├── MontserratAlternates-Regular.woff2 │ ├── MontserratAlternates-SemiBold.ttf │ ├── MontserratAlternates-SemiBold.woff │ └── MontserratAlternates-SemiBold.woff2 ├── themes.json ├── App.jsx ├── icons │ └── copy.svg ├── html.js ├── pages │ └── index.jsx ├── components │ ├── ThemeSelector.jsx │ ├── ToC.jsx │ ├── Suggestions.jsx │ └── HeaderSearch.jsx ├── css │ ├── typography.css │ └── style.css └── PageTemplate.js ├── gatsby-browser.js ├── plugins └── gatsby-remark-prism │ ├── package.json │ ├── gatsby-browser.js │ ├── replaceLinks.js │ ├── index.js │ ├── highlightCode.js │ └── yarn.lock ├── template.md ├── LICENSE ├── gatsby-node.js ├── gatsby-config.js ├── .eslintrc.json ├── .gitignore ├── package.json └── README.md /.eslintignore: -------------------------------------------------------------------------------- 1 | /plugins -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /src/markdown/npm.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/npm' 3 | title: 'npm' 4 | keywords: 'npm' 5 | --- 6 | 7 | # 🤔 8 | -------------------------------------------------------------------------------- /src/utils/clamp.js: -------------------------------------------------------------------------------- 1 | const clamp = (n, min, max) => Math.min(Math.max(n, min), max) 2 | 3 | export default clamp 4 | -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-Black.ttf -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-Black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-Black.woff -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-Black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-Black.woff2 -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-Regular.ttf -------------------------------------------------------------------------------- /gatsby-browser.js: -------------------------------------------------------------------------------- 1 | import 'prismjs/themes/prism-tomorrow.css' 2 | import './src/css/style.css' 3 | 4 | require('smooth-scroll')('a[href*="#"]') 5 | -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-Regular.woff -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-Regular.woff2 -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-SemiBold.ttf -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-SemiBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-SemiBold.woff -------------------------------------------------------------------------------- /src/fonts/MontserratAlternates-SemiBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RealPeha/how-to-install/HEAD/src/fonts/MontserratAlternates-SemiBold.woff2 -------------------------------------------------------------------------------- /src/utils/classes.js: -------------------------------------------------------------------------------- 1 | const classes = (classesList = []) => { 2 | return classesList 3 | .filter(Boolean) 4 | .join(' ') 5 | } 6 | 7 | export default classes 8 | -------------------------------------------------------------------------------- /src/markdown/apache.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/apache' 3 | title: 'Apache' 4 | keywords: 'Apache' 5 | --- 6 | 7 | # CentOS 8 8 | 9 | ## # Using dnf 10 | 11 | ```bash 12 | sudo su 13 | dnf install httpd 14 | ``` 15 | -------------------------------------------------------------------------------- /src/markdown/bmake.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/bmake' 3 | title: 'Bmake' 4 | keywords: 'bmake' 5 | --- 6 | 7 | # macOS 8 | 9 | --- 10 | 11 | ## # Using Homebrew 12 | 13 | ```bash 14 | @brew homebrew@ install bmake 15 | ``` -------------------------------------------------------------------------------- /src/themes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "light", 4 | "iconColor": "tomato" 5 | }, 6 | { 7 | "id": "dark", 8 | "iconColor": "#000" 9 | }, 10 | { 11 | "id": "blue", 12 | "iconColor": "blue" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /src/markdown/eclipse.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/eclipse' 3 | title: 'Eclipse' 4 | keywords: 'eclipse' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | ## # Using snap 10 | 11 | ```bash 12 | sudo @snap@ install --classic eclipse 13 | ``` 14 | -------------------------------------------------------------------------------- /src/markdown/nginx.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/nginx' 3 | title: 'Nginx' 4 | keywords: 'nginx' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install nginx 16 | ``` -------------------------------------------------------------------------------- /src/markdown/ruby-on-rails.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/ruby-on-rails' 3 | title: 'Ruby on rails' 4 | keywords: 'ruby, rails' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | ## # Using gem 10 | 11 | ```bash 12 | gem install rails 13 | rails -v 14 | ``` 15 | -------------------------------------------------------------------------------- /src/markdown/java.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/java' 3 | title: 'Java' 4 | keywords: 'java' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | ## # Using apt 10 | 11 | ```bash 12 | sudo apt update 13 | sudo apt install openjdk-11-jdk 14 | java -version 15 | ``` 16 | -------------------------------------------------------------------------------- /src/markdown/geany.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/geany' 3 | title: 'Geany' 4 | keywords: 'geany, ide' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install geany 16 | ``` 17 | -------------------------------------------------------------------------------- /src/markdown/gedit.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/gedit' 3 | title: 'Gedit' 4 | keywords: 'Gedit, ide' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install gedit 16 | ``` 17 | -------------------------------------------------------------------------------- /src/markdown/php-gd.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/php-gd' 3 | title: 'PHP GD' 4 | keywords: 'php-gd' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install php-gd 16 | ``` 17 | -------------------------------------------------------------------------------- /src/markdown/redis.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/redis' 3 | title: 'Redis' 4 | keywords: 'redis' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | ## # Using apt 10 | 11 | ```bash 12 | sudo apt update # Refresh your local package index 13 | sudo apt install redis-server 14 | ``` 15 | -------------------------------------------------------------------------------- /src/markdown/sublime-text.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/sublime-text' 3 | title: 'Sublime Text' 4 | keywords: 'sublime, ide' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo @snap@ install sublime-text 15 | ``` 16 | -------------------------------------------------------------------------------- /src/markdown/php-mysql.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/php-mysql' 3 | title: 'PHP MySQL' 4 | keywords: 'php-mysql' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install php-mysql 16 | ``` 17 | -------------------------------------------------------------------------------- /src/markdown/postgresql.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/postgresql' 3 | title: 'Postgresql' 4 | keywords: 'postgresql' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | ## # Using apt 10 | 11 | ```bash 12 | sudo apt update # Refresh your local package index 13 | sudo apt install postgresql 14 | ``` 15 | -------------------------------------------------------------------------------- /src/markdown/build-essential.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/build-essential' 3 | title: 'Build Essential' 4 | keywords: 'build-essential' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install build-essential 16 | ``` -------------------------------------------------------------------------------- /src/markdown/homebrew.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/homebrew' 3 | title: 'Homebrew' 4 | keywords: 'homebrew' 5 | --- 6 | 7 | # macOS 8 | 9 | --- 10 | 11 | ## # Using curl 12 | 13 | ```bash 14 | /bin/bash -c "$(@curl@ -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 15 | ``` 16 | -------------------------------------------------------------------------------- /src/markdown/kotlin.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/kotlin' 3 | title: 'Kotlin' 4 | keywords: 'java, kotlin' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | ## # Using apt & snap 10 | 11 | ```bash 12 | sudo apt update 13 | sudo apt install openjdk-11-jdk # install java 14 | sudo @snap@ install --classic kotlin 15 | ``` 16 | -------------------------------------------------------------------------------- /plugins/gatsby-remark-prism/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-remark-prism", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "mdast-util-to-string": "^2.0.0", 8 | "unist-util-visit": "^2.0.3" 9 | }, 10 | "peerDependencies": { 11 | "prismjs": "^1.23.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/markdown/curl.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/curl' 3 | title: 'Curl' 4 | keywords: 'curl' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update # Refresh your local package index 15 | sudo apt install curl # Install curl 16 | curl --version # Check that the install was successful 17 | ``` 18 | -------------------------------------------------------------------------------- /src/markdown/scoop.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/scoop' 3 | title: 'Scoop' 4 | keywords: 'scoop' 5 | --- 6 | 7 | # Windows 8 | 9 | --- 10 | 11 | ## # With PowerShell.exe 12 | 13 | ```bash 14 | Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') 15 | scoop help # Check that the install was successful 16 | ``` -------------------------------------------------------------------------------- /src/markdown/vlc.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/vlc' 3 | title: 'VLC' 4 | keywords: 'vlc, video' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo add-apt-repository ppa:videolan/stable-daily 15 | sudo apt update # Refresh your local package index 16 | sudo apt install vlc # Install VLC 17 | ``` 18 | -------------------------------------------------------------------------------- /src/markdown/make.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/make' 3 | title: 'Make' 4 | keywords: 'make, build-essential' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install make 16 | ``` 17 | 18 | Or install [build-essential](/build-essential) package which includes the make command -------------------------------------------------------------------------------- /src/markdown/snap.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/snap' 3 | title: 'Snap' 4 | keywords: 'snap' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update # Refresh your local package index 15 | sudo apt install snapd # Install Snap 16 | snap --version # Check that the install was successful 17 | ``` 18 | -------------------------------------------------------------------------------- /src/markdown/wget.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/wget' 3 | title: 'wget' 4 | keywords: 'wget' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update # Refresh your local package index 15 | sudo apt install wget # Install wget 16 | wget --version # Check that the install was successful 17 | ``` 18 | -------------------------------------------------------------------------------- /src/markdown/emacs.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/emacs' 3 | title: 'Emacs' 4 | keywords: 'emacs, text editor' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo add-apt-repository ppa:kelleyk/emacs 15 | sudo apt update # Refresh your local package index 16 | sudo apt install emacs25 # Install Emacs 17 | ``` 18 | -------------------------------------------------------------------------------- /src/markdown/deluge.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/deluge' 3 | title: 'Deluge' 4 | keywords: 'deluge, BitTorrent' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo add-apt-repository ppa:deluge-team/ppa 15 | sudo apt update # Refresh your local package index 16 | sudo apt install deluge # Install deluge 17 | ``` 18 | -------------------------------------------------------------------------------- /src/markdown/nvm.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/nvm' 3 | title: 'nvm' 4 | keywords: 'node, nodejs, nvm' 5 | --- 6 | 7 | # Common 8 | 9 | --- 10 | 11 | ## # Using installer 12 | 13 | ```bash 14 | @curl@ -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash 15 | source ~/.bashrc 16 | nvm --version # Check that the install was successful 17 | ``` 18 | -------------------------------------------------------------------------------- /src/markdown/atom.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/atom' 3 | title: 'Atom' 4 | keywords: 'Atom, ide' 5 | --- 6 | 7 | # Windows / Linux / macOS 8 | --- 9 | ## # Using installer 10 | Download the latest Atom from [atom.io](https://atom.io/) 11 | 12 |
13 | 14 | # Linux 15 | --- 16 | ## # Using snap 17 | 18 | ```bash 19 | sudo @snap@ install atom --classic 20 | ``` 21 | -------------------------------------------------------------------------------- /src/markdown/brackets.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/brackets' 3 | title: 'Brackets' 4 | keywords: 'brackets, ide' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo add-apt-repository ppa:webupd8team/brackets 15 | sudo apt update # Refresh your local package index 16 | sudo apt install brackets # Install Brackets 17 | ``` 18 | -------------------------------------------------------------------------------- /template.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/utility-name' 3 | title: 'Utility Name' 4 | keywords: 'utility-name, some another keyword' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudp apt get some-utility 15 | ``` 16 | 17 |
18 | 19 | # CentOS 8 20 | --- 21 | ## # Using yum 22 | 23 | ```bash 24 | sudp yum get some-utility 25 | ``` 26 | -------------------------------------------------------------------------------- /src/markdown/vim.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/vim' 3 | title: 'Vim' 4 | keywords: 'vim, text editor' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo add-apt-repository ppa:jonathonf/vim 15 | sudo apt update # Refresh your local package index 16 | sudo apt install vim # Install Vim 17 | vim --version # Check that the install was successful 18 | ``` 19 | -------------------------------------------------------------------------------- /src/markdown/qbittorrent.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/qbittorrent' 3 | title: 'qBittorrent' 4 | keywords: 'qbittorrent, BitTorrent' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo add-apt-repository ppa:qbittorrent-team/qbittorrent-stable 15 | sudo apt update # Refresh your local package index 16 | sudo apt install qbittorrent # Install qBittorrent 17 | ``` 18 | -------------------------------------------------------------------------------- /src/markdown/transmission.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/transmission' 3 | title: 'Transmission' 4 | keywords: 'transmission, BitTorrent' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo add-apt-repository ppa:transmissionbt/ppa 15 | sudo apt update # Refresh your local package index 16 | sudo apt install transmission-gtk transmission-cli transmission-common transmission-daemon # Install Transmission 17 | ``` 18 | -------------------------------------------------------------------------------- /plugins/gatsby-remark-prism/gatsby-browser.js: -------------------------------------------------------------------------------- 1 | exports.onClientEntry = () => { 2 | window.copyToClipboard = base64Code => { 3 | const textarea = document.createElement('textarea') 4 | 5 | textarea.setAttribute('style', 'width:1px;border:0;opacity:0;') 6 | document.body.appendChild(textarea) 7 | textarea.innerHTML = atob(base64Code) 8 | textarea.select() 9 | document.execCommand('copy') 10 | document.body.removeChild(textarea) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/markdown/php.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/php' 3 | title: 'PHP' 4 | keywords: 'php' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | If you’re using Apache 14 | ```bash 15 | sudo apt update 16 | sudo apt install php libapache2-mod-php 17 | sudo systemctl restart apache2 # Restart Apache 18 | ``` 19 | 20 | If you’re using Nginx 21 | ```bash 22 | sudo apt update 23 | sudo apt install php-fpm 24 | sudo systemctl restart nginx # Restart Nginx 25 | ``` 26 | -------------------------------------------------------------------------------- /src/markdown/virtualbox.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/virtualbox' 3 | title: 'VirtualBox' 4 | keywords: 'virtualbox' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | @wget@ -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - 15 | @wget@ -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - 16 | sudo apt update # Refresh your local package index 17 | sudo apt install virtualbox-5.2 # Install VirtualBox 5.2 18 | ``` 19 | -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import classes from './utils/classes' 4 | 5 | // import ThemeSelector from './components/ThemeSelector' 6 | 7 | const App = ({ children, className = '' }) => { 8 | // const [theme, setTheme] = useState(localStorage.getItem('theme') || 'light') 9 | 10 | return ( 11 | //
12 |
13 | {/* setTheme(theme)} theme={theme} /> */} 14 | {children} 15 |
16 | ) 17 | } 18 | 19 | export default App 20 | -------------------------------------------------------------------------------- /plugins/gatsby-remark-prism/replaceLinks.js: -------------------------------------------------------------------------------- 1 | const defaultReplacer = (title, url) => 2 | `${title}` 3 | 4 | const replaceLinks = (line, replacer = defaultReplacer) => { 5 | const links = line.match(/\@.*?\@/g) 6 | 7 | if (links && links.length) { 8 | links.forEach(link => { 9 | const [, title] = link.match(/\@(.*?)[\s|@]/) || [] 10 | const [, url] = link.match(/\s(.*?)\@/) || [] 11 | 12 | line = line.replace(link, replacer(title, url)) 13 | }) 14 | } 15 | 16 | return line 17 | } 18 | 19 | module.exports = replaceLinks 20 | -------------------------------------------------------------------------------- /src/icons/copy.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/gatsby-remark-prism/index.js: -------------------------------------------------------------------------------- 1 | const visit = require('unist-util-visit') 2 | const nodeToString = require('mdast-util-to-string') 3 | 4 | const highlightCode = require('./highlightCode') 5 | 6 | module.exports = ({ markdownAST }) => { 7 | visit(markdownAST, 'code', node => { 8 | const lang = node.lang || 'bash' 9 | 10 | const code = nodeToString(node) 11 | const output = highlightCode(lang, code) 12 | 13 | node.type = 'html' 14 | node.value = ` 15 |
16 |
${output}
17 |
18 | `.trim() 19 | }) 20 | 21 | return markdownAST 22 | } 23 | -------------------------------------------------------------------------------- /src/markdown/zip.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/zip' 3 | title: 'Zip' 4 | keywords: 'zip, archive' 5 | --- 6 | 7 | # Ubuntu / Debian / Mint 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install zip 16 | zip -v 17 | ``` 18 | 19 |
20 | 21 | # RedHat / CentOS / Fedora 22 | 23 | --- 24 | 25 | ## # Using dnf 26 | 27 | ```bash 28 | sudo dnf install zip 29 | zip -v 30 | ``` 31 | 32 |
33 | 34 | # OpenSuse 35 | 36 | --- 37 | 38 | ## # Using zypper 39 | 40 | ```bash 41 | zypper install zip 42 | zip -v 43 | ``` 44 | 45 |
46 | 47 | # Arch Linux 48 | 49 | --- 50 | 51 | ## # Using pacman 52 | 53 | ```bash 54 | sudo pacman -S zip 55 | zip -v 56 | ``` -------------------------------------------------------------------------------- /src/markdown/unzip.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/unzip' 3 | title: 'Unzip' 4 | keywords: 'unzip, archive' 5 | --- 6 | 7 | # Ubuntu / Debian / Mint 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install unzip 16 | unzip -v 17 | ``` 18 | 19 |
20 | 21 | # RedHat / CentOS / Fedora 22 | 23 | --- 24 | 25 | ## # Using dnf 26 | 27 | ```bash 28 | sudo dnf install unzip 29 | unzip -v 30 | ``` 31 | 32 |
33 | 34 | # OpenSuse 35 | 36 | --- 37 | 38 | ## # Using zypper 39 | 40 | ```bash 41 | zypper install unzip 42 | unzip -v 43 | ``` 44 | 45 |
46 | 47 | # Arch Linux 48 | 49 | --- 50 | 51 | ## # Using pacman 52 | 53 | ```bash 54 | sudo pacman -S unzip 55 | unzip -v 56 | ``` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The BSD Zero Clause License (0BSD) 2 | 3 | Copyright (c) 2020 Gatsby Inc. 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 9 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 11 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 13 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14 | PERFORMANCE OF THIS SOFTWARE. 15 | -------------------------------------------------------------------------------- /src/html.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default props => { 4 | return ( 5 | 6 | 7 | 8 | 9 | 13 | How to install... 14 | {props.headComponents} 15 | 16 | 17 | {props.preBodyComponents} 18 |
23 | {props.postBodyComponents} 24 | 25 | 26 | ) 27 | } 28 | -------------------------------------------------------------------------------- /gatsby-node.js: -------------------------------------------------------------------------------- 1 | exports.createPages = ({ actions, graphql }) => { 2 | const { createPage } = actions 3 | 4 | return graphql(` 5 | { 6 | allMarkdownRemark(limit: 1000) { 7 | edges { 8 | node { 9 | frontmatter { 10 | slug 11 | } 12 | } 13 | } 14 | } 15 | } 16 | `).then(({ data, errors }) => { 17 | if (errors) { 18 | return Promise.reject(errors) 19 | } 20 | 21 | const template = require.resolve('./src/PageTemplate.js') 22 | 23 | return data.allMarkdownRemark.edges.forEach(({ node }) => { 24 | const { 25 | frontmatter: { slug }, 26 | } = node 27 | 28 | createPage({ 29 | path: slug, 30 | component: template, 31 | context: { slug }, 32 | }) 33 | }) 34 | }) 35 | } 36 | -------------------------------------------------------------------------------- /src/markdown/net-tools.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/new-tools' 3 | title: 'Net Tools' 4 | keywords: 'net tools, netstat' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install net-tools 16 | netstat -v 17 | ``` 18 | 19 |
20 | 21 | # CentOS / RHEL 22 | 23 | --- 24 | 25 | ## # Using yum 26 | 27 | ```bash 28 | sudo yum update 29 | sudo yum install net-tools 30 | netstat -v 31 | ``` 32 | 33 |
34 | 35 | # OpenSuse 36 | 37 | --- 38 | 39 | ## # Using zypper 40 | 41 | ```bash 42 | zypper install net-tools 43 | netstat -v 44 | ``` 45 | 46 |
47 | 48 | # Arch Linux 49 | 50 | --- 51 | 52 | ## # Using pacman 53 | 54 | ```bash 55 | pacman -S netstat-nat 56 | netstat -v 57 | ``` -------------------------------------------------------------------------------- /src/markdown/tar.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/tar' 3 | title: 'tar' 4 | keywords: 'tar, archive' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update # Refresh your local package index 15 | sudo apt install tar # Install tar 16 | tar --version # Check that the install was successful 17 | ``` 18 | 19 | # CentOs / RHEL 20 | 21 | --- 22 | 23 | ## # Using yum 24 | 25 | ```bash 26 | sudo yum update # Refresh your local package index 27 | sudo yum install tar # Install tar 28 | tar --version # Check that the install was successful 29 | ``` 30 | 31 | # Windows 32 | 33 | The tar command is available for Windows as well, you can download it from the Gunwin project. http://gnuwin32.sourceforge.net/packages/gtar.htm 34 | -------------------------------------------------------------------------------- /src/pages/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { graphql } from 'gatsby' 3 | 4 | import App from '../App' 5 | import HeaderSearch from '../components/HeaderSearch' 6 | 7 | const Index = ({ data }) => { 8 | const pages = data.allMarkdownRemark.edges.map( 9 | page => page.node.frontmatter, 10 | ) 11 | 12 | return ( 13 | 14 | 15 | {/*

Text

*/} 16 |
17 | ) 18 | } 19 | 20 | export const pageQuery = graphql` 21 | { 22 | allMarkdownRemark(limit: 1000) { 23 | edges { 24 | node { 25 | frontmatter { 26 | slug 27 | keywords 28 | title 29 | } 30 | } 31 | } 32 | } 33 | } 34 | ` 35 | 36 | export default Index 37 | -------------------------------------------------------------------------------- /src/markdown/docker.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/docker' 3 | title: 'Docker' 4 | keywords: 'docker' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update 15 | sudo apt install @apt-transport-https@ @ca-certificates@ @curl@ @software-properties-common@ 16 | @curl@ -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 17 | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" 18 | sudo apt update 19 | apt-cache policy docker-ce 20 | sudo apt install docker-ce 21 | ``` 22 | 23 |
24 | 25 | # CentOS 8 26 | 27 | ## # Using dnf 28 | 29 | ```bash 30 | dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo 31 | dnf install docker-ce 32 | ``` -------------------------------------------------------------------------------- /gatsby-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | pathPrefix: '/how-to-install', 3 | siteMetadata: { 4 | title: 'I want to install...', 5 | }, 6 | plugins: [ 7 | 'gatsby-plugin-react-helmet', 8 | { 9 | resolve: 'gatsby-source-filesystem', 10 | options: { 11 | name: 'markdown', 12 | path: `${__dirname}/src/markdown`, 13 | }, 14 | }, 15 | { 16 | resolve: 'gatsby-transformer-remark', 17 | options: { 18 | plugins: [ 19 | { 20 | resolve: 'gatsby-remark-autolink-headers', 21 | options: { 22 | isIconAfterHeader: true, 23 | }, 24 | }, 25 | 'gatsby-remark-prism', 26 | ], 27 | }, 28 | }, 29 | { 30 | resolve: 'gatsby-plugin-catch-links', 31 | options: { 32 | excludePattern: /(excluded-link|external)/, 33 | }, 34 | }, 35 | ], 36 | } 37 | -------------------------------------------------------------------------------- /src/markdown/git.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/git' 3 | title: 'Git' 4 | keywords: 'git' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo apt update # Refresh your local package index 15 | sudo apt install git # Install Git 16 | git --version # Check that the install was successful 17 | ``` 18 | 19 |
20 | 21 | # Fedora 22 | 23 | --- 24 | 25 | ## # Using dnf 26 | 27 | ```bash 28 | sudo dnf install git # Install Git 29 | git --version # Check that the install was successful 30 | ``` 31 | 32 | ## # Using yum 33 | 34 | ```bash 35 | sudo yum install git # Install Git 36 | git --version # Check that the install was successful 37 | ``` 38 | 39 |
40 | 41 | # Windows 42 | 43 | --- 44 | 45 | Download the latest [Git for Windows installer](https://git-for-windows.github.io/). 46 | -------------------------------------------------------------------------------- /src/markdown/python.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/python' 3 | title: 'Python' 4 | keywords: 'python' 5 | --- 6 | 7 | # Ubuntu 16.04 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | ```bash 14 | sudo add-apt-repository ppa:jonathonf/python-3.6 15 | sudo apt update 16 | sudo apt install python3.6 17 | ``` 18 | 19 | ## # Using source 20 | 21 | ```bash 22 | sudo apt install build-essential checkinstall 23 | sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev 24 | wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz 25 | tar xvf Python-3.6.0.tar.xz 26 | cd Python-3.6.0/ 27 | ./configure 28 | sudo make altinstall 29 | python3 -V 30 | ``` 31 | 32 |
33 | 34 | # Linux Mint 35 | 36 | ## # Using apt 37 | 38 | ```bash 39 | apt update 40 | sudo add-apt-repository ppa:deadsnakes/ppa 41 | sudo apt install python3.9 42 | python3.9 -V 43 | ``` -------------------------------------------------------------------------------- /src/markdown/yarn.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/yarn' 3 | title: 'Yarn' 4 | keywords: 'yarn' 5 | --- 6 | 7 | # Common 8 | 9 | --- 10 | 11 | ## # Using npm 12 | 13 | ```bash 14 | @npm@ install --global yarn 15 | yarn --version # Check that the install was successful 16 | ``` 17 | 18 |
19 | 20 | # Ubuntu 20.04 21 | 22 | --- 23 | 24 | ## # Using apt 25 | Import the repository’s GPG key and add the Yarn APT repository to your system 26 | ```bash 27 | @curl@ -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 28 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 29 | ``` 30 | 31 | Install yarn 32 | 33 | ```bash 34 | sudo apt update # Refresh your local package index 35 | sudo apt install yarn # Install yarn and Node.js 36 | # or 37 | sudo apt install --no-install-recommends yarn # Skip the Node.js installation 38 | yarn --version # Check that the install was successful 39 | ``` 40 | -------------------------------------------------------------------------------- /src/markdown/nano.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/nano' 3 | title: 'Nano' 4 | keywords: 'nano, text editor' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using apt (for older versions) 12 | 13 | ```bash 14 | sudo apt update # Refresh your local package index 15 | sudo apt install nano # Install Nano 16 | nano --version # Check that the install was successful 17 | ``` 18 | 19 | ## # Build from source 20 | 21 | Download nano 22 | 23 | ```bash 24 | @wget@ http://www.nano-editor.org/dist/v2.4/nano-2.4.2.tar.gz 25 | # or using curl 26 | @curl@ http://www.nano-editor.org/dist/v2.4/nano-2.4.2.tar.gz > nano-2.4.2.tar.gz 27 | ``` 28 | 29 | Build & Install nano 30 | 31 | ```bash 32 | @tar@ -xzf nano-2.4.2.tar.gz 33 | cd nano-2.4.2 34 | ./configure 35 | @make@ 36 | sudo @make@ install 37 | ``` 38 | 39 |
40 | 41 | # RedHat / CentOS / Fedora 42 | 43 | --- 44 | 45 | ## # Using yum 46 | 47 | ```bash 48 | sudo yum install nano # Install nano 49 | nano --version # Check that the install was successful 50 | ``` 51 | -------------------------------------------------------------------------------- /src/markdown/chocolatey.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/chocolatey' 3 | title: 'Chocolatey' 4 | keywords: 'chocolatey' 5 | --- 6 | 7 | # Windows 8 | 9 | --- 10 | 11 | ## # With cmd.exe 12 | 13 | ```bash 14 | @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" 15 | ``` 16 | 17 | ## # With PowerShell.exe 18 | 19 | ```bash 20 | Get-ExecutionPolicy 21 | # If it returns Restricted, then 22 | Set-ExecutionPolicy AllSigned 23 | #or 24 | Set-ExecutionPolicy Bypass -Scope Process 25 | ``` 26 | Then 27 | ```bash 28 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 29 | ``` -------------------------------------------------------------------------------- /src/components/ThemeSelector.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import React, { useState } from 'react' 3 | 4 | import classes from '../utils/classes' 5 | 6 | import allThemes from '../themes.json' 7 | 8 | const ThemeSelector = ({ theme, onSelect }) => { 9 | const [collapsed, setCollapsed] = useState(true) 10 | 11 | const handleSelect = themeId => { 12 | onSelect(themeId) 13 | localStorage.setItem('theme', themeId) 14 | } 15 | 16 | return ( 17 |
setCollapsed(false)} 20 | onMouseLeave={() => setCollapsed(true)} 21 | > 22 | {allThemes 23 | .sort(a => a.id === theme) 24 | .map(({ id, iconColor }, index) => { 25 | return ( 26 |
handleSelect(id)} 35 | /> 36 | ) 37 | })} 38 |
39 | ) 40 | } 41 | 42 | export default ThemeSelector 43 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "extends": ["airbnb", "airbnb/hooks"], 7 | "parserOptions": { 8 | "ecmaFeatures": { 9 | "jsx": true 10 | }, 11 | "ecmaVersion": 12, 12 | "sourceType": "module" 13 | }, 14 | "plugins": ["react"], 15 | "rules": { 16 | "no-tabs": "off", 17 | "no-shadow": "off", 18 | "no-param-reassign": "off", 19 | "arrow-parens": ["error", "as-needed"], 20 | "arrow-body-style": "off", 21 | "no-unused-vars": [1], 22 | "indent": ["error", "tab"], 23 | "quotes": ["error", "single"], 24 | "semi": ["error", "never"], 25 | "comma-dangle": [2, "always-multiline"], 26 | "react/prop-types": "off", 27 | "react/display-name": "off", 28 | "react/jsx-indent": [2, "tab"], 29 | "react/jsx-indent-props": [2, "tab"], 30 | "react/destructuring-assignment": "off", 31 | "react/jsx-props-no-spreading": "off", 32 | "react/jsx-no-target-blank": [1], 33 | "react/jsx-filename-extension": "off" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/css/typography.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Montserrat Alternates'; 3 | font-weight: 900; 4 | font-style: normal; 5 | src: local('MontserratAlternates Black'), 6 | url(../fonts/MontserratAlternates-Black.woff2) format('woff2'), 7 | url(../fonts/MontserratAlternates-Black.woff) format('woff'), 8 | url(../fonts/MontserratAlternates-Black.ttf) format('truetype'); 9 | } 10 | 11 | @font-face { 12 | font-family: 'Montserrat Alternates'; 13 | font-weight: 600; 14 | font-style: normal; 15 | src: local('MontserratAlternates SemiBold'), 16 | url(../fonts/MontserratAlternates-SemiBold.woff2) format('woff2'), 17 | url(../fonts/MontserratAlternates-SemiBold.woff) format('woff'), 18 | url(../fonts/MontserratAlternates-SemiBold.ttf) format('truetype'); 19 | } 20 | 21 | @font-face { 22 | font-family: 'Montserrat Alternates'; 23 | font-weight: normal; 24 | font-style: normal; 25 | src: local('MontserratAlternates Regular'), 26 | url(../fonts/MontserratAlternates-Regular.woff2) format('woff2'), 27 | url(../fonts/MontserratAlternates-Regular.woff) format('woff'), 28 | url(../fonts/MontserratAlternates-Regular.ttf) format('truetype'); 29 | } 30 | -------------------------------------------------------------------------------- /plugins/gatsby-remark-prism/highlightCode.js: -------------------------------------------------------------------------------- 1 | const Prism = require('prismjs') 2 | 3 | const replaceLinks = require('./replaceLinks') 4 | 5 | const highlightCode = (language, code) => { 6 | if (!Prism.languages[language]) { 7 | try { 8 | require(`prismjs/components/prism-${language}.js`) 9 | } catch (e) { 10 | return code 11 | } 12 | } 13 | 14 | const highlightedCode = Prism.highlight(code, Prism.languages[language]) 15 | 16 | const showCopyButton = !['ini', 'properties'].includes(language) 17 | 18 | return highlightedCode 19 | .split('\n') 20 | .map(highlightedLine => { 21 | const lineWithLinks = replaceLinks(highlightedLine) 22 | const cleanLine = replaceLinks(highlightedLine, title => title) 23 | .replace(/<\/?[^>]+(>|$)/g, '') 24 | .replace(/\#.+/g, `$'`) 25 | 26 | return ` 27 |
28 | ${ 29 | cleanLine && showCopyButton 30 | ? `
` 31 | : '' 32 | } 33 |
${lineWithLinks}
34 |
35 | `.trim() 36 | }) 37 | .join('') 38 | } 39 | 40 | module.exports = highlightCode 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # dotenv environment variable files 55 | .env* 56 | 57 | # gatsby files 58 | .cache/ 59 | public 60 | 61 | # Mac files 62 | .DS_Store 63 | 64 | # Yarn 65 | yarn-error.log 66 | .pnp/ 67 | .pnp.js 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | #idea 72 | .idea -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "how-to-install", 3 | "author": "Stas Kardash (@RealPeha) real.peha@gmail.com", 4 | "private": true, 5 | "version": "0.1.0", 6 | "license": "0BSD", 7 | "scripts": { 8 | "start": "yarn dev", 9 | "dev": "yarn clean && gatsby develop", 10 | "build": "gatsby build", 11 | "serve": "gatsby serve", 12 | "clean": "gatsby clean", 13 | "format": "eslint --ext .jsx --ext .js src/ --fix", 14 | "deploy": "gatsby build --prefix-paths && gh-pages -d public" 15 | }, 16 | "dependencies": { 17 | "gatsby": "^2.26.1", 18 | "gatsby-plugin-catch-links": "^2.10.0", 19 | "gatsby-plugin-react-helmet": "^3.9.0", 20 | "gatsby-remark-autolink-headers": "^2.9.0", 21 | "gatsby-source-filesystem": "^2.8.1", 22 | "gatsby-transformer-remark": "^2.13.1", 23 | "github-slugger": "^1.3.0", 24 | "prismjs": "^1.23.0", 25 | "qs": "^6.9.4", 26 | "react": "^16.12.0", 27 | "react-dom": "^16.12.0", 28 | "react-helmet": "^6.1.0", 29 | "smooth-scroll": "^16.1.3" 30 | }, 31 | "devDependencies": { 32 | "eslint": "^7.2.0", 33 | "eslint-config-airbnb": "18.2.1", 34 | "eslint-plugin-import": "^2.22.1", 35 | "eslint-plugin-jsx-a11y": "^6.4.1", 36 | "eslint-plugin-react": "^7.21.5", 37 | "eslint-plugin-react-hooks": "^1.7.0", 38 | "gh-pages": "^3.1.0" 39 | }, 40 | "repository": { 41 | "type": "git", 42 | "url": "https://github.com/RealPehha/how-to-install" 43 | }, 44 | "bugs": { 45 | "url": "https://github.com/RealPehha/how-to-install/issues" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/markdown/ruby.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/ruby' 3 | title: 'Ruby' 4 | keywords: 'ruby' 5 | --- 6 | 7 | # Ubuntu 8 | 9 | ## # Using apt 10 | 11 | ```bash 12 | sudo apt update 13 | sudo apt install ruby-full 14 | ruby --version 15 | ``` 16 | 17 | ## # Using Rbenv 18 | 19 | ```bash 20 | sudo apt update 21 | sudo apt install git curl autoconf bison build-essential 22 | libssl-dev libyaml-dev libreadline6-dev zlib1g-dev 23 | libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev 24 | curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash 25 | rbenv -v 26 | rbenv install -l # versions list 27 | rbenv install VERSION 28 | rbenv global VERSION 29 | ``` 30 | 31 | ## # Using RVM 32 | 33 | ```bash 34 | sudo apt install curl 35 | sudo gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 # import open key in system 36 | curl -sSL https://get.rvm.io | bash -s stable # download RVM 37 | source /etc/profile.d/rvm.sh 38 | rvm requirements # install requirements 39 | rvm list known # versions list 40 | rvm install VERSION # install version 41 | rvm use VERSION --default 42 | ruby --version 43 | ``` 44 | 45 |
46 | 47 | # Arch Linux 48 | 49 | ## # Using pacman 50 | 51 | ```bash 52 | sudo pacman -S ruby 53 | ``` 54 | 55 |
56 | 57 | # macOS 58 | 59 | ## # Using Homebrew 60 | 61 | ```bash 62 | brew install ruby 63 | ``` 64 | 65 |
66 | 67 | # CentOS, Fedora, RHEL 68 | 69 | ## # Using yum 70 | 71 | ```bash 72 | sudo yum install ruby 73 | ``` -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [How to install](https://peha.fun/how-to-install) - The collection of Install Tutorials 2 | 3 | This project is a collection of instructions for installing programs and utilities for Linux, Windows, MacOS, etc. 4 | 5 | # Contribute 6 | The project really needs community support, so contributors are always welcome! 7 | 8 | You can create a new instruction or edit an existing 9 | 10 | How to add a new instruction: 11 | 1. Fork the repo 12 | 2. Create new branch 13 | 3. Create a new file with .md extension in the src/markdown folder. You can use [template.md](https://github.com/RealPeha/how-to-install/blob/master/template.md) file for example 14 | 4. This file must have the required header in it: 15 | ``` 16 | --- 17 | slug: '/your-slug' 18 | title: 'Some utility' 19 | keywords: 'your-slug, random' 20 | --- 21 | ``` 22 | Where `slug` is a unique identifier of the utility, which is its url address, for example `peha.fun/how-to-install/your-slug` 23 | 24 | - and make sure your instructions are working 😄 25 | 26 | 27 | Before adding a new instruction please ensure your pull request adheres to the following guidelines: 28 | - it is divided into blocks according to operating systems 29 | - does not contain unnecessary comments and optional clarifications 30 | - if an install of some utility requires an install of another one, you may create a link to it right in the code using the `@` symbol 31 | 32 | use `sudo @snap@ install atom --classic` for create a link to the `snap` like `peha.fun/how-to-install/snap` 33 | 34 | or `@make build-essential@ ./` for create a link to the `make` like `peha.fun/how-to-install/build-essential` 35 | -------------------------------------------------------------------------------- /src/components/ToC.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useRef, useEffect } from 'react' 2 | import Slugger from 'github-slugger' 3 | 4 | import classes from '../utils/classes' 5 | 6 | const ToC = ({ headings, maxDepth = 1 }) => { 7 | const [isSticky, setSticky] = useState(false) 8 | 9 | const tocMenuWrapperRef = useRef() 10 | const tocMenuRef = useRef() 11 | 12 | const slugger = Slugger() 13 | 14 | const filteredHeadings = headings.filter(({ depth }) => depth <= maxDepth) 15 | 16 | const handleScroll = () => { 17 | if (tocMenuRef.current && tocMenuWrapperRef.current) { 18 | const tocHeight = tocMenuRef.current.getBoundingClientRect().height 19 | const tocWrapperOffsetTop = tocMenuWrapperRef.current.getBoundingClientRect().top 20 | 21 | const isSticky = tocWrapperOffsetTop <= window.innerHeight / 2 - tocHeight / 2 - 50 22 | 23 | setSticky(isSticky) 24 | } 25 | } 26 | 27 | useEffect(() => { 28 | handleScroll() 29 | 30 | document.addEventListener('scroll', handleScroll) 31 | 32 | return () => document.removeEventListener('scroll', handleScroll) 33 | }, []) 34 | 35 | if (filteredHeadings.length <= 1) { 36 | return
37 | } 38 | 39 | return ( 40 |
41 |
42 |
43 | {filteredHeadings.map(({ value }) => { 44 | const slug = slugger.slug(value) 45 | 46 | return {value} 47 | })} 48 |
49 |
50 |
Table of Contents
51 |
52 | ) 53 | } 54 | 55 | export default ToC 56 | -------------------------------------------------------------------------------- /src/components/Suggestions.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react' 2 | import { navigate, Link } from 'gatsby' 3 | 4 | import clamp from '../utils/clamp' 5 | import classes from '../utils/classes' 6 | 7 | const Suggestion = ({ item, isActive, onHover }) => { 8 | return ( 9 | 15 | {item.title} 16 | 17 | ) 18 | } 19 | 20 | const Suggestions = ({ items }) => { 21 | const [activeSuggestion, setActiveSuggestion] = useState(-1) 22 | 23 | const handleHover = React.useCallback(index => () => { 24 | setActiveSuggestion(index) 25 | }, []) 26 | 27 | useEffect(() => { 28 | setActiveSuggestion(-1) 29 | 30 | const handleKeyDown = e => { 31 | setActiveSuggestion(n => { 32 | if (e.key === 'ArrowUp') { 33 | return clamp(n - 1, 0, items.length - 1) 34 | } 35 | 36 | if (e.key === 'ArrowDown') { 37 | return clamp(n + 1, 0, items.length - 1) 38 | } 39 | 40 | if (e.key === 'Enter' && items && items[n]) { 41 | navigate(items[n].slug) 42 | } 43 | 44 | return n 45 | }) 46 | } 47 | 48 | document.addEventListener('keydown', handleKeyDown) 49 | 50 | return () => document.removeEventListener('keydown', handleKeyDown) 51 | }, [items]) 52 | 53 | return ( 54 |
55 | {items.map((item, index) => ( 56 | 62 | ))} 63 |
64 | ) 65 | } 66 | 67 | export default Suggestions 68 | -------------------------------------------------------------------------------- /plugins/gatsby-remark-prism/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@types/unist@^2.0.0": 6 | version "2.0.3" 7 | resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" 8 | integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== 9 | 10 | mdast-util-to-string@^2.0.0: 11 | version "2.0.0" 12 | resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" 13 | integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w== 14 | 15 | unist-util-is@^4.0.0: 16 | version "4.0.4" 17 | resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.0.4.tgz#3e9e8de6af2eb0039a59f50c9b3e99698a924f50" 18 | integrity sha512-3dF39j/u423v4BBQrk1AQ2Ve1FxY5W3JKwXxVFzBODQ6WEvccguhgp802qQLKSnxPODE6WuRZtV+ohlUg4meBA== 19 | 20 | unist-util-visit-parents@^3.0.0: 21 | version "3.1.1" 22 | resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" 23 | integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== 24 | dependencies: 25 | "@types/unist" "^2.0.0" 26 | unist-util-is "^4.0.0" 27 | 28 | unist-util-visit@^2.0.3: 29 | version "2.0.3" 30 | resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" 31 | integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== 32 | dependencies: 33 | "@types/unist" "^2.0.0" 34 | unist-util-is "^4.0.0" 35 | unist-util-visit-parents "^3.0.0" 36 | -------------------------------------------------------------------------------- /src/PageTemplate.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Helmet } from 'react-helmet' 3 | import { graphql } from 'gatsby' 4 | 5 | import App from './App' 6 | import HeaderSearch from './components/HeaderSearch' 7 | import ToC from './components/ToC' 8 | 9 | const PageTemplate = ({ data, pageContext }) => { 10 | const { markdownRemark, allMarkdownRemark } = data 11 | const { frontmatter: meta, html, headings } = markdownRemark 12 | 13 | const pages = allMarkdownRemark.edges.map(page => page.node.frontmatter) 14 | const slug = pageContext.slug.substr(1) 15 | 16 | return ( 17 | 18 | 19 | {`How to install ${meta.title} on Linux, Mac, Windows`} 20 | 21 | 27 | 28 |
29 | 30 |
31 | 46 | 47 |
48 |
49 | 50 | ) 51 | } 52 | 53 | export const pageQuery = graphql` 54 | query($slug: String!) { 55 | markdownRemark(frontmatter: { slug: { eq: $slug } }) { 56 | html 57 | headings { 58 | value 59 | depth 60 | } 61 | frontmatter { 62 | slug 63 | title 64 | } 65 | } 66 | allMarkdownRemark(limit: 1000) { 67 | edges { 68 | node { 69 | frontmatter { 70 | slug 71 | keywords 72 | title 73 | } 74 | } 75 | } 76 | } 77 | } 78 | ` 79 | 80 | export default PageTemplate 81 | -------------------------------------------------------------------------------- /src/markdown/nodejs.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/nodejs' 3 | title: 'Node.js' 4 | keywords: 'node, nodejs' 5 | --- 6 | 7 | # Ubuntu / Debian 8 | 9 | --- 10 | 11 | ## # Using nvm ⭐ 12 | 13 | ```bash 14 | @nvm@ list-remote 15 | @nvm@ install v14.0.0 # Install Node.js v.14.0.0 for example 16 | @nvm@ use v14.0.0 # Switch to v14.0.0 version 17 | ``` 18 | 19 | ## # From the Default Repositories 20 | 21 | ```bash 22 | sudo apt update # Refresh your local package index 23 | sudo apt install nodejs # Install Node.js 24 | nodejs -v # Check that the install was successful 25 | ``` 26 | 27 | ## # Using a NodeSource PPA 28 | 29 | Install the PPA 30 | 31 | ```bash 32 | cd ~ 33 | @curl@ -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh # For example, install Node.js 14 34 | sudo bash nodesource_setup.sh 35 | ``` 36 | 37 | Install Node.js 38 | 39 | ```bash 40 | sudo apt install nodejs 41 | nodejs -v # Check that the install was successful 42 | ``` 43 | 44 | ## # Using snap 45 | ```bash 46 | sudo @snap@ install node --classic --channel=14 # For example, install Node.js 14 47 | ``` 48 | 49 |
50 | 51 | # CentOS 8 / RHEL 8 / Fedora 52 | 53 | ## # Using dnf 54 | ```bash 55 | dnf module install nodejs: 56 | dnf module list nodejs # See a list of available streams 57 | dnf module install nodejs:12 # For example, install Node.js 12 58 | ``` 59 | 60 | ## # Using snap 61 | ```bash 62 | sudo @snap@ install node --classic --channel=14 # For example, install Node.js 14 63 | ``` 64 | 65 |
66 | 67 | # CentOS 7 68 | 69 | ## # Using a NodeSource PPA 70 | ```bash 71 | curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash - 72 | sudo yum install nodejs 73 | node --version # Check that the install was successful 74 | ``` 75 | 76 | Or install using [nvm](/nvm) 77 | 78 |
79 | 80 | # Windows 81 | 82 | ## # Using installer ⭐ 83 | Download the Windows Installer directly from the nodejs.org web site. 84 | 85 | ## # Using choco 86 | ```bash 87 | @choco chocolatey@ install nodejs 88 | # or full install with npm 89 | @choco chocolatey@ install nodejs.install 90 | ``` 91 | 92 | ## # Using scoop 93 | ```bash 94 | @scoop@ install nodejs 95 | ``` 96 | 97 | # FreeBSD 98 | 99 | --- 100 | 101 | ## # Using pkg 102 | ```bash 103 | pkg install node 104 | ``` 105 | Or compile it on your own using ports: 106 | ```bash 107 | cd /usr/ports/www/node 108 | @make build-essential@ install 109 | ``` 110 | 111 |
112 | 113 | # Gentoo 114 | 115 | --- 116 | 117 | ## # Using emerge 118 | ```bash 119 | emerge nodejs 120 | ``` 121 | 122 | # Arch Linux 123 | 124 | --- 125 | 126 | ## # Using pacman 127 | 128 | ```bash 129 | pacman -S nodejs 130 | ``` 131 | 132 |
133 | 134 | # macOS 135 | 136 | --- 137 | 138 | ## # Using installer 139 | ```bash 140 | curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" 141 | sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/" 142 | ``` 143 | 144 | ## # Using Homebrew 145 | ```bash 146 | @brew homebrew@ install node 147 | ``` 148 | 149 | ## # Using MacPorts 150 | ```bash 151 | port install nodejs 152 | # Example 153 | port install nodejs7 154 | ``` 155 | 156 | ## # Using pkgsrc 157 | Install the binary package 158 | ```bash 159 | pkgin -y install nodejs 160 | ``` 161 | Or build manually 162 | ```bash 163 | cd pkgsrc/lang/nodejs && @bmake@ install 164 | ``` 165 | 166 |
167 | 168 | # Android 169 | 170 | ## # Using Termux pkg 171 | ```bash 172 | pkg install nodejs # Install latest Node.js version 173 | ``` -------------------------------------------------------------------------------- /src/components/HeaderSearch.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useMemo } from 'react' 2 | import { navigate } from 'gatsby' 3 | 4 | import classes from '../utils/classes' 5 | 6 | import Suggestions from './Suggestions' 7 | 8 | const TITLES = { 9 | MaybeThis: 'Maybe this...', 10 | This: 'THIS', 11 | Yes: 'YES!', 12 | } 13 | 14 | const SUGGESTIONS_VISIBLE_COUNT = 10 15 | 16 | const HeaderSearch = ({ 17 | pages = [], 18 | query = '', 19 | page, 20 | className = '', 21 | }) => { 22 | const [buttonTitle, setButtonTitle] = useState(TITLES.This) 23 | const [inputPlaceholder, setInputPlaceholder] = useState(TITLES.MaybeThis) 24 | const [inputValue, setInputValue] = useState('') 25 | const [inputMaybeValue, setInputMaybeValue] = useState('') 26 | const [suggestions, setSuggestions] = useState([]) 27 | 28 | const keywords = useMemo( 29 | () => pages.flatMap(page => { 30 | const keywords = page.keywords 31 | .split(',') 32 | .map(keyword => keyword.trim()) 33 | 34 | return keywords.length > 1 ? [] : keywords 35 | }), 36 | [pages], 37 | ) 38 | 39 | const findPages = value => { 40 | value = value.toLowerCase() 41 | 42 | const foundPages = pages.filter(page => ( 43 | page.keywords 44 | .split(',') 45 | .some(keyword => keyword.trim().toLowerCase().indexOf(value) > -1) && page.slug !== `/${query}` 46 | )) 47 | 48 | foundPages.length = Math.min(foundPages.length, SUGGESTIONS_VISIBLE_COUNT) 49 | 50 | return foundPages 51 | } 52 | 53 | const handleInputFocus = e => { 54 | if (inputValue) { 55 | const foundPages = findPages(e.target.value) 56 | 57 | setSuggestions(foundPages) 58 | } else { 59 | const randomTool = keywords[Math.floor(Math.random() * keywords.length)] 60 | 61 | setInputMaybeValue(randomTool) 62 | setInputPlaceholder(`${randomTool}?`) 63 | setButtonTitle(TITLES.Yes) 64 | } 65 | } 66 | 67 | const handleInputBlur = e => { 68 | setButtonTitle(TITLES.This) 69 | 70 | const relatedTarget = e.relatedTarget 71 | || e.explicitOriginalTarget 72 | || document.activeElement 73 | 74 | if ( 75 | inputValue 76 | && (!relatedTarget || !relatedTarget.className.includes('suggestion')) 77 | ) { 78 | setSuggestions([]) 79 | } else if (!relatedTarget || relatedTarget.id !== 'find') { 80 | setInputMaybeValue('') 81 | setInputPlaceholder(TITLES.MaybeThis) 82 | } 83 | } 84 | 85 | const handleChange = e => { 86 | setInputValue(e.target.value) 87 | 88 | if (e.target.value) { 89 | const foundPages = findPages(e.target.value) 90 | 91 | setSuggestions(foundPages) 92 | setButtonTitle(TITLES.This) 93 | } else { 94 | setSuggestions([]) 95 | 96 | if (inputPlaceholder === TITLES.MaybeThis) { 97 | setButtonTitle(TITLES.This) 98 | } else { 99 | setButtonTitle(TITLES.Yes) 100 | } 101 | } 102 | } 103 | 104 | const handleSubmit = e => { 105 | e.preventDefault() 106 | 107 | const tool = inputValue || inputMaybeValue 108 | 109 | if (tool) { 110 | const foundPages = findPages(tool) 111 | 112 | if (foundPages.length === 1) { 113 | navigate(foundPages[0].slug) 114 | } 115 | } 116 | } 117 | 118 | return ( 119 |
120 |
121 | {page 122 | ? ( 123 | <> 124 |

{`How to install ${page.title}`}

125 |

Or maybe you want to install...

126 | 127 | ) 128 | : ( 129 | <> 130 |

What do you want to install?

131 |

I want to install...

132 | 133 | )} 134 |
135 | 144 | 145 |
146 | 147 | 148 |
149 |
150 | ) 151 | } 152 | 153 | export default HeaderSearch 154 | -------------------------------------------------------------------------------- /src/markdown/mongodb.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: '/mongodb' 3 | title: 'MongoDB' 4 | keywords: 'mongodb, db' 5 | --- 6 | 7 | # Ubuntu 20.04 8 | 9 | --- 10 | 11 | ## # Using apt 12 | 13 | Install MongoDB 14 | 15 | ``` 16 | @curl@ -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - 17 | echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list 18 | sudo apt update 19 | sudo apt install mongodb-org 20 | ``` 21 | 22 | Starting the MongoDB Service 23 | 24 | ``` 25 | sudo systemctl start mongod.service 26 | sudo systemctl status mongod 27 | sudo systemctl enable mongod 28 | mongo --version # Check that the install was successful 29 | ``` 30 | 31 |
32 | 33 | # Ubuntu 18.04 34 | 35 | --- 36 | 37 | ## # Using apt 38 | 39 | Install MongoDB 40 | 41 | ``` 42 | @curl@ -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - 43 | echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list 44 | sudo apt update 45 | sudo apt install mongodb-org 46 | ``` 47 | 48 | Starting the MongoDB Service 49 | 50 | ``` 51 | sudo systemctl start mongod.service 52 | sudo systemctl status mongod 53 | sudo systemctl enable mongod 54 | mongo --version # Check that the install was successful 55 | ``` 56 | 57 |
58 | 59 | # Ubuntu 16.04 60 | 61 | --- 62 | 63 | ## # Using apt 64 | 65 | Install MongoDB 66 | 67 | ``` 68 | @wget@ -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - 69 | echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list 70 | sudo apt-get update 71 | sudo apt-get install mongodb-org 72 | ``` 73 | 74 | Starting the MongoDB Service 75 | 76 | ``` 77 | sudo systemctl start mongod 78 | sudo systemctl status mongod 79 | sudo systemctl enable mongod 80 | mongo --version # Check that the install was successful 81 | ``` 82 | 83 | Adjusting the Firewall (Optional) 84 | 85 | ``` 86 | sudo ufw allow from your_other_server_ip/32 to any port 27017 87 | sudo ufw status 88 | ``` 89 | 90 |
91 | 92 | # CentOS 8 93 | 94 | --- 95 | 96 | ## # Using dnf 97 | 98 | ``` 99 | sudo @nano@ /etc/yum.repos.d/mongodb-org.repo 100 | ``` 101 | 102 | Then add the following content to the empty file: 103 | 104 | ```ini 105 | [mongodb-org] 106 | name=MongoDB Repository 107 | baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/ 108 | gpgcheck=1 109 | enabled=1 110 | gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc 111 | ``` 112 | 113 | Following that, you can install the mongodb-org package with this command: 114 | 115 | ``` 116 | sudo dnf install mongodb-org 117 | ``` 118 | 119 | Starting the MongoDB Service 120 | 121 | ``` 122 | sudo systemctl start mongod 123 | sudo systemctl status mongod 124 | sudo systemctl enable mongod 125 | mongo --version # Check that the install was successful 126 | ``` 127 | 128 |
129 | 130 | # CentOS 7 131 | 132 | --- 133 | 134 | ## # Using yum 135 | 136 | ``` 137 | sudo @vim@ /etc/yum.repos.d/mongodb-org.repo 138 | ``` 139 | 140 | Then add the following content to the empty file: 141 | 142 | ```ini 143 | [mongodb-org-3.4] 144 | name=MongoDB Repository 145 | baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/ 146 | gpgcheck=1 147 | enabled=1 148 | gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc 149 | ``` 150 | 151 | Following that, you can install the mongodb-org package with this command: 152 | 153 | ``` 154 | sudo yum install mongodb-org 155 | ``` 156 | 157 | Starting the MongoDB Service 158 | 159 | ``` 160 | sudo systemctl start mongod 161 | sudo systemctl status mongod 162 | sudo systemctl enable mongod 163 | mongo --version # Check that the install was successful 164 | ``` 165 | 166 |
167 | 168 | # Debian 9 169 | 170 | --- 171 | 172 | ## # Using apt 173 | 174 | Download the key and pass it to apt-key add: 175 | 176 | ``` 177 | @curl@ https://www.mongodb.org/static/pgp/server-4.0.asc | sudo apt-key add - 178 | ``` 179 | 180 | Open the source list file in a text editor 181 | 182 | ``` 183 | sudo @nano@ /etc/apt/sources.list.d/mongodb-org-4.0.list 184 | ``` 185 | 186 | Then add the following content to the empty file: 187 | 188 | ```textile 189 | deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main 190 | ``` 191 | 192 | Install MongoDB 193 | 194 | ``` 195 | sudo apt update 196 | sudo apt-get install mongodb-org 197 | ``` 198 | 199 | Starting the MongoDB Service 200 | 201 | ``` 202 | sudo systemctl start mongod 203 | sudo systemctl status mongod 204 | sudo systemctl enable mongod 205 | mongo --version # Check that the install was successful 206 | ``` 207 | -------------------------------------------------------------------------------- /src/css/style.css: -------------------------------------------------------------------------------- 1 | @import './typography.css'; 2 | 3 | * { 4 | box-sizing: border-box; 5 | } 6 | 7 | body, 8 | #___gatsby, 9 | #gatsby-focus-wrapper { 10 | height: 100vh; 11 | } 12 | 13 | html, 14 | body { 15 | margin: 0; 16 | padding: 0; 17 | font-size: 14px; 18 | } 19 | 20 | h1 { 21 | text-align: center; 22 | } 23 | 24 | hr { 25 | border: none; 26 | border-bottom: 2px dashed black; 27 | width: 50%; 28 | margin: 25px auto; 29 | } 30 | 31 | a { 32 | text-decoration: none; 33 | } 34 | 35 | .dark {} 36 | 37 | .light { 38 | --page-background: linear-gradient(135deg,#0e3c5a 0%,#650041 90%); 39 | --page-color: #fff; 40 | --search-button-background: #f44336; 41 | --search-button-color: #fff; 42 | --search-button-border: none; 43 | --search-input-background: #fff; 44 | --search-input-color: #000; 45 | --search-input-border: none; 46 | --suggestions-background: #fff; 47 | --suggestions-item-color: #000; 48 | --suggestions-item-color-hover: #e4e4e4; 49 | --install-guide-background: #fff; 50 | --install-guide-color: #000; 51 | --install-guide-shadow: rgb(0 0 0 / 55%) 0px 8px 16px; 52 | --toc-background: #fff; 53 | --toc-shadow: rgb(0 0 0 / 55%) 0px 8px 16px; 54 | --toc-item-color: #000; 55 | --toc-item-color-hover: #000; 56 | --code-link-color: tomato; 57 | --code-link-color-hover: tomato; 58 | --code-link-border: 1px solid var(--code-link-color, #ccc); 59 | --code-link-border-hover: 1px solid var(--code-link-color-hover, #ccc); 60 | } 61 | 62 | .page-wrapper { 63 | width: 100%; 64 | min-height: 100%; 65 | display: flex; 66 | font-family: 'Montserrat Alternates', sans-serif; 67 | background: var(--page-background, #0e3c5a); 68 | color: var(--page, #fff); 69 | flex-direction: column; 70 | justify-content: center; 71 | align-items: center; 72 | padding: 20px; 73 | transition: background 100ms; 74 | } 75 | 76 | .header-wrapper { 77 | width: 100%; 78 | max-width: 700px; 79 | flex-grow: 1; 80 | display: flex; 81 | } 82 | 83 | .disable-overflow { 84 | overflow: hidden; 85 | } 86 | 87 | .disable-flex-grow { 88 | flex-grow: 0; 89 | } 90 | 91 | .header { 92 | margin: auto; 93 | position: relative; 94 | } 95 | 96 | .header h1 { 97 | font-weight: 600; 98 | font-size: 5rem; 99 | margin-bottom: 20px; 100 | margin-top: 0; 101 | text-align: center; 102 | letter-spacing: -0.055em; 103 | } 104 | 105 | .header h2 { 106 | font-weight: 400; 107 | font-size: 2rem; 108 | margin-bottom: 20px; 109 | text-align: center; 110 | letter-spacing: -0.055em; 111 | } 112 | 113 | .suggestions { 114 | position: absolute; 115 | display: flex; 116 | margin-top: 10px; 117 | width: 70%; 118 | text-align: center; 119 | flex-direction: column; 120 | background: var(--suggestions-background, #fff); 121 | border-radius: 5px; 122 | box-shadow: rgb(0 0 0 / 40%) 0px 5px 16px; 123 | z-index: 1; 124 | left: 50%; 125 | transform: translateX(-50%); 126 | max-height: 200px; 127 | overflow: auto; 128 | } 129 | 130 | .suggestion { 131 | text-decoration: underline; 132 | color: var(--suggestions-item-color, #000); 133 | padding: 13px 0; 134 | } 135 | 136 | .suggestion.active { 137 | font-weight: bold; 138 | background-color: var(--suggestions-item-color-hover, #e4e4e4); 139 | } 140 | 141 | .suggestion:first-child { 142 | border-radius: 5px 5px 0 0; 143 | } 144 | 145 | .suggestion:last-child { 146 | border-radius: 0 0 5px 5px; 147 | } 148 | 149 | .input-wrapper { 150 | display: flex; 151 | border-radius: 5px; 152 | background: var(--search-input-background, #fff); 153 | width: 70%; 154 | margin: auto; 155 | } 156 | 157 | .input-wrapper input[type="text"] { 158 | outline: none; 159 | border: var(--search-input-border, none); 160 | font-size: 2rem; 161 | border-radius: 5px; 162 | padding: 10px 20px; 163 | background-color: transparent; 164 | width: 100%; 165 | font-family: 'Montserrat Alternates', sans-serif; 166 | color: var(--search-input-color, #000); 167 | } 168 | 169 | .input-wrapper input[type="submit"] { 170 | border: var(--search-button-border, none); 171 | outline: none; 172 | background: var(--search-button-background, #f44336); 173 | color: var(--search-button-color, #fff); 174 | width: 100px; 175 | font-size: 1.5rem; 176 | cursor: pointer; 177 | border-radius: 0 5px 5px 0; 178 | font-family: 'Montserrat Alternates', sans-serif; 179 | text-transform: uppercase; 180 | } 181 | 182 | .install-guide-wrapper { 183 | width: 100%; 184 | display: flex; 185 | flex-direction: row; 186 | justify-content: center; 187 | } 188 | 189 | .install-guide { 190 | width: 100%; 191 | display: flex; 192 | flex-direction: column; 193 | align-items: center; 194 | max-width: 900px; 195 | } 196 | 197 | .install-guide-content { 198 | width: 100%; 199 | background: var(--install-guide-background, #f6f8fa); 200 | color: var(--install-guide-color, #24292E); 201 | margin: 20px; 202 | margin-top: 50px; 203 | padding: 15px 20px 20px 20px; 204 | box-shadow: var(--install-guide-shadow, rgb(0 0 0 / 55%) 0px 8px 16px); 205 | } 206 | 207 | .empty-column { 208 | flex-basis: 20%; 209 | } 210 | 211 | .toc-wrapper { 212 | flex-basis: 20%; 213 | display: flex; 214 | justify-content: flex-end; 215 | align-items: flex-start; 216 | position: relative; 217 | padding-top: 50px; 218 | padding-right: 20px; 219 | } 220 | 221 | .toc-wrapper.sticky { 222 | align-items: center; 223 | } 224 | 225 | .toc-wrapper.sticky .toc { 226 | position: fixed; 227 | top: 0; 228 | bottom: 0; 229 | z-index: 5; 230 | } 231 | 232 | .toc-wrapper.sticky .toc-menu { 233 | position: absolute; 234 | right: 0; 235 | top: 50%; 236 | transform: translateY(-50%); 237 | } 238 | 239 | .toc-menu { 240 | display: flex; 241 | flex-direction: column; 242 | background: var(--toc-background, #fff); 243 | padding: 10px; 244 | font-size: 1.3rem; 245 | white-space: nowrap; 246 | transition: right 100ms, left 100ms; 247 | width: 170px; 248 | border-radius: 5px; 249 | box-shadow: var(--toc-shadow, none); 250 | } 251 | 252 | .toc-menu a { 253 | text-decoration: none; 254 | color: var(--toc-item-color, #000); 255 | margin: 3px 0; 256 | position: relative; 257 | transition: left 100ms; 258 | left: 0; 259 | text-overflow: ellipsis; 260 | overflow: hidden; 261 | } 262 | 263 | .toc-menu a:hover { 264 | left: 5px; 265 | font-weight: bold; 266 | color: var(--toc-item-color-hover, #000) 267 | } 268 | 269 | .toc-open { 270 | width: 23px; 271 | background: #fff; 272 | padding: 5px; 273 | border-radius: 0 5px 5px 0; 274 | color: #000; 275 | writing-mode: vertical-rl; 276 | text-orientation: mixed; 277 | cursor: pointer; 278 | position: fixed; 279 | transition: left 100ms; 280 | top: 50%; 281 | left: -23px; 282 | transform: translateY(-50%); 283 | } 284 | 285 | .footer a { 286 | color: #fff; 287 | } 288 | 289 | .line-wrapper { 290 | display: flex; 291 | white-space: normal; 292 | } 293 | 294 | .line-wrapper a { 295 | text-decoration: none; 296 | color: var(--code-link-color, #ccc); 297 | border-bottom: var(--code-link-border, none); 298 | } 299 | 300 | .line-wrapper a:hover { 301 | font-weight: bold; 302 | color: var(--code-link-color-hover, var(--code-link-color, #ccc)); 303 | border-bottom: var(--code-link-border-hover, var(--code-link-border, none)); 304 | } 305 | 306 | .copy-button { 307 | background-image: url(../icons/copy.svg); 308 | width: 13px; 309 | height: 21px; 310 | min-width: 13px; 311 | filter: invert(50%); 312 | background-size: 100%; 313 | background-repeat: no-repeat; 314 | background-position: center; 315 | cursor: pointer; 316 | z-index: 2; 317 | margin-right: 4px; 318 | align-self: flex-start; 319 | } 320 | 321 | .copy-button:hover { 322 | filter: invert(100%); 323 | } 324 | 325 | .theme-selector { 326 | position: fixed; 327 | top: 10px; 328 | right: 10px; 329 | } 330 | 331 | .theme { 332 | width: 40px; 333 | height: 40px; 334 | border: 4px solid #fff; 335 | border-radius: 50%; 336 | cursor: pointer; 337 | transition: all 500ms; 338 | position: absolute; 339 | right: 0; 340 | top: 0; 341 | } 342 | 343 | .theme.collapsed { 344 | top: 0 !important; 345 | } 346 | 347 | @media (max-width: 1320px) { 348 | .toc-wrapper .toc { 349 | position: fixed; 350 | top: 0; 351 | left: 0; 352 | bottom: 0; 353 | z-index: 5; 354 | } 355 | 356 | .toc-wrapper .toc-menu { 357 | position: absolute; 358 | right: 0; 359 | left: -170px; 360 | top: 50%; 361 | transform: translateY(-50%); 362 | } 363 | 364 | .toc-wrapper:hover .toc-menu, .toc-open { 365 | left: 0; 366 | } 367 | 368 | .toc-wrapper:hover .toc-open { 369 | left: -23px; 370 | } 371 | } 372 | 373 | @media (max-width: 550px) { 374 | .header h1 { 375 | font-size: 4rem; 376 | } 377 | } 378 | 379 | @media (max-width: 450px) { 380 | .header h1 { 381 | font-size: 3.5rem; 382 | } 383 | 384 | .input-wrapper input[type="text"] { 385 | font-size: 1.3rem; 386 | } 387 | 388 | .install-guide h1 { 389 | font-size: 1.7rem; 390 | } 391 | 392 | .install-guide h2 { 393 | font-size: 1.2rem; 394 | } 395 | 396 | .line-wrapper { 397 | white-space: nowrap; 398 | } 399 | } 400 | 401 | @media (max-width: 400px) { 402 | .header h1 { 403 | font-size: 3rem; 404 | } 405 | 406 | .header h2 { 407 | font-size: 1.5rem; 408 | } 409 | 410 | .input-wrapper input[type="text"] { 411 | font-size: 1.3rem; 412 | } 413 | 414 | .input-wrapper input[type="submit"] { 415 | font-size: 1rem; 416 | } 417 | } 418 | 419 | @media (max-height: 700px) { 420 | .suggestions { 421 | max-height: 120px; 422 | } 423 | } --------------------------------------------------------------------------------