Tuesday, January 19, 2016

Windows 7 and 8 will not run on new hardware!





Although Windows 7 is supported until 2020 and Windows 8 until 2023, Microsoft announced recently that these OSes will not be fully supported on platforms built around newer CPUs and/or SoCs (System on a Chip).

Having the choice is the essence of freedom...

Supporting older hardware with newer OS has also a cost that is certainly relatively important, maybe with the same order of magnitude than supporting newer hardware on older OSes. So MS is certainly a little hypocritical.

I used to develop kernel drivers for Windows and, at least up to Windows 8.1, the kernels for Desktop and Server systems are really the same ones.
This means that, for a given platform, drivers for the desktop and the server equivalent system are really the same ones too.
So, in case MS allows newer hardware to run older Server OSes but not the equivalent Desktop OSes, on the same platforms, it will clearly be a software limitation. That would also be a little hypocritical. One could argue that SoC-based platforms are not designed to run server-class systems. That is somewhat true, but one can expect SoC designed for Servers (maybe not with high-end graphics and Bluetooth, but yet with a similar architecture than the SoCs designed for desktops).

And if MS don't allow older server systems to run on newer hardware, we can expect more shifts toward some other OSes popular in the Servers rooms...

Moreover alternative to MS OSes may also gain some traction just because of this politics of theirs. RemixOS, ConsoleOS and PhoenixOS are ports of Android for PCs platforms, for instance. I've played a little with Android-x86 and I think that Android may become quite popular as a desktop OS. Especially if the drivers for the hardware are there so that the system can take advantage of most of the components in the platforms it operates. So especially if OEMs begin to support Android-on-the-PC.

 Android 4.0 ice cream sandwich

Now, MS seems to be aggressively wanting to push Windows 10 to as many devices as possible, including now computer identified as operating in SMBs.


And we can suspect that it is not only for quality or reducing cost of supporting the older software/OSes, since supporting older hardware on newer OS has a non negligible cost too.
Win10 embeds a lot of telemetry and other components designed to report some data and details to MS, said data and details having a real value in today's world.

Users may want to have more choices than what MS offers today.
An ecosystem seems to emerge, aiming at bringing more choice and control to Windows users. Among the first achievements in this ecosystem one can find some tools design to give more choice and control to users regarding the upgrade to Windows 10 on systems currently running Windows 7 and Windows 8, namely "I don't want Windows 10", "GWX Control Panel" and "Win10wiwi (Windows 10 When I Want It)". The last of these free tools is, as far as I could test, the easier to use and the most reliable for users who want to stick to their beloved Windows 7 (or Windows 8.1 for some).

http://win10wiwi.com

Windows was good at giving its users more choices than OS X for instance and at allowing backward compatibility. It may loose some traction if it looses these aspects of its ecosystem.

Only the future will tell us what it will be(come) in the end...

Tuesday, December 08, 2015

Firefox can't upload pdf files ? Here are some solutions


There is a problem with Firefox that was reported many times since 2007 :

When you want to upload a PDF file to a web site, let's say an invoice document for instance, some web sites will refuse it, arguing that it is not a PDF file.


The problem is usually caused by Firefox not sending the correct file type to the web site. This type is called a MIME type. Depending on how the web site is programmed, this will happen or not.

The correct MIME type for a pdf file is application/pdf.

Unfortunately, if there are several MIME types associated to pdf files in Firefox, it will use the last MIME type it finds in its configuration file when uploading such a file to a remote web site. I guess it is not only for pdf files, it is certainly the same for all kind of files, provided that there is a MIME type associated to them.

Furthermore, the setting Firefox uses to send the MIME type when uploading a file is related to the extension of the file. Then, a definition of the MIME type that specifies the extension is required if one wants to customize (or fix) the MIME type that FF sends when uploading a particular type of file.

In my case, Firefox was sending the MIME type application/force-download instead of the MIME type application/pdf.

To correct that, one has to make some changes in the configuration file that Firefox uses for setting its MIME types. This file is called mimeTypes.rdf.

It is in your Firefox profile folder.

The profile folder can be found as described here:
https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile
 
  1. Click the menu button , click help and select Troubleshooting Information. The Troubleshooting Information tab will open.
  2. Under the Application Basics section, click on [Show Folder] button A window with your profile files will open.

The "help" question mark is at the bottom of the menu window, and then, the [Show Folder] button is available, similar to this :





Now, you click on [Show Folder] button, a window with all the files in your profile folder will open up.

You have then to scroll down to the file mimeTypes.rdf


And then open it up with a text editor. I used Notepad++ for Windows, but any text editor (or XML editor) should work ok.

When mimeTypes.rdf is opened and ready for editing, search the word pdf in it (use the integrated search feature in your text editor).


Solution 1: Create correct MIME type definition at the end of mimeTypes.rdf file


You must make sure that last mention to files with pdf extensions type in the mimeTypes.rdf file is similar to the following:
  <RDF:Description RDF:about="urn:mimetype:handler:application/pdf"
                   NC:fileExtensions="pdf">
  </RDF:Description>

You can then just add the lines that refer to files with a pdf extension and state that the MIME type is application/pdf (the few lines similar to what is just above) at the end of the mimeTypes.rdf file.

Don't mess up with the headers and footers of the file, they must stay untouched.
The end of your mimeTypes.pdf file should then be similar to:
  <RDF:Description RDF:about="urn:mimetype:handler:application/pdf"
                   NC:fileExtensions="pdf">
  </RDF:Description>
</RDF:RDF>



Solution 2: Remove the incorrect MIME type definitions


If you see anything like the following:
  <RDF:Description RDF:about="urn:mimetype:application/force-download"
                   NC:fileExtensions="pdf"
                   NC:description=""
                   NC:value="application/force-download"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/force-download"/>
  </RDF:Description>

Delete all the lines between <RDF:Description and </RDF:Description> (included).
You may have to do this for all sections that embed the line NC:fileExtensions="pdf" (but the last one if you have also chosen solution 1).


For both solutions: save and reload


Now you will have to close Firefox.
But wait !
If you are reading this article with Firefox, save your mimeTypes.rdf file before closing Firefox.

Close Firefox, optionally, save again mimeTypes.rdf if it was modified by Firefox when it closed. Notepad++ will warn you if this is the case and you must not reload the file then, before saving it again.

Start Firefox again, and voilà, you should be able to upload pdf files to web site inside Firefox.




Sunday, November 29, 2015

Using Google (Shared) Calendars With Lightning and any CalDav capable agenda





There are several resources on the Internet related to using Google calendars with Thunderbird and its Lightning extension.

However, I did not find anywhere how to use shared calendars as CalDav calendars, in order to avoid using Thunderbird's extension "provider for google calendar". I had to get rid of said extension because I had "unresponsive scripts" in Thunderbird that caused Thunderbird to become unresponsive for several seconds (sometimes up to one minute), which is a PITA, especially when you are writing an email.

In order to use a shared google calendar as a CalDav calendar, one has to know the calendar's URL.

The URL is this one:
https://apidata.googleusercontent.com/caldav/v2/CalID/events

Now, what is this CalID ?

This is the ID of the calendar that one can find on Google's calendar properties page.
In order to get this ID, you must open your Calendar settings. The ID is near to the Calendar address, like in the following screen capture:


In the case of a shared calendar, the ID is likely to be something like:
4alvrbb94gc7sffjki8klf4l2k@group.calendar.google.com

With such an ID, the URL to use would be
 https://apidata.googleusercontent.com/caldav/v2/4alvrbb94gc7sffjki8klf4l2k@group.calendar.google.com/events

Now in Thunderbird with Lightning extension, one just just has to create the corresponding CalDav calendar as a network calendar:







 And then the calendar and events will be available in Thunderbird's calendars




Friday, November 15, 2013

Obtenir une Facture avec TVA sur google play store

Récemment, il m'a fallu obtenir une facture avec TVA suite à un achat effectué sur le Google Play Store. Un ami m'avait envoyé une procédure en 6 étapes qui, à l'usage, s'est révélée incomplète. J'ai fini par m'en sortir, alors comme ce n'était pas évident, je partage l'information ici.
Il faut commencer par aller sur http://play.google.com et y être connecté avec le compte utilisé lors de l'achat.
Puis :

  1. - Clic sur la petite roue dentée (paramètres) en haut à droite de la page et sélectionner "mes commandes"
  2. - ligne de la commande en question : clic sur "informations"
  3. - bas de page : contactez-nous
  4. - bas de page : sélectionner la langue "Français" puis valider  (si ce n'est pas déjà fait)
  5. - Cliquer sur "commander des appareils sur Google Play :..."
  6. - Cliquer sur "Etat des commandes et livraisons"
  7. - Cliquer sur "Contactez-nous" (en haut à droite)
  8. - Sélectionner "Achat d'appareils sur google play (commandes, retours, assistance technique)"
  9. - Sélectionner "j'ai besoin d'une facture"
  10. - Remplir n° de TVA intracommunautaire (optionnel), adresse de facturation / adresse de livraison / numéro de commande etc...-> Envoyer. 

Normalement,  la facture devrait êre éditée en envoyée par e-mail (j'attends avec impatience de voir si ça a marché !)


Thursday, March 08, 2012

Facebook: Alerts are off while you use another client to chat.

Recently (well VERY recently), Facebook began to display this message, "Alerts are off while you use another client to chat." in my Instant Messenging/Chat sub-window (on facebook).
So what does it mean?
I have several devices connected to facebook and to facebook chat: PCs, smartphone tablets.
I also have configured Pidgin to be used as a Facebook chat client. Pidgin has this very interesting feature called "Bounces", that makes it possible to be alerted when someone connects, disconnects etc. Very useful if you want to catch people that do not stay long on their chat client.
I figured out that pidgin was in cause for that message to happen.
And actually, when I disabled ALL my pidgin connections to facebook's chat, the message "Alerts are off while you use another client to chat." disappeared.
But there is something strange... I did not know there were "alerts" for Facebook chat.
And actually, it seems there are none.
Yet...

Monday, February 27, 2012

Solve driver missing issue when installing Windows 7 (sp1) from USB drive

There are a lot of tutorials teaching you how to create a bootable USB drive (HDD? key...) that can be use to boot a PC and install Windows 7 on it.
I followed the ones that explains how to partition/format your USB drive (using diskpart) and theb extract the files out off the Windows 7 .ISO file.
Everything seemed to work OK: the PC was booting off the USB drive (a portable WD 500GB USB 3.0 drive) and Windows installation program was launched.
But quite soon in the installation process, the program was complaining about some missing CD/DVD driver.
I tried several "tricks", browsing X:\Windows\inf folder etc.
Did not work.
What worked was
- To unplug and plug again the USB drive
- To press the "Browse" button (like if I was trying to search for the appropriate driver)
- To make sure the USB drive then showed up in the dialog
- To cancel the search of the appropriate driver
- To press the "Install Windows" button again.

When the computer reboots the first time after having copied the first set of installation files on the internal storage (HDD for instance), don't forget to make it boot off the internal storage, and not off the USB-drive.

I did not find this trick when I searched for it, so I create this simple/little blog entry hoping it will help some readers in the future

Saturday, January 23, 2010

How to use a VPN which forces routing to your employer's network AND YET access your local network at the same time



My employer is paranoid.
A lot of them are these days.

This employer provides a VPN access that forces the use of the corporate gateway as the default gateway and which sets the route to this default gateway to use a metric of 1.

This leads to the following result: When my laptop (provided by my employer) is connected to my employer's VPN behind my home network firewall/NAT/router, I have no access to the various devices on my home network, including local printer/scanner and various multimedia devices.
Very annoying indeed.

So I have found a way to circumvent that.

Basically, what I do it that I set a standard VPN connection instead of using my employer's provided wrapper (above MS Windows VPN links). And then I change the routing table so that my default gateway is the one of my home router (or the hotel router) and all the traffic to my employers network go through the VPN link.

My employers owns 2 C-Class Internet ranges so the routing to my employer's network is easy to figure out.

OTOH, when specifying a route in Windows, one must know the IP address and ID of the interface to use for these packets. And a VPN interface (actually a WAN PPP interface) has the nasty habit of changing its ID each time it is launched, and usually, it will also get a different IP address each time. So I developed a small utility to recover this ID and store it in an environment variable.

Then, I just have to invoke the corresponding "route change" or "route add" commands to add the routes to my employers C-Class and to make these route using the VPN interface.


It may seem more complicated than it is.

1st thing: Create the VPN connexion using standard MS Windows VPN.
In my case, my employer uses a simple PPTP tunnel, so it is very easy. But L2TP should be as easy. IPSEC might be a little more complex, but if you use IPSEC, you might skip this step and just change the routing as described below.

In order to set a Windows based VPN, you can use this tutorial:
https://people.chem.umass.edu/wiki/index.php?title=VPN_-_Connect_from_Windows_XP


One thing you must NOT forget is to uncheck the "Use default gateway on remote network":





This is the last screen of the tutorial mentioned above... If you do not know how to get there, just follow the tutorial above.



2nd thing:
Change the routing table

I use a .bat file like this one (I changed the real network classes...) :

NICIndex.exe /IPPrefix=193.105.13. /Type=PPP > %temp%\SetPPP.bat
if exist %temp%\SetPPP.bat call %temp%\SetPPP.bat
route add 192.105.13.0 MASK 255.255.255.0 %NICIP% Metric 50 IF %NICIDX%
route add 192.105.14.0 MASK 255.255.255.0 %NICIP% Metric 50 IF %NICIDX%

What you miss is my NICIndex tool that can be downloaded from this site, just following the link above.
It is a Delphi program which uses WMI to get the network adapters information.
It gets the ID of the first interface it founds which IP address begins with the parameter passed to it. In the example above:
NICIndex.exe /IPPrefix=193.105.13. /type=PPP
will get the interface ID of the first network interface which type is "PPP" (Point to point protocol, which is the type of VPN interfaces. The other types that you might use are "Ethernet" and, maybe, "TokenRing"...) that has an IP address beginning with 193.105.13
It will display this ID in the form
SET NICIDX=

for instance SET NICIDX=0x2000A
It also displays the interface IP address in the form
SET NICIP=193.195.13.127

Actually, NICPPPIndex.exe displays something like
SET NICIDX=
SET NICIP=
SET NICIP=193.195.13.127
SET NICIDX=0x2000A

So calling it this way:

NICIndex.exe /IPPrefix=193.105.13. /Type=PPP > %temp%\SetPPP.bat

you create a SetPPP.bat file in your temp folder.
When you call this SetPPP.bat file, you create the NICIP and NICIDX environment variables that you need to tune your routing table.
Thus my "VPNRoute.bat" file:

NICIndex.exe /IPPrefix=193.105.13. /Type=PPP > %temp%\SetPPP.bat
if exist %temp%\SetPPP.bat call %temp%\SetPPP.bat
route add 192.105.13.0 MASK 255.255.255.0 %NICIP% Metric 50 IF %NICIDX%
route add 192.105.14.0 MASK 255.255.255.0 %NICIP% Metric 50 IF %NICIDX%

In order for this to work, you need the NICIndex.exe file. And it must be in your PATH.


3rd thing:
Now connect it !

The only thing you have to do is to launch the VPN connection. When it is OK, launch the VPNRoute.bat file (for instance copy it on your desktop, after having modified it to suit your particular networking configuration)


Open Source !

My NICIndex source file, in Delphi, is here. Very simple.
NICIndex Source is available for download here:
http://www.filefactory.com/file/b13g5c3/n/NICIndex.dpr

I also include the full source text hereafter but blogger seems to truncate the end of lines...

program NICIndex;


{$APPTYPE CONSOLE}

uses
SysUtils,
Windows;

const
MAX_ADAPTER_NAME_LENGTH = 256;
MAX_ADAPTER_DESCRIPTION_LENGTH = 128;
MAX_ADAPTER_ADDRESS_LENGTH = 8;

TnTYPE:array[0..28] of AnsiString=('','','','','','','Ethernet','','','Token ring','','','','','','FDDI','','','','','','','','PPP','Loopback','','','','Slip');

type
PrIP_ADDRESS=^TrIP_ADDRESS;
TrIP_ADDRESS=record
Next:PrIP_ADDRESS;
IpAddress:array[0..15] of Char;
IpMask:array[0..15] of Char;
Context:DWORD;
end;

PrADAPTER=^TrADAPTER;
TrADAPTER=record
FNext:PrADAPTER;
FComboIndex:DWORD;
FAdapterName:array[0..MAX_ADAPTER_NAME_LENGTH+3] of Char;
FDescription:array[0..MAX_ADAPTER_DESCRIPTION_LENGTH+3] of Char;
FAddrLen:UINT;
FAddress:array[0..MAX_ADAPTER_ADDRESS_LENGTH-1] of Byte;
FIndex:DWORD;
FType:UINT;
FDHCPEnabled:UINT;
FCurrentIpAddress:PrIP_ADDRESS;
FIpAddressList:TrIP_ADDRESS;
FGatewayList:TrIP_ADDRESS;
FDHCPServer:TrIP_ADDRESS;
FHaveWins:BOOL;
FPrimaryWinsServer:TrIP_ADDRESS;
FSecondaryWinsServer:TrIP_ADDRESS;
FLeaseObtained:Longint;
FLeaseExpires:Longint;
end;

function GetAdaptersInfo(pAdapterInfo:PrADAPTER;pOutputBuffer:PULONG):DWORD;stdcall;external 'IPHlpAPI.dll' name 'GetAdaptersInfo';


var
Size:DWORD;
Info,P:PrADAPTER;
Found:Boolean=False;
PPPIP: string;
IPPrefix, NICType: string;
I: byte;


begin
Writeln(ErrOutput,ExtractFileName(ParamStr(0))+' Usage: ');
Writeln(ErrOutput,ExtractFileName(ParamStr(0))+' [/IPPREFIX= | /Type=]');
Writeln(ErrOutput,'Examples: '+ExtractFileName(ParamStr(0))+' /IPPREFIX=192.168.4.');
Writeln(ErrOutput,' '+ExtractFileName(ParamStr(0))+' /Type=Ethernet');
Writeln(ErrOutput,' '+ExtractFileName(ParamStr(0))+' /IPPREFIX=192.168.6. /Type=PPP');

Size:=0;
P:=nil;
GetAdaptersInfo(P,@Size);
GetMem(P,Size);
GetAdaptersInfo(P,@Size);
writeln('SET NICIDX=');
writeln('SET NICIP=');
PPPIP:='';
IPPrefix:='';;
NICType:='';
for I:=1 to ParamCount do
begin
if Uppercase(Copy(ParamStr(I),1,Length('/IPPREFIX=')))='/IPPREFIX=' then IPPREFIX:=Copy(ParamStr(I),Length('/IPPREFIX=')+1,Length(ParamStr(I))-Length('/IPPREFIX='));
if Uppercase(Copy(ParamStr(I),1,Length('/Type=')))='/TYPE=' then NICType:=Copy(ParamStr(I),Length('/Type=')+1,Length(ParamStr(I))-Length('/Type='));
end;
try
Info:=P;
if Assigned(P) then
// just printout - not needed
repeat
PPPIP:=PChar(@Info^.FIpAddressList.IpAddress);
if (IPPrefix<>'') and (NICType<>'') then Found:= (UpperCase(TnTYPE[Info^.FType])=UpperCase(NICType)) and (Pos(IPPrefix,PPPIP)=1)
else
begin
if NICType<>'' then Found:=(UpperCase(TnTYPE[Info^.FType])=UpperCase(NICType))
else if IPPrefix<>'' then Found:=(Pos(IPPrefix,PPPIP)=1);
end;

if (Found) then
begin
writeln('SET NICIP=',PPPIP);
writeln('SET NICIDX=',Format('0x%x',[Info^.FIndex]));
exit;
end;
Info:=Info^.FNext;
until not Assigned(Info);
finally
FreeMem(P);
end;
end.