8,796 reputation
22546
bio website cyrus-and.github.io
location Italy
age 28
visits member for 4 years, 3 months
seen yesterday

minimal


Oct
22
comment Disable vim plugins for large files
This goes beyond my Vim expertise but I'm sure you can write your own function that disables "slow" plugins and invoke it whenever you want, bind it to a keystroke or even manage to automatically trigger it for certain file sizes/extensions. This answer is just a better alternative to renaming your .vimrc file every time.
Oct
1
comment Prevent Screenshot in gnome using xmodmap
Probably useful: unix.stackexchange.com/a/3737
Sep
17
comment Does bash have a hook that is run before executing a command?
@CoreDumpError, since you've refactored the code you should negate all the conditions: the first one hence becomes: [ -z "$COMP_LINE" ].
Aug
19
comment Enter response once prompt returns?
@mjb: What about Expect?
Aug
15
comment Unusable open souce ATI driver on Debian Jessie
@W00d5t0ck: I posted a solution, quite late... but maybe you can still find it useful.
Jul
23
comment Remove a certain line from Bash history file
@chiliNUT: Just start your command (e.g. vim ~/.bash_history) with a space; commands starting with a space usually don't get logged (see $HISTCONTROL).
Mar
6
comment Bash Script to repeat every word in a line?
Shorter: sed -r 's/\S+/& &/g'.
Jan
9
comment Can one redirect too much data?
My concern would rather be how to handle a 50GB file...
Dec
24
comment Remove all *.foo in directory tree
@user877329, I see your point, but in my experience these tools are good for getting things done quickly and easily, but if you need to do it right then you often have to start developing your own tool.
Dec
24
comment Remove all *.foo in directory tree
@user877329, there's the -exec action that can be used for that purpose.
Dec
23
comment Remove all *.foo in directory tree
@Rob, man find: If no paths are given, the current directory is used.
Dec
1
comment What is the Discard Protocol actually used for?
Really?
Jun
2
comment Filter file when a column is in whitelist
Ahhh, yes, because I was testing with numbers...
Jun
2
comment Filter file when a column is in whitelist
Sorting a 20 million lines file takes about 30s on my machine.
May
1
comment How to create files named after lines in a text file under Linux
Redirection is integrated in Bash, there's no need to use cat here. If you prefer you can write the redirection before the command: < list.txt while .... Can you elaborate "but it also behaves a lot more predictably"?
Apr
13
comment Bash completion makes bash start slowly
I don't know if time bash -lc true works properly here since true finishes before ~0.1s so it doesn't source anything. Anyway time source /etc/bash_completion reports ~0.17s here and that's about the time I need to wait for the PS1 appear.
Mar
3
comment Get the current/default value of TCP initcwnd on Linux
+1, that web site is pretty useful.
Mar
3
comment Get the current/default value of TCP initcwnd on Linux
Yes, grepping the code is always a good idea!
Feb
15
comment invert colors on X (or xfce4)
xcalib supports the -s, -screen option that may be useful.
Jan
28
comment extracting words using awk
I'm assuming that each line is in the form: /^FG=[0-9]{4}$/. The OP doesn't state it explicitly. Anyway I'll update my answer to reflect that case too.