MySQL tips
Submitted by phecht on Sun, 2010-08-29 16:09Here is how to create a MySQL database with out having to remember the syntax:
#!/bin/bash
EXPECTED_ARGS=3
E_BADARGS=65
MYSQL=`which mysql`
Q1="CREATE DATABASE IF NOT EXISTS $1;"
Q2="GRANT INSERT, SELECT, UPDATE, DELETE, CREATE, DROP, ALTER ON '$1'.* TO '$2'@'localhost' IDENTIFIED BY '$3';"
Q3="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}"
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: $0 dbname dbuser dbpass"
exit $E_BADARGS
fi
$MYSQL -uroot -p -e "$SQL"
Just put that into a file, change the permissions and you should be able to create a user and database. You might have to change the "-uroot" if you are on a shared host.
What does 3PAR do? Why is HP taking it over
Submitted by phecht on Mon, 2010-08-23 07:49As they wait for these virtualization industry growing pains to subside, Mercury and other companies continue to pine for a utility future. "For Mercury to consider storage a utility, we'd have to have an environment that is fully integrated between the operating system, the file system and the block level. That way, when an application needs more storage, the virtualized environment would automatically increase the resources and send a message back to the server," Kreisa says. "That's the endgame, and it's still a ways out."
from: http://www.networkworld.com/supp/2008/ndc3/051908-storage-virtualization... is the conclusion of a good article on what "Utility storage" the main product that 3PAR sells.
How to develop for Drupal
Submitted by luke on Sun, 2010-04-18 06:19A new developer often find setup issues starting Drupal development. I'm trying to make it easier for people.
Overview: (click read more)
- Install Mysql, Apache, PHP. Versions should be MySQL 5.x, Apache 2.x, and PHP 5.x. This is harder than it should be. One OK solution is to install XAMPP on Windows. MacPorts has a nice system to install everything one needs.
- Often, you will find issues with PHP modules not being installed. One should learn how to add PHP modules in Windows and Unix.
- MySQL connection issues through Apache will also be a configuration issue.
Jar listing utility--Java archive file tool. Handling import errors easily in 4 steps.
Submitted by luke on Mon, 2009-11-16 20:51Here is a quick example on how to get a database of what is contained in jars:
Step
1 of 4) Create a file containing:
#!/bin/bash
jarfolder=/usr/share
jarlist=/tmp/jarlist.txt
declare -a jarclass
find $jarfolder -name "*.jar" > $jarlist
for jarfile in `cat $jarlist`;
do
jarname=`basename $jarfile`;
jarfolder=`dirname $jarfile`;
jarclass=( $( jar -tvf $jarfile | awk '{ print $8 }' ) )
for aclass in "${jarclass[@]}"
do
echo $jarname $jarfolder $aclass;
done
done
2 of 4) Edit top 2 lines if needed/wanted.
3 of 4) Run the script and capture the output. You will get output like this:
maven-core-2.0.6-uber.jar /usr/share/maven/lib org/apache/maven/wagon/events/SessionEvent.class
maven-core-2.0.6-uber.jar /usr/share/maven/lib org/apache/maven/wagon/events/TransferEventSupport.class
maven-core-2.0.6-uber.jar /usr/share/maven/lib org/apache/maven/wagon/events/SessionEventSupport.class
maven-core-2.0.6-uber.jar /usr/share/maven/lib org/apache/maven/wagon/resource/Resource.class
maven-core-2.0.6-uber.jar /usr/share/maven/lib org/apache/maven/wagon/Wagon$1.class
maven-core-2.0.6-uber.jar /usr/share/maven/lib org/apache/maven/wagon/Wagon.class
Note: The list has 3 fields: Jar file name, Jar path, Class name.
Pete Hecht's resume on Google Docs
Submitted by pete on Tue, 2009-05-26 08:17My resume is on google docs. If you need a word or other format, please contact me.
Getting newlines
Submitted by pete on Wed, 2009-04-22 09:41defaults domains | sed 's/, /\'$'\n/g'
Will change all ", " to a real new line. Notice the use of a single quote.
Microsoft Office 2008 options
Submitted by pete on Mon, 2009-04-20 12:06While open office is the way to go, or neooffice for the Mac. Microsoft 2008 Office users should look at: http://www.maclife.com/article/tip_day/office_2008_filecompatibility_tro...
That might save your form data.
TFS Reportin links
Submitted by pete on Mon, 2009-04-20 04:39http://msdn.microsoft.com/en-us/library/ms162837.aspx
How to: Create an Aggregate Report for Team System using Report Designer and the Analysis Services Database
How to: Grant Access to the Databases of the Data Warehouse for Team System
How to: Create a Report Server Project for Team System
Managing Reports in Team Explorer
How to: Set Team Foundation Server Project Lead Permissions
Choosing the Source of Data in a Report for Team System
Choosing a Tool to Create Reports for Team System
Developer Support Team Foundation Server Blog
Submitted by pete on Tue, 2009-04-07 05:31Developer Support Team Foundation Server http://blogs.msdn.com/dstfs/ has good inks. For example: Testing Email flow from your Team Foundation Server.
Checking disk space
Submitted by pete on Mon, 2009-03-30 07:26Here is a quick and dirty diskspace script:
#!/bin/bash
ALERT=70
#ssh 10.61.37.176 df -H > /tmp/df.out
df -Hl > /tmp/df.out
cat /tmp/df.out | grep -vE 'Filesystem|tmpfs|cdrom' \
| awk '{ print $5 " " $1 " " $6 }' | \
while read output ;
do
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $3 }' )
if [ $usep -ge $ALERT ]
then
printf "Running out of space on partition %s \t %g \t %s %s\n" \
$partition $usep $(hostname) $(date)
fi
done
Notice the hard coded ALERT level as well as the commented out ssh command.
It needs work, but should show you how little space one has on all mounted drives.
