| bio | website | bit.ly/GFscreener11 |
|---|---|---|
| location | stackoverflow.com@askmarcos.com | |
| age | ||
| visits | member for | 1 year, 5 months |
| seen | May 4 at 12:06 | |
| stats | profile views | 24 |
Pioneers are the ones with arrows in their backs.
Investment Portfolio Software, Trade Automation
Designer of infinite compression algorithms, and other research projects
|
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 backgroundtmux/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. |
|
Jun 18 |
comment |
shorten long lines in a log file Minor detail, I was able to make do without the extra len variable altogether |
|
Jun 18 |
comment |
shorten long lines in a log file Nice and concise, thanks. (Too bad awk lacks a -i in-place file replace option like sed. I'll just awk ... file1 > file2 && mv -f file2 file1) |
|
May 10 |
comment |
fetchmail to log complete messages AND pass to mda I considered that too, making a simple wrapper that logs before handing off/exec to the real MDA. The trouble is that mucks with the stdout of fetchmail, which sometimes I count on leaving unread partially or at all (the fetchmail side of the pipe sees where the seek pointer left off...) |
|
May 9 |
comment |
Get “date” to understand a timestamp phrase of a different language Reminder: I don't get to control the input format. But I may prepend or append eg. the current year before sending off the whole string to a universal, magic parser. |