start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/sh | |
SERVER="http://localhost:8081" | |
URL="$SERVER/nexus/service/local/artifact/maven/content" | |
REPO="sandbox" | |
USER="admin:admin123" | |
group=$1 | |
artifact=$2 |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)This is a resize of the actual EBS volume as opposed to adding additional disks using LVM | |
1. Follow the steps here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage_expand_partition.html | |
2. Use the instructions for gdisk further down the page to set the new partition table, not gparted or fdisk. | |
3. Reboot the instance once the partition table is written. | |
4. On the instance, execute: | |
sudo pvresize /dev/xvda2 (or whatever the device name is) | |
sudo pvdisplay | |
# Add this snippet to the top of your playbook. | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# gwillem@gmail.com | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: install python 2 | |
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
I assume no responsibility for the use of these instructions, or any negative impact they may have. You probably shouldn't do this. (Unless you really, truly hate vile cruftware like Java.)
⌘ + R
until Apple Logo appears.FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
# By default, Docker containers run as the root user. This is bad because: | |
# 1) You're more likely to modify up settings that you shouldn't be | |
# 2) If an attacker gets access to your container - well, that's bad if they're root. | |
# Here's how you can run change a Docker container to run as a non-root user | |
## CREATE APP USER ## | |
# Create the home directory for the new app user. | |
RUN mkdir -p /home/app |