I'd like Apache to terminate my perl script after 1 minute if it doesn't complete naturally. Is there a setting in Apache (or other server software) to do this?
Hi
Is it possible to set on a Windows Client or Server that they only communicate with the same specific Active Directory Server? Maybe trough a Registry Hack?
Kind regards
I have the following code which is working fine,
the code creates plugins in reflection via run time:
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Xml.Linq;
using System.Reflection;
using System.Text;
namespace WindowsFormsApplication1
{
public abstract class Plugin
{
public string Type { get; set; }
public string Message { get; set; }
}
public class FilePlugin : Plugin
{
public string Path { get; set; }
}
public class RegsitryPlugin : Plugin
{
public string Key { get; set; }
public string Name { get; set; }
public string Value { get; set; }
}
static class MyProgram
{
[STAThread]
static void Main(string[] args)
{
string xmlstr =@"
<Client>
<Plugin Type=""FilePlugin"">
<Message>i am a file plugin</Message>
<Path>c:\</Path>
</Plugin>
<Plugin Type=""RegsitryPlugin"">
<Message>i am a registry plugin</Message>
<Key>HKLM\Software\Microsoft</Key>
<Name>Version</Name>
<Value>3.5</Value>
</Plugin>
</Client>
";
Assembly asm = Assembly.GetExecutingAssembly();
XDocument xDoc = XDocument.Load(new StringReader(xmlstr));
Plugin[] plugins = xDoc.Descendants("Plugin")
.Select(plugin =>
{
string typeName = plugin.Attribute("Type").Value;
var type = asm.GetTypes().Where(t => t.Name == typeName).First();
Plugin p = Activator.CreateInstance(type) as Plugin;
p.Type = typeName;
foreach (var prop in plugin.Descendants())
{
var pi = type.GetProperty(prop.Name.LocalName);
object newVal = Convert.ChangeType(prop.Value, pi.PropertyType);
pi.SetValue(p, newVal, null);
}
return p;
}).ToArray();
//
//"plugins" ready to use
//
}
}
}
I am trying to modify the code and adding new class named DetailedPlugin so it will be able to read the following xml:
string newXml = @"
<Client>
<Plugin Type=""FilePlugin"">
<Message>i am a file plugin</Message>
<Path>c:\</Path>
<DetailedPlugin Type=""DetailedFilePlugin"">
<Message>I am a detailed file plugin</Message>
</DetailedPlugin>
</Plugin>
<Plugin Type=""RegsitryPlugin"">
<Message>i am a registry plugin</Message>
<Key>HKLM\Software\Microsoft</Key>
<Name>Version</Name>
<Value>3.5</Value>
<DetailedPlugin Type=""DetailedRegsitryPlugin"">
<Message>I am a detailed registry plugin</Message>
</DetailedPlugin>
</Plugin>
</Client>
";
for this i modified my classes to the following:
public abstract class Plugin
{
public string Type { get; set; }
public string Message { get; set; }
public DetailedPlugin DetailedPlugin { get; set; } // new
}
public class FilePlugin : Plugin
{
public string Path { get; set; }
}
public class RegsitryPlugin : Plugin
{
public string Key { get; set; }
public string Name { get; set; }
public string Value { get; set; }
}
// new classes:
public abstract class DetailedPlugin
{
public string Type { get; set; }
public string Message { get; set; }
}
public class DetailedFilePlugin : Plugin
{
public string ExtraField1 { get; set; }
}
public class DetailedRegsitryPlugin : Plugin
{
public string ExtraField2{ get; set; }
}
from here i need some help to accomplish reading the xml and create the plugins with the nested DetailedPlugin
I ran TuneUp Utilities and then my Internet Explorer could no longer run a page with JavaScript.
I think it removes some important registry entries.
I tried to update Internet Explorer, but it didn't help.
What can I do to fix this problem?
Say you have a directory with tens of thousands of messages in it. And you want to separate the spam from the non-spam.
Specifically, you would like to:
Run spamassassin against the directory, tagging each message with an X-Spam-Flag: YES if it thinks it's spam
Have a tcsh shell or perl one-liner grep all mail with the flag and move those mails to /tmp/spam
What command can you run to accomplish this? For example, some pseudocode:
/usr/local/bin/spamassassin -eL ./Maildir/cur/* | grep "X-Spam-Flag: YES" | mv %1 /tmp/spam
The Perl documentation for Sys::Hostname contains:
Attempts several methods of getting the system hostname [...]. It tries the first available of [blah blah] , and the file /com/host. If all that fails it croaks.
What systems is this /com/host used on? It's a very ungooglable filename, and this is the first time I have heard of it.
I downloaded a perl file from some webpage by opening it in my browser and saving it. But the saved file has a file name xxx.pl.txt. How can I save it into a file with pl as its ext?
Also how to change a file's ext?
Can I do these in command line?
Thanks and regards!
I am trying to keep the icons size and position to the place where I've shutdown my computer.
That is:
Keep desktop icons to the right and at a small size.
When I restart my computer, the get a medium size and are all aligned to the left.
Note:
Align icons on grid UNCHECKED
Auto arrange icons UNCHECKED
When I create a new account I dont have this problem
Cleared registry with CCleaner
Uninstalled all Intel Graphics Accelerator
Windows updated
I use only 1 monitor
At work, I can remotely administer other computers by first adding my domain account as a local admistrator on another computer. After that, I can use remote registry, computer management, and file sharing (\\computer\c$).
How can I setup a remote user to be a local administrator on a simple home network without a domain (just a workgroup)?
My Windows Vista Desktop icon are all gone and I cant set them again! Is there any registry key to show them back? I used regsvr32 /u shell32.dll command but still nothing shows? what should I do?
Often I have came across URLS like the following:
http://www.isthisahacker.com/{7B643FB915-845C-4A76-A071-677D62157FE07D}.htm
Do the curly braces in the URL above indicate some kind of attempt to access the registry, or is that a legitimate URL? It looks kind of suspicious to me.
more file
param1=" 1,deerfntjefnerjfntrjgntrjnvgrvgrtbvggfrjbntr*rfr4fv*frfftrjgtrignmtignmtyightygjn 2,3,4,5,6,7,8,
rfcmckmfdkckemdio8u548384omxc,mor0ckofcmineucfhcbdjcnedjcnywedpeodl40fcrcmkedmrikmckffmcrffmrfrifmtrifmrifvysdfn"
need to match the content of $param1 in the file
but its not work for example
sed -n "/$param1/p" file
or any grep $param1 file etc...
any other solutions? maybe with perl?
Have a maildir with tens of thousands of messages in it, about 70% of which are spam.
Would like to:
Run /usr/local/bin/spamassassin against it, tagging each message if the score is 10 or greater
Have a tcsh shell or perl one-liner grep all mails with a spam score of over 10 and move those mails to /tmp/spam
What commands can I run to accomplish this? Pseudocode:
/usr/local/bin/spamassassin ./Maildir/cur/* -tagscore10
grep "X-Spam-Score: [10-100]" ./Maildir/cur/* | mv %1 /tmp/spam
Basically the comp in question is taking ages to log out - but only from the main account. I tried creating another account on the system and it only took seconds to log out. However, there seems to be no specific reason for this. Could it be that the registry is fragmented or something? How would I test what the problem is?
I always hibernate my work (Windows 7, x64) laptop when leaving for the night. Sometimes when I come in again in the morning, the laptop is powered up and there's a message telling me that new updates have been installed. (I've changed the registry so automatic updates don't force a reboot.)
I'm happy to have Windows apply updates automatically, but I don't want it to resume from hibernation to do so. How can I stop this behaviour so I'm not wasting electricity?
Ok, so you hover over the items pinned to the Win 7 menu, and wait all month for it to pop out the sub menu containing recent items opened with the selected app.
Is there a registry hack to speed this up? I want the sub menus quicker.
Same applies to the delay before things Control Panel and Administrative Tools pop out their sub menus too.
It just takes too long, so how to reduce that delay?
I get the following error when I try to install some application on my windows 7 64 bit system.
How do I turn this off as I know that the applications that I'm installing are trusted.
I have turned off windows defender and tried to tweak internet explorer security settings according to the first few google results but yet I have the same error. (I also created a new user account and tried importing new registry keys but nothing even then)
How can I solve this?
Internet Explorer 7 uses a rather crude method to resize images by default. There's a CSS tag img { -ms-interpolation-mode: bicubic; } to get better results, but I'm unable to change the source of the page. IE8 uses the better method as the default, but this is a corporate environment that is unable to upgrade at this moment.
Is there anything in the options or a registry hack to change the default resizing mode in IE7?
On my server with Windows 2003 Server after a fault in the RAM, I can ping to all IPs but I cannot see it at My Network Places. Could you help me if there is any Windows components to be reinstalled, or any registry entries to be redefined. Or is there any other solution?
Thanks
I want to write a perl script which logs into cisco switches via telnet and parses the output of show mac-address-table. The problem is that different switches show me a different field layout.
The WS-C3548-XL shows the fields in the order
Destination Address Address Type VLAN Destination Port
while the C2960 shows it like
Vlan Mac Address Type Ports
is there a way to tell show to print the fields in a predefined order?
So I am in a situation where my wallpaper is locked to a specific image on my work computer via group policy. I can't change it via the Personalization settings since it is grayed out and says it has been set by the system administrator.
Anyone know some local GPO and/or registry hackery I can do to override the domain's policy? I could probably get away with logging in under a local account for this, but I want that to be a last resort.
Thanks in advance.
I'm trying to setup androidicon.py file after I downloaded it from internet, but I can not find the menu item Android Icon batch mode and Android Icon even though I reboot it.
What I did as follows:
Download it from http://registry.gimp.org/node/25274
Control+click on androidicon.py.txt link and save it as file "androidicon.py".
Copy it to plug-in folder
Reboot GIMP
Confirm the menu "Android Icon batch mode" and "Android Icon" wasn't shown.
Could you tell me how to fix this?
When using Windows 7N and embedded videos for YouTube and the like my users have been getting a black box. I tracked this down to when HTML5 is being used for rendering. Other than putting a bunch of sites in compatibility mode or installing the Windows Media Pack (which resolves this issue) is there another route I can take?
My guess is it's only a single registry key or DLL that says 'I'm not HTML5 compatible' but I don't have any idea how to find it.
I get the following error when I try to install some application on my windows 7 64 bit system.
How do I turn this off as I know that the applications that I'm installing are trusted.
I have turned off windows defender and tried to tweak internet explorer security settings according to the first few google results but yet I have the same error. (I also created a new user account and tried importing new registry keys but nothing even then)
How can I solve this?
I uninstalled MySQL 5.1 from Vista as I lost the username/password, however I forgot to stop the MySQL service before doing so. Now whenever I try to reinstall it I get to the final configuration screen which then fails with the message "Cannot create Windows Service for MySQL Error:0".
I've uninstalled MySQL and removed all related files/folders/registry entries but still no joy...
Does anyone know a way to resolve this as I can't seem to find a fix online anywhere!