Reputation
1,357
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
5 19 28
Newest
 Necromancer
Impact
~161k people reached

Jun
21
comment Giving write permissions to www-data for a file within user's home with limited shell access?
Thanks @FaheemMitha - trying to set up HTTP access to bare git repos in my home directory there, which works fine, except for push, because in that case git-http-backend runs as www-data, and fails to update the bare repos; cheers!
Jun
21
comment Giving write permissions to www-data for a file within user's home with limited shell access?
Many thanks @meuh - indeed, that was it; edited your post with a snippet of server operations, hope it passes peer review; cheers!
Jun
5
comment Where are the default error/debug log files of smbclient located?
After trying this a bit,.seems -d does output to stdout, but I'm still unsure about where these logfiles are..
May
19
comment Saving a email as file in mutt?
also, this saves the attachments in the exported email file, as well.
May
19
comment Saving a email as file in mutt?
Just a note: if your email message contains attachments, then saving just the first entry from the attachments list will save the message - but without the attachments included inside.
Feb
23
comment Using process substitution to trick programs expecting files, with specific extensions as argument?
Many thanks for that @Gilles - I accepted this answer, because it answer the question generically. Unfortunately, I couldn't quite get scriptfs to work - here is a command log I saved at the time (AFAICR, stackexchange crashed that day :)) gist.github.com/anonymous/e9ee5e8c53d1b4c3c736 - so I ended up using a bash script approach which I posted below. Cheers!
Feb
5
comment “Last resort” Linux terminal command to reboot (over ssh) in case of a kernel bug?
Just a note: I just tested several times with sudo reboot -f from ssh (both typed manually and in a script), and realized late that actually there are several instances of reboot -f shown in ps axf with status D which is uninterruptible sleep (usually IO); probably the kernel bug freezes the reboot commands as well...
Feb
5
comment Running a “scheduled”/delayed script as sudo on server, via ssh - and right before ssh exit
Many thanks for that, @StephenKitt, that seems to work great! Just a note: if I forget to do say sudo ls before I execute the command, so that my password is asked for and temporarily remembered, then I might get [1]+ Stopped sudo bash /home/user/testsleep.sh from_end ; logout ; There are stopped jobs., so I had to do fg until I saw and answered the password prompt. Btw, in syslog I get mypc user: Pre sleep: root...but mypc logger: Post sleep: root... - any idea why "pre sleep" has user and "post sleep" has logger as username?
Feb
5
comment Running a “scheduled”/delayed script as sudo on server, via ssh - and right before ssh exit
Thanks, @StephenKitt - well spotted, fixed in OP now; unfortunately the sudo bash /home/user/testsleep.sh from_end & exit still doesn't print anything in syslog even with this change (I guess I didn't notice the mistake since I invoke bash explicitly here, which will ignore the shebang). Cheers!
Feb
5
comment “Last resort” Linux terminal command to reboot (over ssh) in case of a kernel bug?
Thanks, @Gert; I checked with cat /proc/sys/kernel/sysrq and it was already 1, so that was already active, I guess... I think this has something to do with the fact that I'm running this via ssh remote shell, but cannot tell what
Feb
5
comment “Last resort” Linux terminal command to reboot (over ssh) in case of a kernel bug?
Thanks for that, @wurtel - I tried from my ssh shell: sudo bash -c "( echo a ; sleep 5; echo s > /proc/sysrq-trigger ; echo u > /proc/sysrq-trigger ; echo s > /proc/sysrq-trigger ; echo b > /proc/sysrq-trigger )" & exit; however, this doesn't seem to force the server into reboot... Is there a specific way I should format these commands, if I want to run them while I'm connected through a remote ssh shell?
Feb
5
comment “Last resort” Linux terminal command to reboot (over ssh) in case of a kernel bug?
Many thanks for that, @orion - I tried from ssh in the controlling terminal this: sudo bash -c "( echo a; sleep 5; reboot -f )" & exit but nothing happens on the server PC... I guess if I issue it manually on the server PC itself it would work, but here I need to issue it from a remote ssh shell, and immediately exit from the shell before the reboot takes place (and the at command doesn't recognize seconds.). Cheers!
Jan
28
comment Using process substitution to trick programs expecting files, with specific extensions as argument?
Thanks again, @Costas - unfortunately, that doesn't work either, at least not on my version of melt (MLT melt 0.6.2; "standard input" is not mentioned in this version's man melt), since for that command, again I get Usage: melt [options] [producer [name=value]* ]+ and a dump. Cheers!
Jan
28
comment Using process substitution to trick programs expecting files, with specific extensions as argument?
Thanks @Costas - tried that, but apparently melt doesn't care about commands piped through stdin, since I get: Usage: melt [options] [producer [name=value]* ]+ and a dump of program options. Cheers!
Jan
24
comment Resolving the location/registration of an executable in the system?
@MichaelHomer and everyone - just realized that I in fact don't know how did that directory end up in $PATH to begin with (see edit); so now I need to know how I could inspect that. @FaheemMitha - agreed, but in this case I'd want to test differences between two different versions of acroread. Cheers!
Jan
24
comment Resolving the location/registration of an executable in the system?
Thanks @FaheemMitha - I already do have acroread, I was just wondering how does the shell know where it is located; and it turns out now it was in the $PATH; cheers!
Jan
24
comment Resolving the location/registration of an executable in the system?
Many thanks, @MichaelHomer - see post update; it turns out my $PATH starts with /media/mydisk/AdobeReader/Adobe/Reader9/bin:/opt/OpenPrinting-lm1100/bin:... so that is the solution; feel free to post an answer, I'll accept it! Thanks @psusi - I'm well aware of that, unfortunately I'm working on a project using this older version; otherwise I would have updated a long time ago. Cheers!
Jan
24
comment Getting globbing to work with `locate`?
Many thanks for that, @PM2Ring - I guess when I saw that the --regex worked without a starting *, I expected the glob would too, but that wasn't correct. Your glob works just fine - cheers!
Jan
24
comment Is there a tr for translating into longer strings?
The only thing that I don't like here is that becomes quite difficult to replace a newline \n with a string like ` ; ` using sed: sed: How can I replace a newline (\n)? - Stack Overflow notes that plain s/// doesn't work, and you have to go into a "pattern space" syntax...
Nov
28
comment Possibilities for executable symlink to non-executable file in Linux?
Thanks for that @vinc17, very nice approach; another alternative I forgot while writing the OP, was to include alias myscript.py="python /path/to../myscript.py" in .bashrc. Cheers!