Bash SSH command cheatsheet
SSH into a remote server.
openssl genrsa -out key.pem 2048 | |
openssl req -new -key key.pem -out csr.pem -subj "/C=US/ST=None/L=None/O=None/CN=localhost" | |
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem | |
rm csr.pem | |
mkdir keys | |
mv cert.pem keys/cert.pem | |
mv key.pem keys/key.pem | |
echo 'keys/' >> .gitignore |
import { Page, Artboard, View, Text, useWindowDimensions } from 'react-sketchapp'; | |
const breakpoints = [360, 768, 1024]; | |
const getBreakpoint = (width) => { | |
for (let i = 0; i < breakpoints.length - 1; i += 1) { | |
if (width <= breakpoints[i]) { | |
return i; | |
} | |
} |
import React from 'react'; | |
import CookieConsent, { Cookies } from 'react-cookie-consent'; | |
import useAnalytics from './use-analytics'; | |
const App = () => { | |
const { sendPageView } = useAnalytics(); | |
useEffect(() => { | |
sendPageView('/'); // should noop if consent not given (as visitor object is not initialised) | |
}, [sendPageView]) |
zip input.zip --out split-file-output.zip -s 2g |
#!/bin/bash | |
# Start a new tmux session | |
tmux new-session -d -s mysession | |
# Split panes and arrange them in a 2x3 grid | |
tmux split-window -h | |
tmux split-window -h | |
tmux select-layout even-horizontal | |
tmux split-window -v |