A couple things that really annoy me are the default vim settings where words get chopped in the middle and paragraphs don’t display correctly. I’m sure there is a reason for the defaults, but here is how you change this while in vim: :set linebreak :set display+=lastline If you put this in .vimrc in your […]
Don’t Wrap in the Middle of a Word, and Display Partial Paragraphs in Vim
Using Strace to Determine What Files a Program Opens
We were recently configuring AIDE, and didn’t pay attention to the defaults in the configuration when we compiled it, and didn’t know where aide.db.new was going to after running aide initially. Sure, lsof would work while to porgram is running; however, we needed to know what files were open while the program was running. Strace […]
Changing the Default Crontab Editor
The default crontab editor is nano on some systems. This is a pain. You can change this by setting the EDITOR environment variable. In BASH: srv-4 / # set | grep EDITOR EDITOR=/bin/nano srv-4 / # which vi /usr/bin/vi srv-4 / # export EDITOR=/usr/bin/vi srv-4 / # set | grep EDITOR EDITOR=/usr/bin/vi _=EDITOR srv-4 / […]
One off Administration and Testing Scripts Using Vi
If you have a list of servers, you can use the substitution feature in vi to quickly turn that list into a test script. For instance, if I want to test a list of domains that looks like this: domain1.com domain2.com domain3.com domain4.com domain5.com I can insert text before and after the domain name. Here […]
Vim With Spell Checking
There is a new version of Vim that will do spell checking. We used version 7.0131 available here. Grab the source, extract, compile, and install: [root@www src]# cd vim7 [root@www vim7]# ls vim-7.0131.zip [root@www vim7]# unzip *.zip Archive: vim-7.0131.zip Vim 7 snapshot version 7.0131 inflating: src/README.txt inflating: src/arabic.c inflating: src/arabic.h inflating: src/ascii.h inflating: src/buffer.c . […]
Determining System Properties with Java
In this article we displayed our system properties via Tomcat. We were curious, though, how to retrieve these directly through Java. Here is how you can do this: [usr-1@srv-1 java]$ cat FirstProperties.java public class FirstProperties { public static void main(String[] args) { System.out.println(“System Information: \n”); System.out.println(“Operating System: “); System.out.println(System.getProperty(“os.name”)); System.out.println(“\nArchitecture: “); System.out.println(System.getProperty(“os.arch”)); System.out.println(“\nOperating System Version: […]