Strict Standards: Redefining already defined constructor for class wpdb in /var/www/myfoto.se/jbits.se/blog/wp-includes/wp-db.php on line 56

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-includes/cache.php on line 36

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /var/www/myfoto.se/jbits.se/blog/wp-includes/cache.php on line 384

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 560

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 684

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/code-highlighter/codehighlighter.php on line 42

Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-includes/formatting.php on line 82
jbits.se <br /> <b>Deprecated</b>: preg_replace() [<a href='http://php.net/manual/en/function.preg-replace'>function.preg-replace</a>]: The /e modifier is deprecated, use preg_replace_callback instead in <b>/var/www/myfoto.se/jbits.se/blog/wp-includes/formatting.php</b> on line <b>82</b><br /> » Uncategorized

jbits.se

Jörgen Björkmans blog

Archive for the ‘
Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-includes/formatting.php on line 82
Uncategorized’ Category

Feb
27

Posted by jbjorkman on February 27, 2011 under Uncategorized

Powershell packet capture script written by Robbie Foust.

http://blog.robbiefoust.com/?p=68

Feb
24

Type performance counters to console using typeperf

Posted by jbjorkman on February 24, 2011 under Uncategorized

Typeperf is a command to echo performance counter data out to console (can also output to file or sql)

typeperf "\Processor(_Total)\% Processor Time" -si 0:0:5 -sc 5

Feb
23

Disable IIS Socketpooling

Posted by jbjorkman on February 23, 2011 under Uncategorized, Windows

By default, IIS will bind a certain port to all IPs sharing NIC.
To disable this behaviour you need to disable socket pooling.
You do this providing a list of ip:port pairs to listen to, with socket pooling enabled the list is usually empty

For IIS6 you can use httpcfg.exe from support tools.
httpcfg.exe set iplisten -i 0.0.0.0:80
httpcfg.exe set iplisten -i 10.0.0.1:443

For IIS7 you use netsh
netsh http add iplisten ipaddress=0.0.0.0:80
netsh http add iplisten ipaddress=10.0.0.1:443

http://support.microsoft.com/kb/238131

Jan
18

Capture CDP packets with tcpdump

Posted by jbjorkman on January 18, 2011 under Uncategorized

tcpdump -nn -v -s 1500 -c 1 ether[20:2] == 0x2000

Nov
07

Speaking in powershell

Posted by jbjorkman on November 7, 2010 under Uncategorized

  (new-object -com SAPI.SpVoice).Speak("Test Message",1)

Jun
14

Capturing packets using netsh

Posted by jbjorkman on June 14, 2010 under Uncategorized

Start capture:
netsh trace start capture=yes ipv4.address=1.2.3.4

End capture:
netsh  trace stop

Examine the tracefile using MS Network Monitor

Ref:

Start Starts a trace session

Stop Stops a trace session

Capture=yes Turns on raw network capture from NDIS

Provider=ProviderName Enables tracing for a specific provider

Show Providers Shows a list of providers

Scenario=ScenarioName Enables tracing for a specific scenario

Show Scenarios Shows a list of scenarios

Jun
08

VMWare cold conversion bootable CD

Posted by jbjorkman on June 8, 2010 under Uncategorized

Sometimes doing a hot conversion might be troublesome, in those cases it might be good to know you still have the option to do a cold conversion.
Get the bootable cd for it at http://www.vmware.com/download/download.do?downloadGroup=VC250U4

May
25

Excel, convert ip to dec without vba

Posted by jbjorkman on May 25, 2010 under Uncategorized

A quick way to convert an ip to a decimal value (useful for sorting) without using vba is to define a new name and set its reference to:
=EVALUATE(CONCATENATE("(((";SUBSTITUTE(Sheet1!A1;".";")*256+")))
Replace the cell reference with yours

May
21

Office 2010 Command locator

Posted by jbjorkman on May 21, 2010 under Uncategorized

http://office2010.microsoft.com/en-us/word-help/learn-where-menu-and-toolbar-commands-are-in-office-2010-HA101794130.aspx

Apr
28

Windows - Remove nonpresent devices

Posted by jbjorkman on April 28, 2010 under Uncategorized

)Open a command window and type:

set devmgr_show_nonpresent_devices=1

start devmgmt.msc

When the Device Manager is displayed, click View > Show Hidden Devices.
Locate any devices which are no longer present on the system (these are usually faded in appearance).
Right-click on non-present devices and select Uninstall.

Alternatively, you can set the following regkey for permanent display of nonpresent devices:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\DEVMGR_SHOW_NONPRESENT_DEVICES=1 (REG_SZ)

Apr
01

Quoted printable Swedish Characters

Posted by jbjorkman on April 1, 2010 under Uncategorized

å E5 =?iso-8859-1?Q?=E5?=
ä E4 =?iso-8859-1?Q?=E4?=
ö F6 =?iso-8859-1?Q?=F6?=
Å C5 =?iso-8859-1?Q?=C5?=
Ä C4 =?iso-8859-1?Q?=C4?=
Ö D6 =?iso-8859-1?Q?=D6?=

Nov
01

SQl Server - Show active users / databases

Posted by jbjorkman on November 1, 2009 under Uncategorized

To list active users and databases on your MS SQL Server you can use something like this:

 select DB_NAME(dbid) as DB, loginame, hostname, login_time, status, program_name, cmd, hostprocess, net_address from master.dbo.sysprocesses order by DB,loginame

Jun
11

Install telnet on Vista/Windows 7 using Windows Package Manager

Posted by jbjorkman on June 11, 2009 under Uncategorized

Simply run the following command to install the telnet client: pkgmgr /iu:"TelnetClient"

To later uninstall it run:  pkgmgr /uu:"TelnetClient"

Full list of Windows Package Manager (pkgmgr.exe) command line switches:
/?, /h, /help - Displays help.
/ip - Install package
/up - Uninstall package
/up:[{package name1}[;...]] - Uninstall package(s)
/iu:{update name1}[;...] - Install update(s) specified by name
/uu:{update name1}[;...] - Uninstall update(s) specified by name
/m:"{package directory}" - Specifies the location of the package
/p:"{package name}" - Specifies the identity of the package
/o:"[{boot drive path};]{offline Windows directory path}" - Specifies operation against an offline Windows image
/n:{unattend file} - Specifies unattended operation parameters
/s:{sandbox directory} - Specifies directory to extract files to
/quiet - Runs pkgmgr.exe without UI. If restart is required it will be performed without a prompt
/norestart - Suppress restart (when restart is necessary)
/l:{log file} - Specifies a file for diagnostic output

Sep
08

GrepNoRep

Posted by jbjorkman on September 8, 2008 under Uncategorized

@echo off
setlocal
:loop
ping %1 -n 1 | find "Rep" > NUL
if errorlevel 1 echo %date% %time% No reply from %1
goto loop