It looks like admin accounts in Windows 7 Home Premium have password expiration set on. However, Windows 7 in Home Premium edition does not have a GUI tool to remove it. There is, however, a command line tool which allows to do it over Windows Management Instrumentation – its name is wmic.
If you want to remove password expiration do the following:
- Click on Start button.
- Type wmic
- Right click listed program wmic and “Run as Administrator”
- Now you can list accounts that have password expiration set:
path Win32_UserAccount where PasswordExpires=TRUE get Name
- And you can disable it – you will be prompted to confirm the change:
path Win32_UserAccount where PasswordExpires=TRUE set PasswordExpires=FALSE
This is not really a missing answer, however, there are plenty of solutions which do not work well, or contain typos – mostly because of different quotes used in the command. This script allows changing the expiration at once for all users that have it set – and it does not contain any quotes
Anyway, this is so far the biggest failure I have encountered when using Windows 7 Home Premium edition: Force password expiration in home environment and do not provide a GUI how to disable it.
Sometimes I need to write commands to a handful of SSH sessions at once. I use putty terminal from Windows and did not find anything useful. So I let myself inspired by Rusty Klophaus’s pecho and wrote a Perl script, which is little bit more gentle to the escape sequences and than a small bash script which will nicely open multiple SSH sessions to given list of hosts. The nice think is that this works almost everywhere and does not need more than one standard Perl library on the writer side (on CentOS just run yum install perl-TermReadKey).
Adobe Reader marked document signed with PDFCreator as invalid with this error message:
Error during signature verification.
Error encountered while validating:
Internal cryptographic library error.
Error Code: 0×2711
– Czech equivalent —
Chyba v průběhu ověřování podpisu.
Při ověřování se vyskytla chyba:
Interní chyba šifrovací knihovny.
Kód chyby: 0×2711
There is no info available on the internet what does it mean, so I contacted support and the answer was easy – I was signing the document with backup of my private key – there was no certificate present in that file, so there was not way how to calculate hash of the document. The solution is to export the private key including your certificate.
Recently I become a fan of vim – and after storing my tuned dotvim on github, I found out, that I miss my configuration when I sudo to the root account. However, I’m not the only sudo user and I we have our own dotvim configuration. Here is a simple solution to be put into root’s .bashrc:
if [ -n "${SUDO_USER}" -a -d "/home/${SUDO_USER}/.vim" ]; then
alias vim="/usr/bin/vim --cmd \"set runtimepath+=/home/${SUDO_USER}/.vim\" -u /home/${SUDO_USER}/.vimrc"
fi
It took me quite a lot of googling to find the right combintation of $VIMRC, $VIMRUNTIME, $VIMINIT, $VIMHOME – and finally as you can see, none of those variables is used. Very usefull during debugging was to run vim with -V. to see where it looks for its configuration. And yes, I have tried putting the code to set the runtimepath to the .vimrc, but it would have to be conditional and this seems more clean.
I always forget how to change this and Google is not giving the right answer anywhere among top results, so here just for my record:
# Put into your .bashrc
export LC_TIME="POSIX"
# Or use just when needed
LC_TIME="POSIX" sar
sar is a command from systat package. It provides output in AM/PM format by default. Setting the locale LC_TIME to POSIX changes the time format to 24.
We use Microsoft Internet Explorer Application Compatibility VPC Image to test compatibility with IE6, IE7 and IE8. Recently we have moved to Windows 7 and the last update of perpetually expiring images (created last time on January 18, 2011) raised some issues which made enabling of Integration Features quite difficult (BTW, the images have changed filenames, IE User does not have password stated in the IE_VPC_ReadMe.txt).
Missing drivers
When enabling the features, the installation requested usbhub.sys and usbd.sys. The first file was recommended by MS to be taken from the Windows XP SP3. I have downloaded the SP3 and extracted the file using 7zip:
7za x WindowsXP-KB936929-SP3-x86-ENU.exe i386\usb*.*
But the installation requested another file – usbd.sys, which is not part of the XP SP3 – so I have copied the file from my Windows 7 (C:\Windows\System32\drivers\usbd.sys).
Password prompt
With enabled integration features the VPC asks for password. As it turned out, it tries to do remote desktop connection to itself. It suggests Admin user but Password1 does not work – apparently the Admin account is missing completely. IE User does not work either, because this user does not have password and cannot make remote desktop connection to this PC. So the solution is to give IE User a password and to save the credentials during start up (you may need to delete credentials of the Admin user before using properties on the .VMC files.
This way I have solved all the problems I did not have when running the Compatibility images on Windows Vista with earlier images.
Přepínám mezi českou a anglickou klávesnicí, ve Windows 7 je ale super vychytávka při psaní s defaultní anglickou klávesnicí – Spojené státy (mezinárodní), kdy uvozovky a jiné podobné znaky slouží ke psaní znaků s diakritikou. Řešení je změnit klávesnici na Angličtina (Spojené státy). Nicméně to mi pouze přidá další rozložení pro psaní Anglickým jazykem. Mezi těmito rozloženími mě Windows přepínají natolik náhodně, že jsem to dodnes nepochopil.
Zatím jediný způsob jak se toho nadobro zbavit pro mě byl zásah v registrech – smazal jsem rozložení z registrů:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409]
“Layout Text”=”United States-International”
“Layout Display Name”=”@%SystemRoot%\\system32\\input.dll,-5026″
“Layout File”=”KBDUSX.DLL”
“Layout Id”=”0001″
If you protect your private beta release from public with AuthType and you are using RewriteRule from mod_rewrite, you will soon find, that combination of <Location> and Satisfy does not work for you – it does not allow access to the subdirectory as expected.
<VirtualHost *:80>
ServerName beta.example.com
DocumentRoot /var/www/example
<Location />
AuthType basic
AuthName "Top Secret Beta!"
AuthUserFile /etc/httpd/htpasswd.beta
Require valid-user
</Location>
<Location /upload-callback>
Allow from all
Satisfy Any
</Location>
<Directory /var/www/example>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(swf|pdf|php|js|ico|txt|gif|jpg|png|css|rar|zip|tar\.gz)$ /index.php [L]
</Directory>
</VirtualHost>
With this setup, the subdirectory will require valid user – because mod_rewrite is applied before <Location> and changes the URL, which no longer matches. You can change this by adding an alias:
Alias /upload-callback /var/www/example/index.php
Now all URLs will go through your nice url generator index.php, but the specified URL will be checked against <Location> and give access based on the Allow directive (in this case to everyone).
We have some jQuery code, that we use on all our company sites, however, this code did not work on Drupal sites. jQuery call to position() was returning “static” instead of expected object with top and left properties. We thought we should use newer jQuery (instead of 1.2.6), but this throwed “too much recursion” error in Firebug – which we tried to solve with patch from bug http://drupal.org/node/335741 . However, neither upgrade nor that patch really helped. The reason why position() did not work was hidden here: /sites/all/modules/jquery_update/compat.js (I was looking at linked files and this one sounded suspiciously).
And indeed, these helpers caused the problem:
// UPGRADE: The following css helpers should now be used as:
// .css("top") or .css("top","30px")
jQuery.each("top,left,position,float,overflow,color,background".split(","), function(i,n){
jQuery.fn[ n ] = function(h) {
return h == undefined ?
( this.length ? jQuery.css( this[0], n ) : null ) :
this.css( n, h );
};
});
We have replaced position with xposition and our jQuery works as expected even with version 1.2.6.
From various reasons I ended up with some sophisticated rights settings for my subversion repository, the main idea is to grant access based on group. So I need that the files are created with proper group and with write right on the group.
For the command line ans svn+ssh access I created following files (based on some advice, which I found 4 years ago and did not notice a link):
/usr/local/bin/svn
#!/bin/sh
umask 002
/usr/bin/svn.orig "$@"
/usr/local/bin/svnserver
#!/bin/sh
umask 002
/usr/bin/svnserve.orig "$@"
As big surprise you will find that the web interface modifies files in the subversion repository - it removes write permission on group. I have solved this by adding following line to viewvc.cgi:
--- viewvc.cgi.orig 2009-10-25 09:55:34.738716284 +0100
+++ viewvc.cgi 2009-10-25 09:51:14.914726062 +0100
@@ -58,4 +58,5 @@
server = sapi.CgiServer()
cfg = viewvc.load_config(CONF_PATHNAME, server)
+os.umask(0002)
viewvc.main(server, cfg)