chmod: 1=x, 2=w, 4=r
chmod (user)(group)(other) chmod 730 # only the user can rwx, read permission to the group or other
chown owner:group file
#!/bin/bash | |
# | |
# copy this into /etc/profile.d/instance-name-tag.sh | |
# | |
# you will need: | |
# - curl, jq, and aws cli installed | |
# - an IAM role that gives the EC2 instance access to describe tags | |
# |
In addition to the aforementioned functions, you can use pattern matching and the cons operator | to split a list into head and tail; we’ll learn more about this pattern in later lessons:
iex> [h|t] = [3.14, :pie, "Apple"]
[3.14, :pie, "Apple"]
iex> h
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
Get request
curl -o website https://domain.com curl -O https://domain.com/file.zip
curl -I http://domain.com