Skip to content

Instantly share code, notes, and snippets.

$ sudo mkdir -p /opt/local/var/db/postgresql94/defaultdb
$ sudo chown postgres:postgres /opt/local/var/db/postgresql94/defaultdb
$ sudo su postgres -c '/opt/local/lib/postgresql94/bin/initdb -D /opt/local/var/db/postgresql94/defaultdb'
@bsnyder
bsnyder / gist:9c3dd002e5b58a5f243d
Created October 15, 2014 19:58
Install PosgreSQL 9.4 using MacPorts
$ sudo port install postgresql94 postgresql94-server postgresql94-doc
@bsnyder
bsnyder / gist:c1138183da6a3017022a
Created October 15, 2014 19:57
Find the latest version of PostgreSQL using MacPorts
$ sudo port search postgresql | grep '^postgresql\d\d'
postgresql80 @8.0.26 (databases)
postgresql80-doc @8.0.26 (databases)
postgresql80-server @8.0.26 (databases)
postgresql81 @8.1.23 (databases)
postgresql81-doc @8.1.23 (databases)
postgresql81-server @8.1.23 (databases)
postgresql82 @8.2.23 (databases)
postgresql82-doc @8.2.23 (databases)
postgresql82-server @8.2.23 (databases)
@bsnyder
bsnyder / gist:f8ec195a891c22c7b56d
Last active August 13, 2023 23:27
How to upgrade bash using MacPorts
$ sudo port selfupdate
Password:
---> Updating MacPorts base sources using rsync
MacPorts base version 2.3.1 installed,
MacPorts base version 2.3.1 downloaded.
---> Updating the ports tree
---> MacPorts base is already the latest version
The ports tree has been updated. To upgrade your installed ports, you should run
port upgrade outdated
@bsnyder
bsnyder / gist:5c4b0c3c1bc643a861c6
Last active August 29, 2015 14:07
The command to test bash on your machine
$ curl https://shellshocker.net/shellshock_test.sh | /bin/bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2009 100 2009 0 0 6200 0 --:--:-- --:--:-- --:--:-- 6258
CVE-2014-6271 (original shellshock): not vulnerable
bash: shellshocker: command not found
CVE-2014-6278 (Florian's patch): not vulnerable
CVE-2014-7169 (taviso bug): not vulnerable
CVE-2014-//// (exploit 3 on http://shellshocker.net/): not vulnerable
CVE-2014-7186 (redir_stack bug): not vulnerable
@bsnyder
bsnyder / gist:4fc655d5ceccbaefe913
Last active August 29, 2015 14:07
The command to test bash on your machine
$ curl https://shellshocker.net/shellshock_test.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2009 100 2009 0 0 3044 0 --:--:-- --:--:-- --:--:-- 3240
CVE-2014-6271 (original shellshock): not vulnerable
bash: shellshocker: command not found
CVE-2014-6278 (Florian's patch): not vulnerable
CVE-2014-7169 (taviso bug): not vulnerable
CVE-2014-//// (exploit 3 on http://shellshocker.net/): not vulnerable
CVE-2014-7186 (redir_stack bug): not vulnerable
### Keybase proof
I hereby claim:
* I am bsnyder on github.
* I am bsnyder (https://keybase.io/bsnyder) on keybase.
* I have a public key whose fingerprint is 910A D992 C9CF 79F3 7804 AB90 FEEA 5B23 2C98 3957
To claim this, I am signing this object:
@bsnyder
bsnyder / gist:3750515
Last active October 10, 2015 21:07
DISTINGUISHING JMS MESSAGE DURABILITY FROM MESSAGE PERSISTENCE
DISTINGUISHING MESSAGE DURABILITY FROM MESSAGE PERSISTENCE
Two points within JMS that are often confused are message durability and message persistence. Though they’re similar, there are some semantic differences between them and each has its specific purpose. Message durability can only be achieved with the pub/sub domain. When clients connect to a topic, they can do so using a durable or a nondurable subscription. Consider the differences between the two:
* Durable subscription—A durable subscription is infinite. It’s registered with the topic subscription to tell the JMS provider to preserve the subscription state in the event that the subscriber disconnects. If a durable subscriber disconnects, the JMS provider will hold all messages until that subscriber connects again or
until the subscriber explicitly unsubscribes from the topic.
* Nondurable subscription—A nondurable subscription is finite. It’s registered with
the topic subscription to tell the JMS provider to not preserve the subscription state in