Use these screenrc commands to bind specific key sequences to commands outside of the escape sequence (normally C-a). You can bind key combos to commands this way so you don't always have to prefix commands with your escape key sequence:
# Bind Control-PageDown to 'next', Control-PageUp to 'prev' # to navigate between windows bindkey ^[[5;5~ prev bindkey ^[[6;5~ next # Bind arrow keys Control-Down to 'next', Control-Up to 'prev' # to navigate between windows bindkey ^[[1;5A prev bindkey ^[[1;5B next
(The keycodes for these keys can be obtained by running cat > /dev/null and pressing the desired key combination.)
bindingbindkeycommandsconfigurationescapekeystrokesscreenscreenrc
The default binding is typically C-a. I like to use C-j:
escape "^j^j"
I also like to use C-j l to get a window list instead of C-j ":
bind 'l' windowlist -b
bindbindingescapegotchakeystrokesscreenscreenrcwindowlist
Use the psycopg.Binary() function to escape the binary data:
>>> db = psycopg.connect("dbname=%s user=%s" % (database, user))
>>> db.autocommit(True)
>>> cursor = db.cursor()
>>> file = "/path/to/binary_file.jpg"
>>> fd = open(file, "r")
>>> contents = fd.read(os.stat(file)[6])
>>> fd.close()
>>> cursor.execute("INSERT INTO pr0n (image) VALUES (%s)", (psycopg.Binary(contents)))
binarybyteacursordbapiescapeinteractivelanguagespostgresqlprogrammingpsycopgpython
Set the PROMPT1 variable using psql prompt escape sequences:
\set PROMPT1 '[%n@%M:%/]=%# '
commandsconfigurationescapepostgresqlpsqlvariables