16S ribosomal RNA Updated 2025-07-16
5S ribosomal RNA Updated 2025-07-16
23S ribosomal RNA Updated 2025-07-16
EF-Tu Updated 2025-07-16
PostgreSQL getting started Updated 2025-07-16
On Ubuntu 20.10 PostgreSQL 12.6, login with
psql on my default username without sudo fails with: stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-existThis is the one that worked on Ubuntu 21.04: stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist/38444152#38444152Explanation:
sudo -u postgres createuser -s $(whoami)
createdb $(whoami)You can now run shows that peer authentication is available to all users apparently:
psql without any password. This works without password due to peer authentication:sudo cat /etc/postgresql/12/main/pg_hba.conflocal all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peerList users:output:
psql -c '\du' List of roles
Role name | Attributes | Member of
-------------+------------------------------------------------------------+-----------
ciro | Superuser, Create role, Create DB | {}
owning_user | | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}Delete user later on:
psql -c 'DROP USER username;'Help toplevel:
helpList supported SQL commands:
\hShow syntax for one type of command:
\h SELECTList all databases:which shows:
psql -c '\l' Name | Owner | Encoding | Collate | Ctype | Access privileges
-------------+----------+----------+-------------+-------------+-----------------------
ciro | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
postgres | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
template0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
testdb0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
(6 rows)If you didn't give a database from the command line e.g.:you can do that afterwards with:
psql\c testdb0Let's create a table and test that it is working:
psql testdb0 -c 'CREATE TABLE table0 (int0 INT, char0 CHAR(16));'List tables, no special tables:gives:
psql testdb0 -c '\dt' List of relations
Schema | Name | Type | Owner
--------+--------+-------+-------
public | table0 | table | ciro
(1 row)View table schema: stackoverflow.com/questions/109325/postgresql-describe-tableoutput:
psql testdb0 -c '\d+ table0' Table "public.table0"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------------+-----------+----------+---------+----------+--------------+-------------
int0 | integer | | | | plain | |
char0 | character(16) | | | | extended | |Insert some data into it and get the data out:output:
psql testdb0 -c "INSERT INTO table0 (int0, char0) VALUES (2, 'two'), (3, 'three'), (5, 'five'), (7, 'seven');"
psql testdb0 -c 'SELECT * FROM table0;' int0 | char0
------+------------------
2 | two
3 | three
5 | five
7 | seven
(4 rows)Delete the table:
psql testdb0 -c 'DROP TABLE table0;' Create a test user in PostgreSQL Updated 2025-07-16
In order to create a test user with password instead of peer authentication, let's create test user:
createuser -P user0
createdb user0-P makes it prompt for the users password.Alternatively, to create the password non-interactively stackoverflow.com/questions/42419559/postgres-createuser-with-password-from-terminal:Can't find a way using the
psql -c "create role NewRole with login password 'secret'"createuser helper.We can then login with that password with:which asks for the password we've just set, because the
psql -U user0 -h localhost-h option turns off peer authentication, and turns off password authentication.The password can be given non-interactively as shown at stackoverflow.com/questions/6405127/how-do-i-specify-a-password-to-psql-non-interactively with the
PGPASSWORD environment variable:PGPASSWORD=a psql -U user0 -h localhostNow let's create a test database which
user0 can access with an existing superuser account:createdb user0db0
psql -c 'GRANT ALL PRIVILEGES ON DATABASE user0db0 TO user0'We can check this permission with:which now contains:The permission letters are explained at:
psql -c '\l' List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
user0db0 | ciro | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =Tc/ciro +
| | | | | ciro=CTc/ciro +
| | | | | user0=CTc/cirouser0 can now do the usual table operations on that table:PGPASSWORD=a psql -U user0 -h localhost user0db0 -c 'CREATE TABLE table0 (int0 INT, char0 CHAR(16));'
PGPASSWORD=a psql -U user0 -h localhost user0db0 -c "INSERT INTO table0 (int0, char0) VALUES (2, 'two'), (3, 'three'), (5, 'five'), (7, 'seven');"
PGPASSWORD=a psql -U user0 -h localhost user0db0 -c 'SELECT * FROM table0;' Peer authentication Updated 2025-07-16
PostgreSQL logging Updated 2025-07-16
Ubuntu 21.10 has a certain default level of logging by default to:but it does not log everything, only/mostly errors it seems.
/var/log/postgresql/postgresql-13-main.logSetting:under:and then restarting the server:just works.
log_statement = 'all'/etc/postgresql/13/main/postgresql.confsudo service restart postgresqlRealtime monitoring for long queries instead: stackoverflow.com/questions/8597516/app-to-monitor-postgresql-queries-in-real-time
PostgreSQL serialization failure Updated 2025-07-16
When using SQL REPEATABLE READ isolation level and SQL SERIALIZABLE isolation level, concurrent transactions may fail with a serialization failure, and then you might need to retry them. You server code or your ORM must always account for that.
Related questions:
- stackoverflow.com/questions/7705273/what-are-the-conditions-for-encountering-a-serialization-failure
- stackoverflow.com/questions/59351109/error-could-not-serialize-access-due-to-concurrent-update
- stackoverflow.com/questions/50797097/postgres-could-not-serialize-access-due-to-concurrent-update/51932824
Acousto-optic modulator Updated 2025-07-16
An optical multiplexer!
Interferometer Updated 2025-07-16
Optical fibre Updated 2025-07-16
Optical table Updated 2025-07-16
The breadboard of photonics!
For example, that is how most modern microscopes are prototyped, see for example Video "Two Photon Microscopy by Nemonic NeuroNex (2019)".
This is kind of why they are also sometimes called "optical breadboarbds", since breadboards are what we use for early prototyping in electronics. Wikipedia however says "optical breadboard" is a simpler and cheaper type of optical table with less/no stabilization.
Optical ring resonator Updated 2025-07-16
Polarization of light Updated 2025-07-16
This section discusses the pre-photon understanding of the polarization of light. For the photon one see: photon polarization.
People were a bit confused when experiments started to show that light might be polarized. How could a wave that propages through a 3D homgenous material like luminiferous aether have polarization?? Light would presumably be understood to be analogous to a sound wave in 3D medium, which cannot have polarization. This was before Maxwell's equations, in the early 19th century, so there was no way to know.
Polarizer Updated 2025-07-16
A device that modifies photon polarization.
As mentioned at Video "Quantum Mechanics 9b - Photon Spin and Schrodinger's Cat II by ViaScience (2013)", it can be modelled as a bra.
Epistle to the Romans Updated 2025-07-16
Ilana Wisby Updated 2025-07-16
Founding CEO of Oxford Quantum Circuits.
As mentioned at www.investmentmonitor.ai/tech/innovation/in-conversation-with-oxford-quantum-circuits-ilana-wisby she is not the original tech person:Did they mean Oxford Sciences Enterprises? There's nothing called "Oxford Science and Innovation" on Google. Yes, it is just a typo oxfordscienceenterprises.com/news/meet-the-founder-ilana-wisby-ceo-of-oxford-quantum-circuits/ says it clearly:
she was finally headhunted by Oxford Science and Innovation to become the founding CEO of OQC. The company was spun out of Oxford University's physics department in 2017, at which point Wisby was handed "a laptop and a patent".
I was headhunted by Oxford Sciences Enterprises to be the founding CEO of OQC.
oxfordquantumcircuits.com/story mentions that the core patent was by Dr. Peter Leek: www.linkedin.com/in/peter-leek-00954b62/
How to use an Oxford Nanopore MinION to extract DNA from river water and determine which bacteria live in it Updated 2025-07-16
This article gives an idea of how this kind of biological experiment feels like to a software engineer who has never done any biology like Ciro Santilli.
octokit.js Updated 2025-07-16
There are unlisted articles, also show them or only show them.