In Server.app 2.1.1 for OSX Mountain Lion, the PostgreSQL configuration file has been moved from
to its new location at
You no longer need administrative privileges to edit it.
Here are a few notes to remind myself how to connect to the default postgres instance used by OSX Server.app on Mountain Lion.
- Enable "Websites" in Server.app.
- Check if postgres is running
- If it's not, turn it on
- In order to connect with pgAdmin (and maybe through the terminal too), edit the file
- Then restart postgres
- Now, connecting with psql in terminal still causes this error (use template1 as the database name if you don't already have a database set up):
- My preference to work around this is to create a user named "root" in the database, so I can just login with sudo. In order to do this, first login as the default user (_postgres). Use your own password.
sudo serveradmin fullstatus postgres
sudo serveradmin start postgres
UPDATE: The config file moved in the Server.app 2.1.1 update. It's now at:
sudo serveradmin stop postgres sudo serveradmin start postgres
server:~ shellperson$ psql template1 psql: could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
server:~ shellperson$ sudo -u _postgres psql template1 Password: psql (9.1.4) Type "help" for help. template1=# create role root login; CREATE ROLE template1=# \q
Once the user is created, you can login with "sudo psql databaseName".
server:~ shellperson$ sudo psql template1
This is so easy it's hardly worth writing, but perhaps it will be of some value. Here's how I installed Adobe Reader 9.4 in Debian Lenny (32 bit, x86).
- Download Adobe Reader 9.4 from http://get.adobe.com/reader/. Alternatively, I think you could use this direct link with wget: http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.4.0/enu/AdbeRdr9.4-1_i486linux_enu.bin
- Make the installation binary file executable:
chmod +x AdbeRdr9.4-1_i486linux_enu.bin
- Start the installation (as su or sudo):
- Tell the installer where you want Reader installed. It suggests /opt, which is a fine place to put it.
- You're done. Open a PDF with:
Here are a few notes I've made on keeping the the screen from blanking in linux. I generally am using Ratpoison (and sometimes just the console), so these are notes on how to disable screen blanking in X and console situations, not the higher-level GNOME or KDE screensaver. I've come up with a configuration that works to keep my screen from ever turning off, but I don't have an in-depth understanding of exactly what's being done. Some of this may be redundant.
I discovered the scripting-friendly pastebin http://sprunge.us a few days ago via One Thing Well. It's extremely convenient to use, but in my laziness I've tried to make it even easier. Here is a script that will upload to sprunge and return the URL. It accepts piped data, STDIN redirection, filenames as arguments, and text strings as arguments. EDIT: while using the script, I just realized that using either form of STDIN input (pipe or redirection) will treat tabs as spaces. While this will occasionally break code, it will almost always make it less legible. So, if you need to preserve tab whitespace, I suggest using a filename as an argument to the script (e.g. sprunge myscript.txt). (Click "show source")
If you need to discover from which package a particular program came from, you can use this command (note that that is a capital "S"):
dpkg -S /usr/bin/file_i_am_curious_about
Here's an example:
james@tv:~$ dpkg -S /usr/bin/sensible-browser debianutils: /usr/bin/sensible-browser
This was necessary because I apparently deleted /usr/bin/sensible-browser (which is a script that determines which web browser should be the default). To replace it, I needed to know the original package name, which turned out to be debianutils. From there it was a simple matter to do:
sudo apt-get install --reinstall debianutils
Debian uses the symlink /usr/bin/sensible-editor to point to the default text editor to use. This is controlled by the Debian Alternatives system, which will work automatically if you want it to. If, however, you want to change the auto-selected "sensible editor", you can do so with this command:
sudo update-alternatives --config editor
This will let you select one of your installed text editors from a list that will look something like this:
There are 5 alternatives which provide `editor'. Selection Alternative ----------------------------------------------- 1 /bin/ed + 2 /bin/nano 3 /usr/bin/vim.tiny 4 /usr/bin/mcedit-debian * 5 /usr/bin/vim.basic Press enter to keep the default[*], or type selection number:
The "+" indicates the editor that would be selected if Debian had to choose, the "*" indicates your current choice.
Debian also maintains symlinks for sensible-browser and sensible-pager. You can change those easily as well:
sudo update-alternatives --config x-www-browser sudo update-alternatives --config pager
If you find that your favorite program is not included in the list (most likely because it wasn't installed from a .deb package), you can add it like so:
sudo update-alternatives --install x-www-browser x-www-browser /usr/local/src/firefox/firefox 900
In English, this means install into the category x-www-browser, using the symlink named x-www-browser (found in /etc/alternatives), which points to the binary at /usr/local/src/firefox/firefox, and give it a numerical priority of 900. The priority determines which program Debian would select if set to auto. The largest number wins. This is how I added firefox into the list of potential sensible-browser selections.
Here are some notes on assigning functions to those special keys that come on so many keyboards. My Gateway SK-9920 has 12 of these hotkeys: volume up, down, and mute; play, stop, next, and last track; internet, help, mail, shopping cart (?), and back (presumably). I don't even know what the creators of this keyboard envisioned for the "shopping cart" key. Often these keys aren't recognized out-of-the-box in Windows, much less in Linux.
Like usual, there are almost certainly specific GNOME or KDE tools to accomplish this goal. Since I'm not running those, however, I'll stick to tools available in almost any X.Org environment (I happen to be using Ratpoison).
I doubt many people will be searching for this post...
I like the Super Contacts app for the Palm Pre, and I decided to put it in the quicklaunch dock instead of Palm's default Contacts app. The only problem with this is that the Super Contacts app is really ugly (my apologies, guys-who-made-it, I admit I'm shallow). Here's what I did to replace it with Palm's Contacts icon.
EDIT (8.5.2010) - No longer works. I give up, Google. The new interface is worse, but I suppose I'll get over it.
EDIT - This method no longer works. Google has updated their Labs search to use the new layout. Instead, you can use this URL to keep the old-fashioned Google:
I saw the new Google search results page layout for the first time tonight. I then googled "turn off new google layout". I suppose I don't handle change very well. If you hate the new Google layout too, here's how to fix it: