Archive for the ‘Computers’ Category

Try saying that 5 times quickly.

#!/usr/bin/perl -T
# RFC 1035 3.3.13
# http://www.faqs.org/rfcs/rfc1035.html
# The rname of a DNS SOA response gives "domain-name which specifies \
#       the mailbox of the person responsible for this zone"

use strict;
use warnings;
#use Email::Valid; if you wish

# example - "noc.example.com" is "noc@example.com"
# replace first non-escaped period with an @ symbol
&mailstrip("noc.example.com");

# and remove escapes
#&mailstrip('some\.user.example.com');

sub mailstrip {
 my $emailaddress = shift;

 # replace first non-escaped period with an @ symbol
 # my $brain->hurts();
 $emailaddress =~ s/(?<!\\)(?=\.)/\@/;
 $emailaddress =~ s/\@\./\@/;
 $emailaddress =~ s/\\(.)/$1/g;

 print "$emailaddress\n";
}

Quick note: if you want a Postfix->HylaFAX email-to-fax gateway with an incoming format like aaabbbcccc@<hostname>, use regexes to allow the recipient, and also to route to a different transport.

main.cf:
local_recipient_maps = proxy:unix:passwd.byname $alias_maps $fax_recipients
fax_recipients = regexp:/etc/postfix/fax_recipients
fax_destination_recipient_limit = 1

fax_recipients:
/[0-9]{10}@.*/  OK

transport.regex:
/[0-9]{10}@.*/  fax:localhost

master.cf:
fax     unix    -       n       n       -       1       pipe
    flags= user=uucp argv=/usr/bin/faxmail -d -n ${user}
main.cf:
local_recipient_maps = proxy:unix:passwd.byname $alias_maps $fax_recipients
fax_recipients = regexp:/etc/postfix/fax_recipients
fax_destination_recipient_limit = 1

fax_recipients:
/[0-9]{10}@.*/  OK

transport.regex:
/[0-9]{10}@.*/  fax:localhost

master.cf:
fax     unix    -       n       n       -       1       pipe
flags= user=uucp argv=/usr/bin/faxmail -d -n ${user}

See Perl::Critic.

SAP actually has good facilities for lint’ing your ABAP code, built-in.  From the code editor (say by starting SE38), choose Program -> Check -> Extended Check.  Couldn’t be much easier.  To get a more thorough review, use Code Inspector to also pinpoint data access problems, like SQL queries where a WHERE term isn’t indexed, and the like.

SAP lint

SAP extended program check

SAP extended code check

Problem

Windows 2003 terminal servers wouldn’t allow audio redirection over RDP.

Client: Windows XP SP3 w/ RDP 6.1 client (6.0.6001).

Servers:  Windows 2003 Standard R2 (32-bit) , SP2, all current patches.

Servers are in “Terminal Services” OU that sets group policy “Allow audio redirection = Enabled.”  Viewing in RSOP MMC confirms that the setting is applied.

gpresult /v:

GPO: Terminal Server Test
KeyName:     SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\fDisableCam
Value:       0, 0, 0, 0
State:       Enabled

HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\fDisableCam == 0

Connect via RDP.  Open Control Panel -> Sounds and Audio Devices.  Uncheck “Mute” and click “Apply.”  “Mute” is checked again.

Clicking “Advanced” under “Speaker Settings” results in error “DirectSound settings not available.”

Similar

http://social.technet.microsoft.com/Forums/en-US/winserverTS/thread/42930f70-a68a-4397-8c61-7d2017a4988b/

http://www.virtualpcfaq.com/Virtual_Server_2005/rn-738-15532_DirectSound_settings_not_available.aspx

Solution

RDPCLIP.EXE wasn’t running.

It's always a checkbox....

I didn’t realize that rdpclip.exe was needed for audio redirection and must have unloaded it when trimming startup programs to lower cpu/memory.  I had already disabled clipboard redirection to speed things up, so I figured there was no need to run rdpclip.exe, which, as the name implies, was originally a Windows 2000 resource kit utility to allow copying and pasting files between client and server.  My kingdom for an architecture diagram….

The cheap way to automate Fortinet firewall backups is:

  1. Enable SSH on the firewall.
  2. Enable SCP (System -> Admin -> Settings -> Enable SCP)
  3. Create a ‘backup’ admin user with read_only profile.
  4. Run a script to scp the configs.

Uses Net::SCP::Expect

#!/usr/bin/perl -w

use warnings;
use Net::SCP::Expect;

@firewallips = ('192.168.1.1',
 '192.168.2.1',
 '192.168.3.1',
 '192.168.4.1',
 '192.168.5.1',
 '192.168.6.1'
);

foreach $ip (@firewallips) {
 print "$ip\n";

 my $scpe = Net::SCP::Expect->new(auto_yes=>1);
 $scpe->login('backup', 'SUPERSECRET');
 $scpe->scp("$ip:sys_config","/home/fortinetbackups/fortinet-$ip\.conf");

}

Or you could do it this way.

Debian’ Lintian automatically checks for rule violations (e.g., “‘bashism’” in /bin/sh”).  Nice.

Here’s a Get Rich Slowly blog entry recommending Hulu and kin, including a link to an extensive list of online video content source (bookmark that one).  Don’t forget your local library as a source of DVD’s — you helped pay for ‘em.

When using bginfo, have ReconnAct run this on every login and reconnect:

bginfo.exe terminals.bgi /timer:0 /NOLICPROMPT
Where the terminals.bgi includes:

<Full Name> = WMI query:
SELECT FullName FROM Win32_NetworkLoginProfile WHERE FullName is not NULL

login:<User Name>
server:<Host Name>
Default Printer:

<Default Printer> = WMI query:
SELECT Caption FROM Win32_Printer where Default = True

Please call the IT Department
if you need assistance.

Tabbloid (free service from HP) has very nice output and is simple to use.

Go to http://www.tabbloid.com/

Add your feed links, and enter your delivery options, including your email address. When your first issue is sent, there’ll be a link in the email for you to edit your settings.

ReconnAct has been updated, and now “adds support for all Windows client and server operating systems from Windows XP/2003 and up.”  ReconnAct allows you to script events on remote desktop logon, disconnect, and reconnect, which is handy for things like remapping printers when a user reconnects to a session from a different location.

I’m not sure why, but Eventum doesn’t get much word of mouth.  Eventum was developed by and is used by MySQL [now part of Sun] for their helpdesk needs.  It’s simple to install, even if you need to patch it to use LDAP authentication.  I have no gripes with it.

The Problem

Multimedia performance over RDP on WAN links is suboptimal.  Users will complain of the painfully slow rendering of Flash-enabled websites.  Internet Explorer will block, so that you can’t scroll the browser window while Flash images are being rendered.

If you’re the Fed and can print your own money, Citrix’s Speedscreen Multimedia Acceleration can help.

Provision Networks, owned by Quest, has an RDP optimization pack forthcoming.

Microsoft acquired Calista Technologies in January ‘08.  Calista’s technology looks impressive and should dramatically improve multimedia performance.  With Virtualization all the rage these days, if you can’t display a training video or browse websites, it’s pretty useless, whether you’re using Terminal Services or just XP/Vista via VDI.  I myself prefer Terminal Services with Softgrid/App-V, which abstracts everything.

Citrix and Provision Networks price their products like this is 1998, instead of 2008 — they’re priced way out of their range.

Having the Calista technology delivered by Microsoft is what’s preferred, but there are no public details or roadmap.

Cheap Solution

So, the cheap, sure-fire way to improve browser performance for Flash-enabled websites is [as many individual web browsers have done]: just block Flash.  It’s all crap anyway.  Annoying.  Zero-content.  Distracting.  Even if they’re on business-related websites, they’re mostly useless.

Set your browsers to use a Squid cache, as a general rule.

Then use AdZapper with Squid, to block egregious ads, including Flash.  When a .swf file matches a given regex, a blank .swf is substituted for it, showing just a white box.  AdZapper is ridiculously easy to install, being a Perl script with a few content items (fake images, Flash, mp3).

Then, if you’re using Internet Explorer, load IE7Pro to block the remainders and let the user selectively enable them.  Firefox users can use FlashBlock.

This solution is quick and cheap.

I saw in Popular Science today that someone (Logitech or Kensington?) has a wireless keyboard with a battery life of three years.  Pretty good.  And then I thought, why not just use the energy of the person pressing the keys — I’d think there’s enough force applied that it could keep a battery charged for the short bursts of transmissions.  Too, why not set a mouse on rollers and use the energy of moving the mouse around?  Looks like someone already thought of the mouse.

Choco 2.0 is out.   Open-source constraint satisfaction, written in Java, and business-friendly BSD-licensed.

It’s the Holy Grail of computing.

   MsRdpClient.AdvancedSettings2.BitmapCacheSize    = 48000
   MsRdpClient.AdvancedSettings2.BitmapVirtualCacheSize = 48

Might as well use the cache — that’s what it’s there for.  Like Vista’s Superfetch, or XP’s prefetch, or precompiling JSPs, or what have you.

For example, to load up your squid http proxy cache, just run:

 wget -r -nd -H –delete-after http://your.portal.company.local/

or

 wget -r -nd -H –delete-after -i some_file_with_URLs.html

wget’s –no-cache will force the proxy to download fresh copies, too.  Try loading popular pages.

The Tuck School of Business at Dartmouth’s Spreadsheet Engineering Research Project publishes some interesting research on errors in spreadsheets, including causes and financial impact (“Among the remaining 70 confirmed errors, the largest error was $100 million; however, 9 of the 25 spreadsheets tested had no errors at all.”).  Collection of stories.

Do you have old print drivers hanging around?

Use the Print Migrator utility to back up your printer config:

printmig -b "server_name.cab"

And then remove the unused print drivers:


cd /d %systemroot%\system32

cscript prndrvr.vbs -x