Modern Educayshun
Modern Educayshun. Didn’t like it.
Taking things literally
Reply
I’m a thief. I take things literally.
Putting SELinux in Permissive mode on Fedora
See here for details. Basically edit /etc/selinux/config and change ‘enforcing’ to ‘permissive’.
How to downgrade a package in Debian using apt-get and apt-cache
See here. Basically:
dpkg --list apt-cache showpkg packagename apt-get install packagename=version echo "packagename hold" | sudo dpkg --set-selections
Administering PostgreSQL
So I found this article which said:
$ sudo -u postgres psql
postgres=> alter user postgres password 'apassword'; postgres=> create user your-user createdb createuser password 'passwd'; postgres=> create database your-db-name owner your-user; postgres=> \q
Note: to enable password logins for the ‘postgres’ admin account, edit: /etc/postgresql/9.4/main/pg_hba.conf and after this line:
local all postgres peer
Add this line:
local all postgres md5
How do I list all databases and tables using psql?
So I found this which said:
- \list or \l
- list all databases
- \dt
- list all tables in the current database
Converting a C++ std::string to char*
So it turns out there is a std::string->c_str function. Note: I’m pretty sure this char[] will be deleted when the std::string is deleted…
C++ PostgreSQL example
Just followed this tutorial on how to create a basic C++ app that talks to a PostgreSQL database…
Code Assistance for C++ in NetBeans: define __cplusplus
See here:
- Go to Tools->Options
- Select C/C++ menu
- Select Code Assistance tab
- Select C++ Compiler tab
- In Macro Definitions list view, locate __cplusplus and change its value from 199711L to 201103L
- Click OK button
