Long version
netstat --tcp --listening --programs --numeric
Short version
netstat -tlpn
cd
mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
sh -c 'echo "ssh-rsa ... sample@example.com" >> ~/.ssh/authorized_keys'
chmod 600 ~/.ssh/authorized_keys
#!/bin/bash | |
curl -fsSL https://get.docker.com/rootless | sh | |
# Content to be added to .bashrc | |
content='export PATH="$HOME/bin:$PATH"' | |
# Check if content already exists in .bashrc | |
if grep -Fxq "$content" ~/.bashrc; then | |
echo "Content for bin path already exists in .bashrc. Skipping addition." |
Function values allow you to pass behaviour to be executed, rather that data to be interpreted. Which allows behaviour to be executed in different contexts.
I hereby claim:
To claim this, I am signing this object:
# https://play.golang.org/p/JxqibtHkuO- | |
func chunkBy(items []string, chunkSize int) (chunks [][]string) { | |
for chunkSize < len(items) { | |
items, chunks = items[chunkSize:], append(chunks, items[0:chunkSize:chunkSize]) | |
} | |
return append(chunks, items) | |
} |
#!/bin/bash | |
wget https://github.com/protocolbuffers/protobuf/archive/v3.7.0rc2.tar.gz | |
tar -zxvf protobuf-3.7.0rc2.tar.gz | |
cd protobuf-3.7.0rc2 | |
./autogen.sh | |
./configure | |
make | |
make install |
defmodule JSON do | |
@moduledoc false | |
@encode_opts [:use_nil] | |
@decode_opts [:return_maps, :use_nil] | |
alias :jiffy, as: Jiffy | |
@doc """ | |
Encode and return tuple |
defmodule Base62 do | |
@moduledoc """ | |
Base62 encoder | |
Copied from: https://github.com/otobus/event_bus/commit/956ffd93d854fb3a721aa7763c3da509cffedd41#diff-31f9094877d525a1b8387d4135042006R1 | |
""" | |
@mapping '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' | |
@doc """ | |
Converts given integer to base62 |
#!/bin/bash | |
################################################################################ | |
# Second Redis server with port 49263 | |
################################################################################ | |
# Create dir for storage | |
sudo mkdir /var/lib/redis/49263 | |
# Copy conf |