There is a command that will work on all platforms I tested (HP-UX, SunOS, Linux, MacOS) and shells (sh,ksh,bash,csh,zsh)
ps -p $$ | grep $$ | awk '{ print $NF }'
Be aware that the shell name can be bash or -bash
Thursday, September 25, 2008
Tuesday, June 24, 2008
At least one secondary cursor must be specified to DB->join error 22
Never found this problem on the Internet? Does it mean nobody except me run into it?
I have tested BerkeleyDB BTree 4.7.25 (from Oracle now) and when running a simple test described in their doc I got the following when opening (creating) a database:
At least one secondary cursor must be specified to DB->join error 22
After hours of searching here is what I found - the standard installation that comes the btree with is precompiled with a different Visual Studio that has a problem with VS 6.0 I was using. Even though I was able to download the dll (the release mode because the debug mode was wrong - shipped with improper MS nondebug libraries) the opening was returning this wrong message.
Only after opening the .dsw that came with the sources, and rebuilding it with VS 6.0 all went okay.
I hope it will help someone...
I have tested BerkeleyDB BTree 4.7.25 (from Oracle now) and when running a simple test described in their doc I got the following when opening (creating) a database:
At least one secondary cursor must be specified to DB->join error 22
After hours of searching here is what I found - the standard installation that comes the btree with is precompiled with a different Visual Studio that has a problem with VS 6.0 I was using. Even though I was able to download the dll (the release mode because the debug mode was wrong - shipped with improper MS nondebug libraries) the opening was returning this wrong message.
Only after opening the .dsw that came with the sources, and rebuilding it with VS 6.0 all went okay.
I hope it will help someone...
Friday, June 6, 2008
New download of the cvs repository on Windows
I have moved to a new laptop, and I had to get all the data from the cvs repository to this new one.
I wasn't even expecting so many problems with the WinCVS application to have!
No, it's not that WinCVS is bad. It's great. The point is that It gives so many options to accomodate so many users behaviours that at someome moment these options became a burden!
So I have finally decided to describe, step-by-step all the operations one needs to do in order to download new repository to his/her place.
This list is for cvs windows only.
I may to do this for Linux/Unix as well some time.
If you want to install WinCVS then, please, search on the Internet, wait for my new blog, or write to me in the comments.
-------------------------------------
After this operation, you will have your selected directory (c:\JohnsProject\ProjectAlpha, or c:\JohnsProject only) populated with the data.
from the server.
I wasn't even expecting so many problems with the WinCVS application to have!
No, it's not that WinCVS is bad. It's great. The point is that It gives so many options to accomodate so many users behaviours that at someome moment these options became a burden!
So I have finally decided to describe, step-by-step all the operations one needs to do in order to download new repository to his/her place.
This list is for cvs windows only.
I may to do this for Linux/Unix as well some time.
If you want to install WinCVS then, please, search on the Internet, wait for my new blog, or write to me in the comments.
RUN: <<<WinCVS>>>
MENU: <<<Admin/Login...>>>
EDIT: <<<CVSROOT:>>> - avoid using <<<...>>> It's overly confusing. It is better to enter the path:
:pserver;username=USERNAME;hostname=HOSTNAME:REPOSITORY
EXAMPLE: :pserver;username=john;hostname=our.server.org:/Projects
BUTTON: <<<OK>>>
The CVS will ask you for the password which will be stored at your machine
in an encrypted form and will be used for communication every time you
access the repository, but until you click MENU: <<<Admin/Logout>>>
MENU: <<<Remote/Checkout module...>>>
DIALOG: <<<Checkout settings>>>
EDIT: <<<Module name and path on the server:>>>
ProjectAlpha
EDIT: <<<Local folder to checkout to:>>>
CHANGE IT so it points at the ROOT directory where the ProjectAlpha directory will be created.
EXAMPLE: c:\JohnsProject\ (yes, add the backslash at the end!)
NOTE: If you DO NOT WANT to create the ProjectAlpha\ directory in the c:\JohnsProject one then you need to do:
CHECKBOX: <<<Check out into directory:>>> Turn in ON
EDIT: <<<Check out into directory:>>>
JohnsProject
COMBOBOX: <<<CVSROOT:>>>
Drop down menu and select the last one that you have enteted a few steps above.
BUTTON: <<<OK>>>
Off you go!
-------------------------------------
After this operation, you will have your selected directory (c:\JohnsProject\ProjectAlpha, or c:\JohnsProject only) populated with the data.
from the server.
Thursday, June 5, 2008
Sending an email from PHP (on Windows too.)
Yey, finally got something that really works.
It's not my stuff, but I was able to found it after a long time search!
Here is the link to sourceForge.net, to the page that hosts php Mailer for PHP 5 for Windows, and looks like for Unix too. If the link does not work then search for the word phpMailer.
The easiest way to install the stuff is to do as follows (example on Windows, with assumption that you have your php installed in the c:\php directory.)
> mkdir c:\php\mailer
Unzip phpMailer_v2.1.zip into c:\php\mailer
> notepad.exe c:\php\php.ini
Add at the very end:
include_path=".;c:\php\mailer"
Youre done!
Now, example:
It's not my stuff, but I was able to found it after a long time search!
Here is the link to sourceForge.net, to the page that hosts php Mailer for PHP 5 for Windows, and looks like for Unix too. If the link does not work then search for the word phpMailer.
The easiest way to install the stuff is to do as follows (example on Windows, with assumption that you have your php installed in the c:\php directory.)
> mkdir c:\php\mailer
Unzip phpMailer_v2.1.zip into c:\php\mailer
> notepad.exe c:\php\php.ini
Add at the very end:
include_path=".;c:\php\mailer"
Youre done!
Now, example:
>
<?php
require_once( "class.phpmailer.php" ) ;
$mail = new PHPMailer() ;
$mail->IsSMTP() ;
$mail->Host = "smtp.myserver.com:587" ;
$mail->SMTPAuth = true ;
$mail->Username = "username" ;
$mail->Password = "password" ;
$mail->From = "me@myserver.com" ;
$mail->FromName = "It is me!" ;
$mail->AddAddress( "testaddress@theirserver.com", "Poor Receiver" ) ;
$mail->AddReplyTo( "me@myserver.com", "do-not-reply" ) ;
$mail->AddAttachment( "c:\\mydog.jpg", "Isn't she cute?" ) ;
$mail->Subject = "Sorry for this test email!" ;
$mail->IsHTML( true ) ;
$mail->Body = file_get_contents( "c:\\myemail.html" ) ;
$mail->AltBody = "non-HTML mail client? Where are you from?" ;
if( !$mail->Send())
printf( "Sending Error: " . $mail->ErrorInfo . "\n" ) ;
else
printf( "Message has been sent successfully.\n" ) ;
?>
Friday, May 30, 2008
Script Shell Syntax checking
I'm writing a lot of stuff in shell (Korn,Bourne,Bash) and I had a need for syntax checker in the build time. Something I could use either in the command line (like a compiler) or in the make time which should stop the build whenever there is a syntax error in my script.
Here is what I came up to. Simply copy/paste the code below to a file named shck.sh (or whatever you wish to call it), do chmod+x shck.sh and off you go!
Usage:
shck.sh myscript.sh
-or-
cat myscript.sh | shck.sh
You can also use it in the makefile. It will return value 1 if there was an error.
-----------------------------------------------------
shck_return() {
return $1
}
shck_errno=0
echo "set -n ">random.$$.sh
cat $1 >>random.$$.sh
chmod +x random.$$.sh
./random.$$.sh >errors.$$.err 2>errors.$$.err
rm -f random.$$.sh
grep -v ": warning: line" errors.$$.err | sed -e s/random.$$.sh/$1/g >errors.$$.err2
[ -s errors.$$.err2 ] && {
shck_errno=1
cat errors.$$.err2
}
rm -f errors.$$.err errors.$$.err2
shck_return $shck_errno
Here is what I came up to. Simply copy/paste the code below to a file named shck.sh (or whatever you wish to call it), do chmod+x shck.sh and off you go!
Usage:
shck.sh myscript.sh
-or-
cat myscript.sh | shck.sh
You can also use it in the makefile. It will return value 1 if there was an error.
-----------------------------------------------------
shck_return() {
return $1
}
shck_errno=0
echo "set -n ">random.$$.sh
cat $1 >>random.$$.sh
chmod +x random.$$.sh
./random.$$.sh >errors.$$.err 2>errors.$$.err
rm -f random.$$.sh
grep -v ": warning: line" errors.$$.err | sed -e s/random.$$.sh/$1/g >errors.$$.err2
[ -s errors.$$.err2 ] && {
shck_errno=1
cat errors.$$.err2
}
rm -f errors.$$.err errors.$$.err2
shck_return $shck_errno
Wednesday, May 28, 2008
Opening unopenable attachments in Microsoft Outlook
The Microsoft Outlook software, starting, as I believe, from version 2003, turned opening some of the attachments for good. If you received, for example, an .mdb file (from Microsoft Access,) then you will only see that you got it, but you won't be able to copy it to the hard drive. Don't try searching in the options as suggested in the email. There is no option to turn the ability to detach the attachment on.
Microsoft says it clearly - because it is one of the most popular applications for managing emails, it has been constantly under attach by the hackers, so to 'save' their customers, they turned several options off for good. There is a workaround though. You can ask the sender to send you the file again, but ask him/her to rename the extension of the file or to zip/rar it. If such option is not a good one, or at least not for the very moment because you're in a hurry, there the following solution:
Run regedit: WARNING, WARNING: These operations are dangerous, so if you're not feeling secure, don't play with regedit. Screwing up in this file may screw up with your Windows installation and ultimatelly you may have to reinstall your OS!!!!
Open HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security
(11.0 is for Outlook 2003)
Create or add a New String Value under this key with the name: Level1Remove
Enter the file extensions separated with the semicolon (;) that you would like to support in the attachment. The file extensions should start with a coma.
EXAMPLE:
Level1Remove .mdb;.xlsx
Typical errors:
- forgetting to put a dot in the front of the extension
- putting spaces into the Level1Remove value
- Putting Level1Remove string into improper place in registry
- Creating a KEY instead of a STRING VALUE in registry.
When you are done, close the regedit program, close your Microsoft Outlook application, and open it again. From that moment, the files with the extensions you have just added into registry will be available for you.
Make sure you don't overdo and don't add others files 'just in case'. You may put yourself in danger by allowing to accept .exe, .bat, .js and other executable files. Use your head!
Microsoft says it clearly - because it is one of the most popular applications for managing emails, it has been constantly under attach by the hackers, so to 'save' their customers, they turned several options off for good. There is a workaround though. You can ask the sender to send you the file again, but ask him/her to rename the extension of the file or to zip/rar it. If such option is not a good one, or at least not for the very moment because you're in a hurry, there the following solution:
Run regedit: WARNING, WARNING: These operations are dangerous, so if you're not feeling secure, don't play with regedit. Screwing up in this file may screw up with your Windows installation and ultimatelly you may have to reinstall your OS!!!!
Open HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security
(11.0 is for Outlook 2003)
Create or add a New String Value under this key with the name: Level1Remove
Enter the file extensions separated with the semicolon (;) that you would like to support in the attachment. The file extensions should start with a coma.
EXAMPLE:
Level1Remove .mdb;.xlsx
Typical errors:
- forgetting to put a dot in the front of the extension
- putting spaces into the Level1Remove value
- Putting Level1Remove string into improper place in registry
- Creating a KEY instead of a STRING VALUE in registry.
When you are done, close the regedit program, close your Microsoft Outlook application, and open it again. From that moment, the files with the extensions you have just added into registry will be available for you.
Make sure you don't overdo and don't add others files 'just in case'. You may put yourself in danger by allowing to accept .exe, .bat, .js and other executable files. Use your head!
Labels:
attachements,
Microsoft Outlook,
regedit,
registry,
security
jpg - changing internal date and time stamp
Ooops. I have set an improper date on my digital camera and now, Picassa shows my pictures in improper order. I take care of setting the date and time stamp of the file but even though, Picassa puts my new pictures amont the last year ones.
I started searching for a tool that would allow me to change the internal jpeg (jpg) date and time stamps, and I have run onto a very nice one - file Tweak (http://filetweak.com) The sad part this tool, being really an excellent Windows addition to the file properties dialog box, cost money, and I didn't want to spend money to, from time to time, fixing my mistakes. (You can download a limited in time and functionality filetweak from them.)
I have decided to take a closer look to the jpg file and check if I can change the date and time opening the file in binary mode (I use Visual Studio, but you can find other free tools that can do it for you.)
What a surprize - the date time is stored in DOS open format!
Example: 2008:05:25 22:36:40
In my jpeg files are three dates (when the picture has been taken, when was digitalized and when was modified.)
The easiest way then, to change the timestamp of your jpeg files is:
Search for the year your picture has been taken (Right-click on the file, Properties,Summary tab,Make sure Advanced button is on, Search for Date Picture Taken.)
Simply, using any binary editor, modify the date and/or time of the jpg files (up to three places to be changed) and save the file. You're done. Picassa and you will be happy :)
I started searching for a tool that would allow me to change the internal jpeg (jpg) date and time stamps, and I have run onto a very nice one - file Tweak (http://filetweak.com) The sad part this tool, being really an excellent Windows addition to the file properties dialog box, cost money, and I didn't want to spend money to, from time to time, fixing my mistakes. (You can download a limited in time and functionality filetweak from them.)
I have decided to take a closer look to the jpg file and check if I can change the date and time opening the file in binary mode (I use Visual Studio, but you can find other free tools that can do it for you.)
What a surprize - the date time is stored in DOS open format!
Example: 2008:05:25 22:36:40
In my jpeg files are three dates (when the picture has been taken, when was digitalized and when was modified.)
The easiest way then, to change the timestamp of your jpeg files is:
Search for the year your picture has been taken (Right-click on the file, Properties,Summary tab,Make sure Advanced button is on, Search for Date Picture Taken.)
Simply, using any binary editor, modify the date and/or time of the jpg files (up to three places to be changed) and save the file. You're done. Picassa and you will be happy :)
Subscribe to:
Posts (Atom)