Well, quite self-explanatory. Only Bash and Ruby. Options “folder” and “name” are examples, replace them with what you need… Shared in hope this can help someone.
The subject is extremely annoying. I am not that lazy to add a comment symbol myself. This would be a good idea though, if it wasn’t sometimes needed to insert blocks of code via clipboard. With auto-comment on, if I insert
some line # some comment some line
I get
some line # some comment # some line
because there is a CR at the end of commented line and the auto-comment function adds the # symbol to the next line automatically.
The real problem begins when you try to insert many lines with some of them commented. You end up with each line after the first comment commented, the next comment commented twice so the next lines all commented twice and so on.
The solution:
Add this to your vimrc file:
au FileType * setl fo-=cro |
where:
- au = autocmd
- FileType * – any file type
- setl = setlocal
- fo = formatoptions
- -=cro disables c, r and o options ( see documentation )
This is a really annoying problem we meet pretty often. You can meet it even if you don’t use Bash. For example, you upload an image named “my lovely cat.jpg” to your website and find no image there. Or it has no thumbnail. This may happen because you are using some program for making thumbnails that is being called from, say, PHP via backtick operator (that is, using unix shell) and that program interprets the file name passed to it as three different command line options: my, lovely and cat.jpg.
It’s not easy to remember, so here’s the reference.
var=aaa.bbb.ccc
% |
%% |
# |
## |
|
|---|---|---|---|---|
.* |
${var%.*} => aaa.bbb |
${var%%.*} => aaa |
${var#.*} => aaa.bbb.ccc (doesn’t work) |
${var##.*} => aaa.bbb.ccc (doesn’t work) |
*. |
${var%*.} => aaa.bbb.ccc (doesn’t work) |
${var%%*.} => aaa.bbb.ccc (doesn’t work) |
${var#*.} => bbb.ccc |
${var##*.} => ccc |
I was doing a simple test of pwgen (handy utility to generate passwords) and since this test was creating a lot of files in a folder I decided to combine it with a test of ls speed vs find speed:
For some reason there is no obvious way to enable it (Gnome 2.26.3)
- Open GConf editor: Applications -> System Tools -> Configuration Editor
- apps -> metacity -> general -> compositing manager (check box there)
That’s all. Enjoy numerous visual effects like shadows, real transparency (underlying windows become visible) etc.
Pretty easy:
mysql -u<username> -p<password> <dbname> -B -e "select * from '<tablename>'" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > <filename.csv> |
If Amavis reports this scary error, it doesn’t necessarily means that your disk is cracked. Usually this means that the file it is talking about has wrong format. This happens, for example, if you upgraded Amavis or Spamassassin. Check current format with the file utility and upgrade it with dbX.X_upgrade where X.X is appropriate version. Or simply remove the auto-whitelist file, it will be re-created. Same with bayes_seen and bayes_toks files.
If you have Vim syntax highlighting enabled, the code example below will be highlighted incorrectly: 2, 3 and 4 lines (as well as the all lines below) will be all in blue as if they are comments. This happens because Vim considers everything after /* as a commentary.
1 2 3 4 |
for script in ${rpath}/*.mon.sh
do
$script ${1}
done |
It’s a 2.3 bug still not fixed in 2.3.4 gems according to this thread
On my new server with Rails 2.3.4 installed it looks like this:
I run script/plugin install git://github.com/whatever/plugin.git and then just nothing happens.
Recipe from above mentioned thread works for me, so I have to run instead:
script/plugin install http://github.com/whatever/plugin.git/ |
Note slash at the end!
Home
Contacts
Downloads
RoR
Servers
Notes
Linux
ERR
Русский