Reputation
384
Top tag
Next privilege 500 Rep.
Access review queues
Badges
2 8
Newest
 Necromancer
Impact
~8k people reached

  • 0 posts edited
  • 0 helpful flags
  • 8 votes cast
Jun
16
comment Disks (in usb enclosure) keep waking up even when not mounted
Just a shot in the dark: check updatedb.conf's pruned paths & bind mounts, so that these paths are explicitly skipped ('locate' service); it could easily be some other similar service, though.
May
8
comment how to run script with a clean login shell
nb: OP added a restriction in other comment: "i can't do sudo with this account that's the reason why i am asking this question"
May
8
comment how to run script with a clean login shell
I was assuming that these processes would be run as a different user (e.g,. tomcat started as another "web" user, and a startup script doing "sudo -u {tomcat}" or such). If you're not running things as different users (and not using sudo), then just do everything else the same: as you say, "Only solution is maybe a wrapper script..." ; yes, that would be the same as the init.d script, which sets up the environment as you need it, the same for cron, your shell, init.d, etc; relying on (or hoping that) bashrc, profile, cron, etc will be consistent is (from experience) impractical.
May
7
comment see names of workspaces in gnome
if you right-click the workspace switcher, does it have an option to "un/lock" the widget? If so, unlock it so that it can be moved/resized. Alternatively, move/resize the adjacent widgets so that your workspace switcher can be resized. (Just guessing, it's been a long while since I've used gnome-panel.)
Mar
6
comment auto restart apache when high load average
xkcd.com/1495
Feb
15
comment auto restart apache when high load average
Rather than auto-restart Apache httpd, it's infinitely preferable to limit/throttle the application so as to not overwhelm the system (perhaps you've done this, still without the desired results; but it's still worth spending time on. Automatically restarting the server may exacerbate your existing issues.) See either standard httpd conf options and/or modules to help keep the servers & system at optimal performance: httpd.apache.org/docs/2.4/mod , httpd.apache.org/docs/2.4/misc/perf-tuning.html , httpd.apache.org/docs/2.4/mod/mpm_common.html#maxrequestworkers
Oct
11
comment can we use something better than more for tab completion?
not sure what "bash isn't as sophisticated" means. maybe it's the name that seems garish. Nonetheless, 'bash' does not use 'more' for tab completion. And regarding paging through "ls" output, you may have "ls" aliased to "ls | more"? => try: $ type ls => see if you're doing more than just listing files. Tab completion in bash can be customized, using the complete command.
Jan
2
comment How to properly and easy configure `xdg-open` without any enviroment?
using xdg-mime (part of xdg-utils) is the best answer for working with (querying, configuring) xdg-open. See also unix.stackexchange.com/questions/8793/…
Jan
2
comment How to properly and easy configure `xdg-open` without any enviroment?
+1 and see also my related answer to the related question, unix.stackexchange.com/questions/77136/…
Nov
20
comment If computers start counting at 0, why does the init process have a pid of 1?
this is likely a case of opposing underlying paradigms of programming: the programmer's gravitation towards special flag values (zero, negative one) trumps the lesser pull of a proclivity for zero-based numbering systems.
Oct
19
comment Share (masquerade) Internet connection from Debian desktop to a bunch of computers
With Ubuntu, anyway (and therefore probably Debian), you can set up a computer as a wifi hotspot if it has wifi & is connected to the network not using wifi (ie, using eth0). You could try to google for "Ubuntu (or Debian) hotspot wifi", & see if any of these work for Debian...
Oct
19
comment Change directory without typing cd?
The amount of typing saved by not typing "cd" will likely be offset by not having intelligent default autocompletion for paths. Also this method of changing dirs, as often as one does change dirs, is a little scary in that accidentally running a (potentially malicious) program (that you think is a directory) becomes very likely.
Aug
7
comment Writing custom Gnome/Mate screensaver with SDL
sorry to spam your question with comments, but to answer my own question (from here) quoting/paraphasing: "mate-screensaver is a simplified front-end/daemon for xscreensaver" ... "[xscreensaver has] the daemon, the config front-end, and the 'hacks'. The first two are replaced by mate-screensaver...The 'hacks' ('themes' in the gnome docs, most people probably think of them as the 'screensavers themselves') used by mate-screensaver are the same as the ones used by xscreensaver." ... but mate lacks all the config options of xscreensaver
Aug
7
comment Writing custom Gnome/Mate screensaver with SDL
This link applies to gnome-screensaver & xscreensaver (but not mate-screensaver), and you can reuse things across these two ( wiki.gnome.org/GnomeScreensaver/FrequentlyAskedQuestions ).
Aug
7
comment Writing custom Gnome/Mate screensaver with SDL
can mate-screensaver (your question & first link) and gnome-screensaver (your second link) use the same customizations? mate-screensaver really needs more options; everyone uninstalls it as a result, usually replacing it with gnome-screensaver which has more options (themes). then there's the crowd that hates gnome-screensaver's limited options and installs xscreensaver. ...I'm not sure how or if a screensaver can be used/packaged for these different applications, so you may have to choose one first (mate/gnome/x), or explore if/how the saver could be used with multiple.
Jun
19
comment Validate Password for user account from shell script
Sounds like a bad idea...that means you have a clear-text list of every user's password, which you will want to keep in sync with whatever is being used for the OS authentication? It sounds like what you really want to do is to authenticate users against (some) existing service. You didn't say if the OS is authenticating against LDAP/NIS/etc-passwd or ssh public key authentication or...? Or, will your script passwd differ from the OS passwd? (Otherwise, obviously, if the user is logged-in, you can assume they are authenticated and there is no need to re-authenticate.)
Jun
11
comment Can I “export” functions in bash?
summarizing answers below (enzotib is correct, assuming you can use bash, as the question indicates): change #!/bin/sh to #!/bin/bash and after doit() {...} just export -f doit
Mar
14
comment How can I check if two gzipped files are equal?
true, md5sum isn't necessary to compare (unless you already have them generated); I just used it since derobert used it. zgrep is just a script that basically does gunzip and grep (or sed as the case may be), so there is little difference there. the script as posted is intentionally shown as a chain of pipes with pluggable parts; what's the fun in merging everything down into a single command?
Mar
3
comment How to detect particular system call called or not in a whole workflow?
How about dtrace? (what OS?)
Jan
30
comment What are ./ and ../ directories?
@Adam yes, that will probably do the trick ("ls -b | wc -l"); you can also use the "-1" (dash + number one) which forces a listing in a single column instead of all on a single line, but that happens anyway when piping to another command. So (imho) I'd leave it as "ls -1b | wc -l" ; and to "test", run "ls -1b" and count the number of lines, then run "ls -1b | wc -l" and verify the results. (That's how to debug/test pipes.)