364 reputation
1420
bio website basetable.wordpress.com
location Edinburgh, United Kingdom
age 26
visits member for 4 years, 2 months
seen Nov 23 at 23:17

Education is learning what you didn't even know you didn't know. - Daniel J Boorstin

On my day job I maintain a large database application for a growing Edinburgh-based travel search company. Every day I learn more about development and administration in the trenches, including how to cope with legacy worst practices and how to benefit from SQL Server best practices.

Studying part-time at Dundee University for an MSc in Business Intelligence.


Nov
24
awarded  Popular Question
Nov
17
awarded  Caucus
Oct
30
awarded  Self-Learner
Aug
18
awarded  Citizen Patrol
Aug
18
comment Testing if Enter-PSSession is successful
Test-WSMan session succeeds in cases where New-PSSession would raise an error instead. The only clue for me is that the ProductVersion property shows the Windows version to be zero. Test-WSMan HOSTNAME | Select -Expand ProductVersion produces OS: 0.0.0 SP: 0.0 Stack: 3.0.
Aug
12
asked How do I make robocopy over WinRM behave like over RDP?
Jul
29
awarded  Nice Question
Jul
2
awarded  Curious
May
27
awarded  Popular Question
May
26
awarded  Notable Question
Oct
9
revised How to restore Linode to Vagrant VM?
Add backup and restore tags.
Oct
9
asked How to restore Linode to Vagrant VM?
Sep
30
accepted Why doesn't sudo know where psql is?
Sep
26
comment Why doesn't sudo know where psql is?
@krowe Here that produces the message: User postgres is not allowed to run sudo on <hostname>..
Sep
26
comment Why doesn't sudo know where psql is?
@krowe I think you did mean -u. Unfortunately, it doesn't work here. From man sudo: "The -u (user) option causes sudo to run the specified command as a user other than root. [...] Security policies may restrict uids to those listed in the password database. The sudoers policy allows uids that are not in the password database as long as the targetpw option is not set. Other security policies may not support this."
Sep
26
comment Why doesn't sudo know where psql is?
@krowe sudo: the `-U' option may only be used with the `-l' option. From man sudo: "The -U (other user) option is used in conjunction with the -l option to specify the user whose privileges should be listed. The security policy may restrict listing other users’ privileges. The sudoers policy only allows root or a user with the ALL privilege on the current host to use this option."
Sep
26
comment Why doesn't sudo know where psql is?
This works, but I need a one-liner. As a one-liner this becomes sudo su postgres --command="psql -l", which works, but doesn't solve the fundamental problem. Thanks for the tip all the same!
Sep
26
comment Why doesn't sudo know where psql is?
@DrewKhoury Awesome. Your second link had the answer. I used it to write my own answer. Thanks!
Sep
26
answered Why doesn't sudo know where psql is?
Sep
26
comment Why doesn't sudo know where psql is?
@krowe /usr/pgsql-9.2/bin (no trailing slash) is in my path, but sudo -E -u postgres psql -l produces the same error: sudo: psql: command not found.