perl one liner that will replace all strings in a text file.
perl -pi -e "s/searchForText/replacewithThis/g;" *.txt
ok, the above sucks but it was what I found before.
Here is what is needed
perl -pi.bak -e "s/searchForText/replacewithThis/g" testf.txt
tested on 5.8 win32 - from activestate
Thursday, June 28, 2007
Monday, June 18, 2007
Great collection of Windows VBScripts
I found a great collection of scripts, this covers some things the scripting guys miss.
http://www.windows-management.com/scripting/wmi/
I found under the networking section two dns scripts that I found helpful.
http://www.windows-management.com/scripting/wmi/
I found under the networking section two dns scripts that I found helpful.
Wednesday, June 06, 2007
GTD - a new d3 is on the way
I started playing with GTD, I checked out MonkeyGTD and d3, as well as others (one with a Ruby on Rails backend).
I like d3 for the simpleness, however there are some things I would look at changing.
http://www.dcubed.ca/
Google Group Discussion
http://groups.google.com/group/GTD-TiddlyWiki
I want to get to a point where GTD is my main area for journal, tasks, project list, etc.
Some things I want to add:
checkbox for common tags such as estimated time,15min, 20min.
Also I want to customize the RSS options as there are pocketmod templates which can read rss.
I like d3 for the simpleness, however there are some things I would look at changing.
http://www.dcubed.ca/
Google Group Discussion
http://groups.google.com/group/GTD-TiddlyWiki
I want to get to a point where GTD is my main area for journal, tasks, project list, etc.
Some things I want to add:
checkbox for common tags such as estimated time,15min, 20min.
Also I want to customize the RSS options as there are pocketmod templates which can read rss.
Wednesday, May 09, 2007
PocketMod
PocketMod is a great tool
http://www.pocketmod.com/
There is an easy way to add items to pocket mod offline version.
Here is a page a lot of useful pocket mods.
http://www.fairlyuseless.com/tag/pocketmod
Here is anther page:
http://www.wedothat.com/pocketmods
And a third - lots of cool calendar stuff:
http://sfmnet.fortunecity.com/Pocket/addons.htm
http://www.pocketmod.com/
There is an easy way to add items to pocket mod offline version.
Here is a page a lot of useful pocket mods.
http://www.fairlyuseless.com/tag/pocketmod
Here is anther page:
http://www.wedothat.com/pocketmods
And a third - lots of cool calendar stuff:
http://sfmnet.fortunecity.com/Pocket/addons.htm
Tuesday, May 01, 2007
make your vhd files smaller
Virtual Server and Virtual PC make use of VHD files, here is a link to a MS KB also the basic steps on making them smaller.
check ms kb note -
http://support.microsoft.com/kb/888760
1. run defrag
2. Virtual Disk Precompactor tool The Virtual Disk Precompactor tool is available in Microsoft Virtual PC 2004 Service Pack 1 (SP1).
3. for virtual server virtual disk menu on the master screen selected inspect.
4. click compact vhd (virtual guest must be offline for this to run.)
I am going to attempt to script part or all of this.
check ms kb note -
http://support.microsoft.com/kb/888760
1. run defrag
2. Virtual Disk Precompactor tool The Virtual Disk Precompactor tool is available in Microsoft Virtual PC 2004 Service Pack 1 (SP1).
3. for virtual server virtual disk menu on the master screen selected inspect.
4. click compact vhd (virtual guest must be offline for this to run.)
I am going to attempt to script part or all of this.
Thursday, April 12, 2007
Kick Butt way to save / restore / change NTFS permissions
http://setacl.sourceforge.net/
The command line options took a bit to figure out but it was much better then cacls.exe and it also lets you backup and restore the permissions.
The command line options took a bit to figure out but it was much better then cacls.exe and it also lets you backup and restore the permissions.
Saturday, February 10, 2007
Setting time on 4.5.x BIG IP 520 units
After installing the Daylight Savings Time patch for some F5....
Had some issues with the clocks being off an hour on two BigIP 520 units, F5 has a complex solution of booting into single user mode (these are based on BSD) to change the clock. I found what worked without booting into single user mode was changing the time zone to GMT then setting it back. I did this while the unit I was working on was in standby. Also another F5 tech note said to look at the redundant properties screen and to disable the gateway failsafe (that was not enabled for me anyway.)
"ntpdc" - this is the interactive mode
then "peers" - shows clocks of the time servers you configured.
Had some issues with the clocks being off an hour on two BigIP 520 units, F5 has a complex solution of booting into single user mode (these are based on BSD) to change the clock. I found what worked without booting into single user mode was changing the time zone to GMT then setting it back. I did this while the unit I was working on was in standby. Also another F5 tech note said to look at the redundant properties screen and to disable the gateway failsafe (that was not enabled for me anyway.)
"ntpdc" - this is the interactive mode
then "peers" - shows clocks of the time servers you configured.
Thursday, January 25, 2007
Windows NT XP 2003 DOS Batch Get Date as Variables
I use the following dos batch file, this is helpful when generating log files, that you want time stamped.
get-date-as-variable.txt
rem works with windows 2003 and xp
@echo off
for /f "tokens=1-4 delims=/ " %%a in ('date /t') do (set weekday=%%a& set month=%%b& set day=%%c& set year=%%d)
echo day = %day%
echo month = %month%
echo year = %year%
echo %year%%month%%day%
get-date-as-variable.txt
rem works with windows 2003 and xp
@echo off
for /f "tokens=1-4 delims=/ " %%a in ('date /t') do (set weekday=%%a& set month=%%b& set day=%%c& set year=%%d)
echo day = %day%
echo month = %month%
echo year = %year%
echo %year%%month%%day%
Friday, September 08, 2006
Talk to a human
Here is a cool site that list what to do when calling companies with long menus and you want to speak to someone. It does not say what to do when the person you talk to wants transfer you to another person who said hold while I transfer you.. nice idea here.
http://www.gethuman.com/us/
http://www.gethuman.com/us/
Tunneling / port knocking / etc
It has been a while since I learned and tried tunneling over ssh adn looked at the port knocking docs. Listening to binrev (162) I learned that you can tunnel over dns. I googled for this and saw quite a while ago it was story on slashdot.
I just read another article that said people are also using ICMP messages as a tunnel. I thought this was pretty cool. Here is the link to the story:
http://blogs.zdnet.com/Ou/?p=261
I just read another article that said people are also using ICMP messages as a tunnel. I thought this was pretty cool. Here is the link to the story:
http://blogs.zdnet.com/Ou/?p=261
Tuesday, March 07, 2006
date command with unix and utils
date.exe +%Y%m%d%H%M%S
C:\>c:\unxutils\usr\local\wbin\date.exe +%Y%m%d%H%M%S
20060307134035
I use this often in scripts and wanted to put it here so I can always find it.
C:\>c:\unxutils\usr\local\wbin\date.exe +%Y%m%d%H%M%S
20060307134035
I use this often in scripts and wanted to put it here so I can always find it.
Tuesday, February 28, 2006
Active Directory and Group Policy
Group Policy Tips:
1) The Microsoft Group Policy Management Console (GPMC) is the best method to manage group policy without purchasing additional tools.
Some 3rd party vendors had tools like this for Windows 2000, but finally Microsoft simplified management of group policy through native tools.
to read more and download look at:
Where can I download the GPMC console for Windows Server 2003/XP?
http://www.petri.co.il/download_gpmc.htm
2) Specifying a Domain Controller for Editing Group Policy
http://technet2.microsoft.com/WindowsServer/en/Library/0e05bfcf-786c-4ada-9601-616f8da401ee1033.mspx
This goes into detail the way the tool at times uses the DC which holds the PDC emulator role, espically when performing an edit on a GPO.
3) When creating a policy be sure to select templates and remove all unneeded templates.
Group Policy can process fast and you can have some levels, the real thing that takes time to process is the ADM files. Removing unneeded template will cut down the ADM files.
1) The Microsoft Group Policy Management Console (GPMC) is the best method to manage group policy without purchasing additional tools.
Some 3rd party vendors had tools like this for Windows 2000, but finally Microsoft simplified management of group policy through native tools.
to read more and download look at:
Where can I download the GPMC console for Windows Server 2003/XP?
http://www.petri.co.il/download_gpmc.htm
2) Specifying a Domain Controller for Editing Group Policy
http://technet2.microsoft.com/WindowsServer/en/Library/0e05bfcf-786c-4ada-9601-616f8da401ee1033.mspx
This goes into detail the way the tool at times uses the DC which holds the PDC emulator role, espically when performing an edit on a GPO.
3) When creating a policy be sure to select templates and remove all unneeded templates.
Group Policy can process fast and you can have some levels, the real thing that takes time to process is the ADM files. Removing unneeded template will cut down the ADM files.
Friday, February 17, 2006
Virtual Envirohttp://www.blogger.com/img/gl.spell.gifments - VMware and Microsoft's
I often use Vmware Player and/or Microsoft's Virtual PC. A project for work now involves getting a PXE Network Boot Server Setup, to do so I wanted to see if either VMware of Microsoft virtual enviroments support PXE network boot.
Virtual PC virtualized Network Card
Intel 21140 also sometime labeled DEC
http://blogs.msdn.com/virtual_pc_guy/archive/2005/01/26/361361.aspx
Vmware Player
Vmware ADM 79c970 PCNet32
http://www.etherboot.org/db/nics.php?show=tech_data&vendor=VMware+Inc.
Virtual PC virtualized Network Card
Intel 21140 also sometime labeled DEC
http://blogs.msdn.com/virtual_pc_guy/archive/2005/01/26/361361.aspx
Vmware Player
Vmware ADM 79c970 PCNet32
http://www.etherboot.org/db/nics.php?show=tech_data&vendor=VMware+Inc.
Wednesday, February 08, 2006
Have a Linksys WRT54g?
I have a Linksys WRT54g and have been running DD-WRT for a few months. I am very happy with it. It allows me to ssh to the router and also use ssh tunnels.
Next steps for me are to setup mrtg and snmp for monitor stats + setup a method to send a WOL Magic packet to workstations inside.
DD-WRT Home Page
DD-WRT Wiki
DD-WRT Forums
Some tips:
From Web Administration->Status->Lan->DHCP Clients Table
wl assoclist - shows all wireless client macs.
cat /proc/net/arp - shows all active clients in your network with IP and mac
dumpleases - gives you all DHCP-Client leases.
cat /proc/net/ip_conntrack - shows all incoming and outgoing connections
Next steps for me are to setup mrtg and snmp for monitor stats + setup a method to send a WOL Magic packet to workstations inside.
DD-WRT Home Page
DD-WRT Wiki
DD-WRT Forums
Some tips:
From Web Administration->Status->Lan->DHCP Clients Table
wl assoclist - shows all wireless client macs.
cat /proc/net/arp - shows all active clients in your network with IP and mac
dumpleases - gives you all DHCP-Client leases.
cat /proc/net/ip_conntrack - shows all incoming and outgoing connections
Tuesday, February 07, 2006
Working with SNMP
Net-SNMP - Unix and CGU/ Linux SNMP tools and Agent. Has Windows Agent to offer an option other then the MS version. The cygwin utilities work very well.
GetIF
Windows GUI, lets you query adn browse mibs - a great Windows tool.
Here is a great site, they sell pro versions of SNMP
Search for and download Mibs
http://www.oidview.com/mibs/detail.html
Graphically view and download mibs, this link is for the F5 BigIP
http://www.oidview.com/mibs/3375/LOAD-BAL-SYSTEM-MIB.html
Usage notes, I found that Windows XP and cygwin Net-SNMP utilities share Windows enviroment variables which detail where mibs are stored. I found this when working with a specific SNMP tool and not seeing all mibs being processed, to get both tools to use the mibs I changed the Windows enviroment values.
GetIF
Windows GUI, lets you query adn browse mibs - a great Windows tool.
Here is a great site, they sell pro versions of SNMP
Search for and download Mibs
http://www.oidview.com/mibs/detail.html
Graphically view and download mibs, this link is for the F5 BigIP
http://www.oidview.com/mibs/3375/LOAD-BAL-SYSTEM-MIB.html
Usage notes, I found that Windows XP and cygwin Net-SNMP utilities share Windows enviroment variables which detail where mibs are stored. I found this when working with a specific SNMP tool and not seeing all mibs being processed, to get both tools to use the mibs I changed the Windows enviroment values.
MIBDIRS=C:\mibs
MIBS=all
Sunday, February 05, 2006
Ubuntu Breezy 5.10 with MS VPC
Works will, default install defaults to a 24 bit color depth which is an issue for VPC. To change ti you must reboot the guest, hit 'esc' at the grub menu (you do not have a lot of time so be ready.) select the recovery mode, at the console login then use vi to fix the defaultdepth line in /etc/X11/xorg.conf from 24 to 16.
Thursday, February 02, 2006
Working with Awk
Here are some links to info about Awk, as one of the pages states Perl can doo 100 times what awk can, however awk is on standard unix systems where perl may not be.
I used awk to make some custom adds to the SSL cert check script which I blogged about.
CLI Magic: Learn to talk awk
awk(1) - Linux man page
Awk Introduction - Explained by examples rather than by definitons
Getting started with awk
I used awk to make some custom adds to the SSL cert check script which I blogged about.
CLI Magic: Learn to talk awk
awk(1) - Linux man page
Awk Introduction - Explained by examples rather than by definitons
Getting started with awk
Where to look to understand DNS
A lot of MCSE types do not get DNS, if they do they only understand the basics and can not handle looking up a MX record with nslookup. Here is a link to some good articles about DNS.
DNS Subject Index at Setup32.com
DNS Subject Index at Setup32.com
List of my most used programs
Here are a list of programs that I install on most Windows systems I use:
Firefox
winscp
putty
ethereal
winpcap
filezilla
HTTrack
nmap
7zip
unxutils
tightvnc
vnccon / gencontrol ?
truecrypt
Firefox
winscp
putty
ethereal
winpcap
filezilla
HTTrack
nmap
7zip
unxutils
tightvnc
vnccon / gencontrol ?
truecrypt
SSL Cert Checker
Found this cool tool with is a solution to a problem I have been searching for - checking SSL Certificates for expiration dates by passing the server and port.
This is great because I happen to manage several sites / services which use a combo of third party and self signed certificates. Also I can monitor when Active Directory Server certificates expire, they do renew automatically, however I believe a reboot is needed for the newly automatically requested certificate to be used? Not sure.
http://daemons.net/~matty/articles/checkcertificate.html
This is great because I happen to manage several sites / services which use a combo of third party and self signed certificates. Also I can monitor when Active Directory Server certificates expire, they do renew automatically, however I believe a reboot is needed for the newly automatically requested certificate to be used? Not sure.
http://daemons.net/~matty/articles/checkcertificate.html
Subscribe to:
Posts (Atom)