Example syntax is as follows:
egrep -i "string1|string2" /logs/webhalwCluster/* > research.txt
Repair corrupted Outlook PST file
It was a two step process. First the file CRC needed repaired, and then I could run the MSFT ScanPST.exe utility to actually repair the file.
- java -jar jfilerecovery.jar (requires Java 1.5+)
- Run C:\Program Files\Microsoft Office\Office12\ScanPST.exe
Using apt-get
Update your cache:
apt-get update
Get a list of all packages available, make sure to
apt-cache pkgnames > readme.txt
Install the following:
sudo apt-get install apt-show-versions
This allows you to show all versions installed:
apt-show-versions | sort > readme.txt
A couple of switches are available too:
-u (print only upgradeable packages)
There are more switches available, use apt-show-versions --help for more information.
Completely remove a package
apt-get --purge remove
Session Monitor timeoutd
Use this daemon to monitor logon usage and timeout the user. For example:
# Format: TIMES:TTYS:USERS:GROUPS:MAXIDLE:MAXSESS:MAXDAY:WARN
Al:*:joseph:*:*:30:*:5
30 minutes of session usage with 5 minutes of warning
This is started, you can monitor if it exists by
ps -A | grep -i timeoutd
The configuration file is:
/etc/timeouts
Last boot time
Workstation:
net statistics workstation | more
Server:
net statistics server | more
Scanning for CR/LF, want valid bash script
Quick Conversion Command
find . -name "*" -type f -exec dos2unix {} \;
Sample Script
#!/bin/sh
# MAKE SURE TO ALWAYS SAVE THIS FILE AS UNIX FORMAT.</code>
# Date: Monday, November 17, 2008 8:30 AM
# Author: Maurice Ruckman
#
# Description: Scan scripts directory looking for CR/LF which indicates
# a script was not saved in UNIX format. This would cause the script
# to fail.
grep -l -r $'\r\n' /devl/scripts > scan_for_crlf.output.txt
if [ -s scan_for_crlf.output.txt ]; then
echo "FAILURE CR/LF DETECTED IN SCRIPTS FOLDER"
echo "Found CR/LF when scanning scripts folder" | mailx -s "FAILURE FAILURE FAILURE CR/LF DETECTED IN SCRIPTS FOLDER" mruckman@hollandamerica.com
else
echo "ALL OKAY"
echo "All scripts passed test scan." | mailx -s "Scripts Folder Passed Scan" mruckman@hollandamerica.com
fi
find "/home/jboss1/workspace/HAL" -type f -name "*.java" > list.txt
We can easily convert the code with dos2unix
and find the problem code with something like this:
grep -l -r $'\r\n' /home/jboss1/workspace/HAL
or just convert everything by scripting it, here's a start
find "/home/jboss1/workspace/HAL" -type f -name "*.java"
PHP to create PDF
Print PDF's without installing any special plug-ins for php. Necessary, because most hosting ISP's do not install PDF support by default.
http://www.fpdf.org/
Zip Files on Hosted Site
Zip recursively
zip -r my.backup.001.zip htdocs
Unzip recursively by default
zip my.backup.001.zip
