632 reputation
1317
bio website bit.ly/GFscreener11
location stackoverflow.com@askmarcos.com
age
visits member for 2 years, 11 months
seen Nov 17 at 8:24

Pioneers are the ones with arrows in their backs.

Investment Portfolio Software, Trade Automation

Designer of infinite compression algorithms, and other research projects


May
29
comment Temporarily freeze a process upon shell interaction
Good tip! So maybe a wrapper script can be written in BASH that traps its ALRM and sends a SIGCONT to something else. Put that feature to some good use :)
May
28
comment Temporarily freeze a process upon shell interaction
A cleaner & simpler solution would be to include a killall -STOP tail; sleep 90 && killall -CONT tail& in PROMPT_COMMAND. That is almost all! Except I want to see in this SE how others might address the issue of how to keep postponing that CONT as needed.
May
28
comment Temporarily freeze a process upon shell interaction
Nay; I'm not looking to change my habits. screen doesn't play well with any terminal program, btw. (Try scrolling up in Putty, for instance).
May
28
comment Temporarily freeze a process upon shell interaction
Yes but how to make that happen automatically upon any shell interaction? (and not forget to automatically send the SIGCONT later, either). That's what my question is about.
Apr
4
comment Linux tool to track directory space over time
It's within my reach to hack together user-space scripts to eg. record periodic du snapshots from cron of all/some directories, store them in SQL/CSV for later analysis to narrow down where storage is being consumed when, and make friendly reports to pinpoint this. With ability to zoom into the dir hierarchy, one hopes. But that's time-consuming and I'm hoping something similar exists, even if imperfect (hardlinks etc.).
Jan
5
comment run a remote process via autossh in background
tmux/screen may indeed be viable; xpra proved too resource intensive on my lean 1-2GB PCs in the past (behind the scenes X server). In reality before having this problem I was trying to avoid using an ssh layer altogether, just sticking to classic xhost + over port 6000 (i.e. DISPLAY=otherDYNDNShost:0 geany &) but could still not figure out how to re-enable that network port in Ubuntu's X server, not even with DisallowTCP=false in /etc/gdm/custom.conf as researched elsewhere.
Jan
5
comment run a remote process via autossh in background
Silly me, I tried -f right after posting and that worked, but felt bad about answering myself so fast. Thanks. However what's really annoying (and probably a different question) are its frequent disconnects & restarts, whilst another interactive ssh session seems way more tolerant of network hiccups and stays connected to one session.
Dec
12
comment extract last match from logfile till end
Prefer a regex-based solution (avoiding double-tac on a large file in a fast loop)
Dec
12
comment extract last match from logfile till end
I was trying to avoid that too since the main logfile grows many MB's huge, and the iterations fast (don't want to slow them down by a large fraction), so was looking for a regex-only solution.
Nov
8
comment Tell fs to free space from deleted files NOW
Marking as closest answer, although never really "gave back" the space immediately after closing file handles/processes using them. Looking for other kernel/proc/fs-based approaches.
Nov
5
comment crontab and DST disagreement with different timezone
In some cases got /bin/bash: 15 - 09: value too great for base (error token is "09") due to subtle problem of bash treatment of numbers beginning with 0 as octal. Fixed by preceding 10# to numbers.
Nov
1
comment crontab and DST disagreement with different timezone
Um, the opposite of what I last wrote.
Nov
1
comment crontab and DST disagreement with different timezone
I don't like that 1. this isn't a host-timezone-indifferent solution, and 2. assumes the difference will never be greater than six hours, i.e., that DST in Poland will always end first and start last.
Nov
1
comment crontab and DST disagreement with different timezone
The idea is that for most of the year, a 1-hour wait will not be in effect. Only during the few weeks of a 5-hour difference (whether spring or fall), rather than the typical 6, will sleep 3600 be executed.
Nov
1
comment crontab and DST disagreement with different timezone
Minor update. en.wikipedia.org/wiki/Tz_database implies that since the DST rules for each zone are published into the TZ database, any up-to-date UNIX server should already have bundled knowledge of the wall clock time anywhere else in the world without having to consult over the network.
Nov
1
comment crontab and DST disagreement with different timezone
Thanks for the kluge; 9am was only a simplified example, in reality I have tasks sprinkled all over the clock and calendar. Developing on your idea, rather than stuffing my much longer, nastier crontab line into an if block, I could merely precede my commands with: ` [ $[$(date +%H) - $(TZ=":US/Eastern" date +%H)] == 5 ] && sleep 3600; w` where w is what I want to run at the right time
Nov
1
comment crontab and DST disagreement with different timezone
No; I don't want all, and according to some other posts, TZ doesn't necessarily affect crontab (in Ubuntu which I use it doesn't), unlike for date eg. TZ=":US/Eastern" date +%Y%m%d
Jun
19
comment shorten long lines in a log file
I think I see; what's needed is a variable-length regex between the 130 and 40 matchers. So this might be the final sed way: sed -i.bak -e 's/^\(.\{80\}\).\{130,\}.*\(.\{40\}\)$/\1 ... \2/' All those \ make it annoying to read, but I understand why they're necessary. The awk way is more human readable for someone not used to these regexes.
Jun
19
comment shorten long lines in a log file
I get your 1st example (though haven't tested if it still prints shorter lines unchanged). In your 2nd example, doesn't the middle search expression catch strings of exactly 130 length only (hence 250 char lines)?
Jun
18
comment shorten long lines in a log file
Also useful esp. with -i, as I may be looking to keep closer to only the first 1024 and last 1024 chars, which shouldn't modify most lines, only ridiculously long ones. Still the awk method lets me replace the middle with a " ... " easily in such cases.