Shell Person Help me keep the shell people alive.

30Sep/120

New Location for org.postgresql.postgres.plist in Server.app 2.1.1

In Server.app 2.1.1 for OSX Mountain Lion, the PostgreSQL configuration file has been moved from

/System/Library/LaunchDaemons/org.postgresql.postgres.plist

to its new location at

/Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist

You no longer need administrative privileges to edit it.

18Sep/120

Connect to OSX Server.app postgresql on Mountain Lion

Here are a few notes to remind myself how to connect to the default postgres instance used by OSX Server.app on Mountain Lion.

  1. Enable "Websites" in Server.app.
  2. Check if postgres is running
  3. sudo serveradmin fullstatus postgres
    
  4. If it's not, turn it on
  5. sudo serveradmin start postgres
    
  6. In order to connect with pgAdmin (and maybe through the terminal too), edit the file
    /System/Library/LaunchDaemons/org.postgresql.postgres.plist

    to replace

    <string>listen_addresses=</string>

    with

    <string>listen_addresses=127.0.0.1</string>
  7. UPDATE: The config file moved in the Server.app 2.1.1 update. It's now at:

    /Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist
    
  8. Then restart postgres
  9. sudo serveradmin stop postgres
    sudo serveradmin start postgres
    
  10. 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):
  11. 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"?
    
  12. 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.
  13. 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
    

Articles referenced:
http://www.mactasia.co.uk/revisited-using-postgresql-in-lion-server
http://www.mactasia.co.uk/video-how-to-configure-postgres-in-lion-server-10-7-4
http://www.naveoss.com/site/282/tutorials/appletutorials/accessing-osx-lion-server-postgresql

5Feb/112

Install Adobe Reader 9.4 in Debian Lenny

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).

  1. 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
  2. Make the installation binary file executable:
    chmod +x AdbeRdr9.4-1_i486linux_enu.bin
  3. Start the installation (as su or sudo):
    sudo ./AdbeRdr9.4-1_i486linux_enu.bin
  4. Tell the installer where you want Reader installed.  It suggests /opt, which is a fine place to put it.
  5. You're done.  Open a PDF with:
    acroread filename.pdf

9Aug/100

Notes on Preventing Screen Blanking

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.

5Aug/103

Shortcut Script for Sprunge Pastebin

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")

1Aug/100

Identifying a Program’s Package in Debian

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

Tagged as: , No Comments
1Aug/100

Changing Debian’s sensible-editor

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.

5Jul/101

Keyboard Hotkeys with Debian Lenny

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).

28Apr/103

Change Super Contacts Icon on the Palm Pre

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.

24Apr/103

Disable the New Google Layout

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:
http://www.google.com/webhp?hl=all

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: