Start up a container (whichever Linux flavour takes your fancy):
docker run -it ubuntu /bin/bash
docker run -it centos /bin/bash
# Rails production setup via SQLite3 made durable by https://litestream.io/ | |
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
# | |
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
# | |
# in production you might want to map /data to somewhere on the host, | |
# but you don't have to! | |
# | |
FROM ruby:3.0.2 |
<?php | |
define('DB_HOST', 'localhost'); | |
define('DB_NAME', 'name'); | |
define('DB_USER', 'user'); | |
define('DB_PASSWORD', 'password'); | |
/** | |
* You can also include other environment specifc | |
* definitions here, such as enabling debug for |
#!/bin/bash | |
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine | |
# Used to provide DDNS service for my home | |
# Needs the DNS record pre-creating on Cloudflare | |
# Proxy - uncomment and provide details if using a proxy | |
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport> | |
# Cloudflare zone is the zone which holds the record |
# This is a blocklist to block samsung smart tv's sending meta data at home. | |
# Please help to collect domains! | |
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident. | |
device-metrics-us.amazon.com | |
samsungacr.com | |
samsungcloudsolution.com | |
samsungcloudsolution.net | |
pavv.co.kr | |
samsungotn.net |
function prompt_wikimatze_precmd { | |
git-info | |
} | |
function prompt_wikimatze_setup { | |
setopt LOCAL_OPTIONS | |
unsetopt XTRACE KSH_ARRAYS | |
prompt_opts=(cr percent subst) | |
# Load required functions. |
# Install Bash 5 using homebrew | |
# brew install bash | |
# Or build bash 4 from source... | |
curl -O http://ftp.gnu.org/gnu/bash/bash-4.4.18.tar.gz | |
tar xzf bash-4.4.18.tar.gz | |
cd bash-4.4.18 | |
./configure --prefix=/usr/local/bin && make && sudo make install | |
# Add the new shell to the list of legit shells |
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)To use the most modern version of Postgres software we need to add postgresql repository. Edit /etc/apt/sources.list
or create /etc/apt/sources.list.d/pgdg.list
and add there a line: deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
Then import the repository signing key, and update the package lists:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
Install a new version of PostgreSQL server.
sudo apt-get install postgresql-9.6