What Do the Oligarchs Have in Mind for Us?
“they ‘trust me.’ dumb fucks,” –Mark Zuckerberg
Postgresql
Current version is 10.5
username and password are ‘postgres’
Installation
#apt-get update
$#apt-get install postgresql postgresql-client
Server setup
$ip addr show //from server
192.168.1.7/24
$ip addr show //from client
192.168.1.9/24
https://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html
nano /etc/postgresql/11/main/pg_hba.conf
# Allow any user from host 192.168.12.10 to connect to database
# “postgres” if the user’s password is correctly supplied.
#
# TYPE DATABASE USER ADDRESS METHOD
host postgres all 192.168.1.9/24 trust
- Must reload configuration after this modification:
su - postgres
/usr/lib/postgresql/10/bin/pg_ctl reload
OR
root@cellar:/home/mbc# pg_ctlcluster 11 main restart
OR
SELECT pg_reload_conf(); from psql
- Must modify postgresql.conf to listen for all addresses
# grep listen /etc/postgresql/10/main/postgresql.conf
listen_addresses = ‘localhost’
#nano /etc/postgresql/10/main/postgresql.conf
# grep listen /etc/postgresql/10/main/postgresql.conf
listen_addresses = ‘*’
Must restart server after this modification
#/usr/lib/postgresql/10/bin/pg_ctl restart -D “/etc/postgresql/10/main”
OR
root@cellar:/home/mbc# pg_ctlcluster 11 main restart
# 2021 March sudo systemctl stop postgresql@11-main to stop
Client setup
#apt-get update
#apt-get install postgresql-client
$ping 192.168.1.7
be sure to get a response
# psql -U postgres -h 192.168.1.7
Welcome to psql 8.1.11 (server 8.4.18), the PostgreSQL interactive terminal.
postgres=#
Extensions
Extensions can be loaded by superuser only.
Extensions can be used by loader only.
Make a regular user a superuser, load extension, revoke superuser status.
su postgres
psql
alter role user_name superuser;
#then create the extension as the user in a different screen
CREATE EXTENSION intarray;
#back to role swapping screen
alter role user_name nosuperuser;
DROP extension; to remove extension
Initialize users/schema
psql -U postgres -h 192.168.1.11 -d lndb
postgres is the superuser
usually there is a database postgres
to see all databases
SELECT datname FROM pg_database;
\du to show all users
Must login as superuser to create a schema
PGbouncer
Needed to terminate artanis persistent connections
Install libevent
Install pgbouncer
./config –prefix=/usr/local
make
#make install
INSTALL pgbouncer /usr/local/bin
INSTALL README.md /usr/local/share/doc/pgbouncer
INSTALL NEWS.md /usr/local/share/doc/pgbouncer
INSTALL etc/pgbouncer.ini /usr/local/share/doc/pgbouncer
INSTALL etc/userlist.txt /usr/local/share/doc/pgbouncer
INSTALL doc/pgbouncer.1 /usr/local/share/man/man1
INSTALL doc/pgbouncer.5 /usr/local/share/man/man5
pgbouncer runs on a different port, so start it up in a terminal each session
$pgbouncer -d ./syncd/pgbouncer.ini
$psql -U ln_admin -p 6432 -d lndb -h 127.0.0.1
note the port
1 | lndb = host=127.0.0.1 port=5432 dbname=lndb |
1 | "ln_admin" "welcome" |
init.el
;_____________________________________________________________________________
;;;;SQLi setup
(require ‘sqlup-mode)
;; Capitalize keywords in SQL mode
(add-hook ‘sql-mode-hook ‘sqlup-mode)
;; Capitalize keywords in an interactive session (e.g. psql)
(add-hook ‘sql-interactive-mode-hook ‘sqlup-mode)
;; Set a global keyword to use sqlup on a region
(global-set-key (kbd “C-c u”) ‘sqlup-capitalize-keywords-in-region)
(setq sql-postgres-login-params
‘((user :default “postgres”)
(database :default “postgres”)
(server :default “192.168.1.7”)
(port :default 5432)))
(add-hook ‘sql-interactive-mode-hook
(lambda ()
(define-key sql-mode-map ‘[f5] ‘sql-send-region)
(toggle-truncate-lines t)))
to launch: M-x sql-postgres
Gradle notes
Use the local Maven repository
1 | repositories { |
1 | dependencies { |
gradle build –refresh-dependencies
Include other jars in the dependencies. Define the variable extraLibs
1 | configurations { |
In the dependencies, add the jars to extraLibs:
1 |
|
Show contents of the cache:
1 | task showMeCache doLast{ |
1 | task refreshLicense(type: Copy) { |
1 | task myJavadocs(type: Javadoc) { |
1 | task copyJavaDocsToWeb(type: Copy, dependsOn: [myJavadocs]) { |
task getDeps(type: Exec) {
configurations.testRuntime.files
commandLine ‘echo’, ‘Downloaded all dependencies’
}
//update the local Maven repository
task updateMaven(type: Exec) {
executable "mvn"
args "install:install-file", "-Dfile=/home/mbc/Downloads/postgresql-42.2.5.jar", "-DgroupId=org.postgresql", "-DartifactId=postgresql", "-Dversion=42.2.5", "-Dpackaging=jar"
// args “install:install-file”, “-Dfile=/home/mbc/Downloads/poi-bin-4.0.1-20181203/poi-4.0.1/poi-ooxml-4.0.1.jar”, “-DgroupId=org.apache”, “-DartifactId=poi-ooxml”, “-Dversion=4.0.1”, “-Dpackaging=jar”
// args “install:install-file”, “-Dfile=build/libs/pm-0.1.jar”, “-DgroupId=net.stihie”, “-DartifactId=pm”, “-Dversion=0.1”, “-Dpackaging=jar”
}
task makeHelp(type: Copy, dependsOn: [copyJavaDocsToWeb, copySchemaDocsToWeb]){
}
task getDeps(type: Exec) {
configurations.testRuntime.files
commandLine ‘echo’, ‘Downloaded all dependencies’
}
//update the local Maven repository
task updateMaven(type: Exec) {
executable "mvn"
args "install:install-file", "-Dfile=/home/mbc/Downloads/postgresql-42.2.5.jar", "-DgroupId=org.postgresql", "-DartifactId=postgresql", "-Dversion=42.2.5", "-Dpackaging=jar"
// args “install:install-file”, “-Dfile=/home/mbc/Downloads/poi-bin-4.0.1-20181203/poi-4.0.1/poi-ooxml-4.0.1.jar”, “-DgroupId=org.apache”, “-DartifactId=poi-ooxml”, “-Dversion=4.0.1”, “-Dpackaging=jar”
// args “install:install-file”, “-Dfile=build/libs/pm-0.1.jar”, “-DgroupId=net.stihie”, “-DartifactId=pm”, “-Dversion=0.1”, “-Dpackaging=jar”
}
1 | task initializePostgres(type:Exec) { |
1 | task refreshLicense(type: Copy) { |
JavaDocs and Schema
1 | task myJavadocs(type: Javadoc) { |
Prep the development environment
1 | task prep { |
Bitcoin/Litecoin License Manager plug-in
Before using the plugin, you need to generate license.ser
files. Learn how to here.
The BLLM plug-in is the code you will integrate into your software, likely making it available as a menu item under “Help/License”.
The workflow for obtaining a license looks like this:
Download BLLM from Github
Github link here.
Note that the license file has to be handled separately. Generate a license file with the Bitcoin/Litecoin License Manager License Key Generator and include the license in your programs installation directory or another directory of your choosing. Users will need read write access to the directory containg the license.ser
file. The license file license.ser
should NOT be packaged in your applications jar file.
Integrate BLLM into your application
Provide a menu item that will launch BLLM:
In the ActionListener of your menu item, launch the main window for BLLM
1 |
|
If you are working with Gradle, you can install BLLM in your local repository and make BLLM a dependency. First add to the local repository:
1 | >mvn install:install-file -Dfile=build/libs/bllm-0.1.jar -DgroupId=net.stihie -DartifactId=bllm -Dversion=0.1 -Dpackaging=jar |
Check your ./.m2 directory and be sure it is there. Then in your gradle.build file:
1 | repositories { |
Javadocs available here.
bllmplugin/javadoc/allclasses-noframe
All Classes
- BitcoinPriceObject
- BitcoinPriceObject.Value
- CryptoCalculator
- DialogLicenseManager
- DialogQRCode
- License
- LicensedPanel
- LicenseManager
- LicenseReaderWriter
- LicenseReaderWriterTest
- LitecoinPriceObject
- LitecoinPriceObject.Data
- LitecoinPriceObject.Data.Quotes
- LitecoinPriceObject.Data.Quotes.USd
- LitecoinPriceObject.Metadata
- LitecoinPriceObject.Metadata.Error
- Main
- Transaction
- TransactionFailedPanel
- TransactionObject
- TransactionObject.Input
- TransactionObject.Output
- UnlicensedPanel
bllmplugin/javadoc/constant-values
Constant Field Values
Contents
bllmplugin/javadoc/allclasses-frame
All Classes
- BitcoinPriceObject
- BitcoinPriceObject.Value
- CryptoCalculator
- DialogLicenseManager
- DialogQRCode
- License
- LicensedPanel
- LicenseManager
- LicenseReaderWriter
- LicenseReaderWriterTest
- LitecoinPriceObject
- LitecoinPriceObject.Data
- LitecoinPriceObject.Data.Quotes
- LitecoinPriceObject.Data.Quotes.USd
- LitecoinPriceObject.Metadata
- LitecoinPriceObject.Metadata.Error
- Main
- Transaction
- TransactionFailedPanel
- TransactionObject
- TransactionObject.Input
- TransactionObject.Output
- UnlicensedPanel
bllmplugin/javadoc/help-doc
How This API Document Is Organized
-
Package
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
- Interfaces (italic)
- Classes
- Enums
- Exceptions
- Errors
- Annotation Types
-
Class/Interface
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
- Class inheritance diagram
- Direct Subclasses
- All Known Subinterfaces
- All Known Implementing Classes
- Class/interface declaration
- Class/interface description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Detail
- Constructor Detail
- Method Detail
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-
Annotation Type
Each annotation type has its own separate page with the following sections:
- Annotation Type declaration
- Annotation Type description
- Required Element Summary
- Optional Element Summary
- Element Detail
-
Enum
Each enum has its own separate page with the following sections:
- Enum declaration
- Enum description
- Enum Constant Summary
- Enum Constant Detail
-
Tree (Class Hierarchy)
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with
java.lang.Object
. The interfaces do not inherit fromjava.lang.Object
.- When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
- When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
-
Deprecated API
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-
Index
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-
Prev/Next
These links take you to the next or previous class, interface, package, or related page.
-
Frames/No Frames
These links show and hide the HTML frames. All pages are available with or without frames.
-
All Classes
The All Classes link shows all classes and interfaces except non-static nested types.
-
Serialized Form
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
-
Constant Field Values
The Constant Field Values page lists the static final fields and their values.