Use the snippet below in your
/etc/nanorc file to highlight
*.ini files like
php.ini in Nano.
# ini highlighting
syntax "ini" "\.ini(\.old|~)?$"
color brightred "=.*$"
# equal sign
color green "="
color brightblue "-?[0-9\.]+\s*($|;)"
color brightmagenta "ON|OFF|On|Off|on|off\s*($|;)"
color brightcyan "^\s*\[.*\]"
color cyan "^\s*[a-zA-Z0-9_\.]+"
color brightyellow ";.*$"
When I’m messing around with config files on the command line my editor of choice is Nano. It’s simple, fast and pretty much straight forward. You don’t have to learn any commands and can use keyboard shortcuts just like in GUI programs.
Today I had a look on the project website and saw that there are tons of settings which I really missed before. Just have a look into your
/etc/nanorc for a default config file with all settings and their default values. Here are those I like most:
- smooth (scrolling)
- mouse (though I use it rarely)
- tabsize (8 is far to much, I love 4)
Yes! Nano supports syntax highlighting! And I never knew it, but heck - it’s never to late. Not for neat features like this one, though I really wonder why this is not activated by default…
In the aforementioned
/etc/nanorc are already some default languages which just wait to be commented out. You might also want to have a look into
/usr/share/nano, there are some languages you can include in your
nanorc file with:
Drupal is such a pleasing piece of software.
Just a few days ago I found some very cool new (to me) hidden functionality. Additionally I’ve installed some more modules which I want others to be aware of.
available updates email notification
Let’s start with the “hidden” functionality: Drupal 6 incorporates some parts of a Drupal 5 module which notifies you about available updates (see
/admin/reports/updates). Pretty easy to stay updated with that alone. But I thought I’d had to check that page frequently for new updates. Not so! Say hello to the tab “Settings” on the very page and insert your email address to stay updated via email. Satisfying and built-in… dumb me searches in vain for a module with that functionality…
Yet it brought my interest to other useful modules:
Logging and alerts
The Logging and alerts module gives you a way to send emails to an email address of your choice in case of errors etc. Pretty neat since I don’t want to lose time by regularly scanning my log entries…
And here another syntax file for Nano. This time it highlights the
## syntax highlighting for /etc/apt/sources.list
syntax "apt/sources.list" "sources\.list(\.old|~)?$"
color brightmagenta "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/) [^ ]+ .+$"
color brightred "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/) [^ ]+"
color brightgreen "(http|file|ftp):/[^ ]+"
# [^\]] does not work…
color brightgreen "cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/"
# deb / deb-src
color cyan "^deb"
color brightblue "^deb-src"
color brightyellow "#.*"
After the scrolling wheel of my old Typhoon mouse went crazy (I think because of a loose contact) I bought a Logitech MX1000. A very nice mouse with superior surface detection which made a mouse pad unnecessary for me. If you’re in my position you have a mouse with tons of buttons and want to use them all. This is how I did it:
You’ll need the following programs:
- xbindkeys: for remaping button events
- xvkbd: used to send specific keyboard events
- xmacro: used to send specific mouse events
- kompose: a program for the “Application-Switch” button
- lmctl: for disabling cruise control Download and install those programs, Ubuntu users will find most of them in the repositories.
Follow the instructions of this wiki article, it worked like a charm for me. If you have done what stands there, logout of KDE / Gnome and restart X to see if it works.