Skip to content

AstroGrep, grep for Windows

An excellent tool for those in Windows. http://astrogrep.sourceforge.net

Standalone executable too. =)

- Regular expressions
- Concurrent multiple file types
- Recursive directory searching
- A “context” feature that selects the lines above and below your search expression
- Most Recently Used list for search paths
- Somewhat versatile printing options
- Double click to open file with editor of your choice
- Store Most Recently Used file names and search expressions
- Match Whole Word Only
- Syntax highlighing
- Free of charge and Open Source

 

 

Categories: Technology, Windows.

Sorted list of groups an Active Directory user belongs to

Requires Quest’s  Active Roles tool

After installing, make the cmdlets available by loading the Quest Active Roles snap-in:
PS C:> Add-PSSnapin Quest.ActiveRoles.ADManagement

(Get-qaduser gstronach).memberOf | Get-QADGroup | select name | sort -property name

 

Categories: Mac, Technology.

gvim survival tip, visual block mode

Thanks to jerald got around the frustrating CTRL+v doing the normal GUI pasting within gvim when I was really wanting to enter vi “visual mode”

Control q to the rescue :)

I used it for commenting block of code:
CTRL-q  (Go in visual mode)

jjjjj  (move cursor)

I   (shift eye to insert)

#   (comment character)

ESC (Escape, writes out)

Awesome, thanks jerald!

Categories: General, Linux, Technology, Windows.

Windows batch file poor man’s sleep function

The following line in a batch file will wait 5 seconds, hand when the sleep command is unavailable.

ping -n 5 127.0.0.1 > NUL 2>&1

Categories: Technology, Windows.

Logrotate rotating the rotated, why and how to fix

The Problem:

-rw------- 1 root root  207 Nov 20 00:01 dev-virtual.log.1.gz

-rw------- 1 root root  113 Nov 19 00:01 dev-virtual.log.1.gz.1.gz

-rw——- 1 root root  100 Nov 18 00:01 dev-virtual.log.1.gz.1.gz.1.gz

-rw——- 1 root root  100 Nov 17 00:01 dev-virtual.log.1.gz.1.gz.1.gz.1.gz

Why does this happen ?

Two things wrong,  logrotate and syslog-ng

Logrotate has been told to rotate anyfile:

/var/log/syslog/*

And Syslog-ng was told to create log files by host name with no ” .log ” suffix :

destination messages { file("/var/log/syslog/$HOST"); };

The Fix:

In logrotate’s conf file:

/var/log/syslog/*.log

In /etc/syslog-ng/syslog-ng.conf:

destination messages { file("/var/log/syslog/$HOST.log"); };

Test:

logrotate --force "/etc/logrotate.d/syslog-ng"

-rw------- 1 root root  207 Nov 21 11:39 dev-virtual.log

-rw------- 1 root root  207 Nov 21 11:39 dev-virtual.log.1.gz

-rw------- 1 root root  313 Nov 21 11:26 dev-virtual.log.2.gz

Much better! =)

Categories: General.