It starts to be not so funny any more: almost every week a new Java security update.
Time to update again, to stay secure and install the patch: Security Alert CVE-2013-1493.
On the funny side: Java 0day countdown.
–jeroen
Posted by jpluimers on 2013/03/05
It starts to be not so funny any more: almost every week a new Java security update.
Time to update again, to stay secure and install the patch: Security Alert CVE-2013-1493.
On the funny side: Java 0day countdown.
–jeroen
Posted in *nix, Apple, Development, Java, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, OS X 10.8 Mountain Lion, Power User, Software Development, Windows, Windows 7, Windows 8, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Tagged: java security, new java, security alert, software, technology | 2 Comments »
Posted by jpluimers on 2013/03/05
Posted in LifeHacker, Power User | Leave a Comment »
Posted by jpluimers on 2013/03/05
I’ve been working at a client where they have hardened most of their systems in a not so programmer friendly way. One of the things you cannot to is start RegEdit, not even for viewing. Since I need Fiddler2 to poke through their Internet Proxy in order to get access to an external TFS server, and their machines often reboot due to maintenance cycles, sometimes my proxy settings are dead. This tiny app shows you how to get display your proxy settings, demonstrating:
Enjoy! (Note, you could have done this with PowerShell in a very easy way too, as it access the Registry just like it was a file system).
When using Fiddler, it shows output like this:
AutoConfigProxy=wininet.dll ProxyEnable=1 MigrateProxy=1 ProxyHttp1.1=1 ProxyOverride=<-loopback> ProxyServer=http=127.0.0.1:8888;https=127.0.0.1:8888;
One of the drawbacks of Registry work is that you need to dispose of your keys. That is handled inside ReadOnlyAccessToRegistryKey.Run which also handles your Code Access Security. This means that the lambda expression (could just as well have been an anonymous method) can just concentrate on the LINQ stuffreturning an enumeration of anonymous types. You need the ‘let’ portion if you also want to perform ‘where’ on the values.
using System;
using System.Collections.Generic;
using System.Linq;
using BeSharp.Win32;
using Microsoft.Win32;
namespace LinqToRegistryShowProxySettings
{
class Program
{
static void Main(string[] args)
{
try
{
run();
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
}
static void run()
{
const string internetSettingsKey = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings";
ReadOnlyAccessToRegistryKey.Run(Registry.CurrentUser, internetSettingsKey,
registryKey =>
{
var keyValues = from name
in registryKey.GetValueNames()
//let keyValue = new { key = name, value = registryKey.GetValue(name).ToString() } // only if you need the Value in the Where, as it created for all occurences
where
name.Contains("proxy", StringComparison.OrdinalIgnoreCase) ||
name.Contains("autoConfig", StringComparison.OrdinalIgnoreCase)
select new { key = name, value = registryKey.GetValue(name).ToString() };
foreach (var keyValue in keyValues)
{
Console.WriteLine("{0}={1}", keyValue.key, keyValue.value);
}
}
);
}
}
}
This manages the Code Access Security since you will access the registry readonly. It also disposes the RegistryKey instance. The Code Access Security access and revert must be in the same method, so you cannot create a class that does the Assert in the constructor, and the dispose in the Disposer.
using System;
using Microsoft.Win32;
using System.Security.Permissions;
using System.Security;
namespace BeSharp.Win32
{
public class ReadOnlyAccessToRegistryKey
{
public static void Run(RegistryKey hiveRegistryKey, string subKeyName, Action action)
{
string fullKeyName = hiveRegistryKey.Combine(subKeyName);
RegistryPermission readRegistryPermission = new RegistryPermission(RegistryPermissionAccess.Read, fullKeyName);
readRegistryPermission.Assert();
try
{
using (RegistryKey registryKey = hiveRegistryKey.OpenSubKey(subKeyName))
{
action(registryKey);
}
}
finally
{
CodeAccessPermission.RevertAssert();
}
}
}
}
Extensions for the Registry:
using System;
using Microsoft.Win32;
namespace BeSharp.Win32
{
public static class RegistryExtensions
{
// Hives: http://en.wikipedia.org/wiki/Windows_Registry
public readonly static string HKCC = Registry.CurrentConfig.Name;
public readonly static string HKCR = Registry.ClassesRoot.Name;
public readonly static string HKCU = Registry.CurrentUser.Name;
#if Obsolete
[Obsolete]
public readonly static string HKDD = Registry.DynData.Name;
#endif
public readonly static string HKLM = Registry.LocalMachine.Name;
public readonly static string HKPD = Registry.PerformanceData.Name;
public readonly static string HKU = Registry.Users.Name;
public static string Combine(this string keyName, string subKeyName)
{
string result = string.Format(@"{0}\{1}", keyName, subKeyName);
return result;
}
public static string Combine(this RegistryKey registryKey, string subKeyName)
{
string result = registryKey.Name.Combine(subKeyName);
return result;
}
public static string Combine(this RegistryKey registryKey, RegistryKey subRegistryKey)
{
return registryKey.Combine(subRegistryKey.Name);
}
//http://stackoverflow.com/questions/444798/case-insensitive-containsstring/444818#444818
public static bool Contains(this string value, string substring, StringComparison stringComparison = StringComparison.CurrentCulture)
{
int index = value.IndexOf(substring, stringComparison);
bool result = (index >= 0);
return result;
}
}
}
–jeroen
Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Development, PowerShell, Scripting, Software Development, Visual Studio 11, Visual Studio 2010, Visual Studio and tools | 2 Comments »
Posted by jpluimers on 2013/03/04
Question: How do you make Excel print those cell lines?
Thanks seb32:
I’m assuming you want to print the grid…
- File menu,
- Page Setup,
- go to the Sheet tab,
- On that page, under Print, there’s a checkbox called “Gridlines”.
Note: the above is for Excel 2003; Print Gridlines in Excel shows that Excel 2007 and 2010 have slightly different settings.
–jeroen
via:
Posted in Excel, Office, Power User | Leave a Comment »
Posted by jpluimers on 2013/03/03
Brilliant: BladeKey Zip-9 by jamesdavid on Shapeways and one tie-wrap to keep your keys organized:
–jeroen
Posted in LifeHacker, Power User | Leave a Comment »
Posted by jpluimers on 2013/03/02
A few links we should not forget:
–jeroen
Posted in About, Personal, Running, Travel | Leave a Comment »
Posted by jpluimers on 2013/03/01
Briljant: Actuele spoorkaart Nederland:
Kaart en geodata: © OpenStreetMap
Actuele treintijden: NS-Reisinformatie
Visualisatie: M. van der Loos
Alle treinen in Nederland live op een kaart in je web browser.
Er zijn ook anderen die vergelijkbare dingen doen:
–jeroen
Posted in LifeHacker, Power User | Leave a Comment »
Posted by jpluimers on 2013/03/01
A few links I came across recently:
–jeroen
Posted in About, Development, Encoding, EPS/PostScript, Font, internatiolanization (i18n) and localization (l10), Personal, Power User, Programmers Font, Software Development, Unicode | Leave a Comment »
Posted by jpluimers on 2013/02/28
Boy, am I glad with the xkcd: ISO 8601 post and image on the right.
One reason:
Please write dates and times so that everyone understands them, not just you.
The alt-text of the comic is hilarious (ISO 8601 was published on 06 05 88 and most recently amended on 12 01 04) showing the confusion of using 2 digit years not knowing which field means which (I thin XKCD author Randall Munroe and Mathematics of the ISO calendar got some of the dates, see PDF search dates below).
I found out in the mid 1980s that people I was communicating with internationally (back then the internet was forming and you already had BITNET Relay chat and email) were using different date formats than I did.
Ever since that, I’ve used the YYYY-MM-DD format of writing dates, encouraging others to use as well and as soon as I found out that was a standard, started to evangelize ISO 8601 (there is an ISO 8601 category on my blog), which – at the time of writing this – had had revisions in 1998 (on 1998-06-15), 2000 (on 2000-12-15) and 2004 (on 2004-12-01).
A lot later I found out that back in 1971, this date format was a recommendation, and in 1976 already a standard. Not nearly as old as Esperanto though (:
Speaking about languages:
At the end of last century, after Delphi 5 added year 2000 support (which made the 16-bit Delphi 1 disappear from the box as the effort to prove the product including all libraries was year 2000 proof), Delphi went cross platform.
The Delphi team working on both Kylix 1 and Delphi 6, the also added a DateUtils unit which provides a lot of cuntionality, including support for weak numbers. The first test version always assumed week 1 was the one with januari first in it. As ISO 8601 also indicates how the first week of a year should be determined, a couple of people (Jeroen W. Pluimers, Glenn Crouch, Rune Moberg and Ray Lischner) provided code that fixed this and a few other things in the unit. We even got mentioned by Cary Jensen!
That code is now also part of the RemObjects ShineOn library. That DateUtils unit is now on GitHub.
A Delphi XE version of the code (and a Delphi 2007 one) are now at NickDemoCode (Thanks Nick Hodges!).
Delphi is not the only environment having ISO 8601 support. XML has, .NET has, etc: it is now wide spread.
So follow your tools, and start using it yourself as well (:
Too bad the ISO 8601 standard text is not available publicly:
I remember the Y2K preparation era where the ISO-8601 standard was freely available at http://www.iso.ch/markete/8601.pdf, soon after the Year 2000, the PDF got locked behind a payment engine.
ISO suffers from heavy link rot too, for instance the ISO 3166 country codes used to be at http://www.iso.org/iso/prods-services/iso3166ma, but are now at http://www.iso.org/iso/home/standards/country_codes.htm. What about HTTP 303 or 302 redirect here guys?
Luckily people keep cached copies:
–jeroen
via: xkcd: ISO 8601.
Posted in .NET, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Development, ISO 8601, Power User, Prism, Software Development | Tagged: date formats, delphi 1, delphi 5, delphi 6, delphi team, glenn crouch, internet, iso 8601, iso calendar, mid 1980s, ray lischner, software, technology, xkcd | 10 Comments »
Posted by jpluimers on 2013/02/28
Interesting: Command line tool to manage Windows 7 Libraries, with source code – The Old New Thing – Site Home – MSDN Blogs.
Especially as next to some documentation, it points to these two:
–jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Batch-Files, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Scripting, Software Development | Leave a Comment »