TCP/IP and Winsock clean fix for xp,vista,win7+

Edit: March 2016 – Copy&Paste this to a new text-file, rename the extension from txt to cmd, and right click, run as Administrator.

@echo on
::-------------------------------------------------------------------Firewall Reset (firewall works on XP,7,8+, advfirewall work on 7,8+)
netsh firewall reset
netsh advfirewall reset

::-------------------------------------------------------------------Disable Firewall (firewall works on XP,7,8+, advfirewall work on 7,8+)
netsh firewall set opmode mode=DISABLE profile=ALL
netsh advfirewall set allprofiles state off

::-------------------------------------------------------------------delete http cache
netsh nap reset
netsh rpc reset
netsh winhttp reset
netsh http flush
netsh http delete timeout timeouttype=idleconnectiontimeout
netsh http delete timeout timeouttype=headerwaittimeout

::-------------------------------------------------------------------make connection direct
netsh winhttp reset proxy

::-------------------------------------------------------------------disable tracing (default = disabled, ansi, 65535)
netsh winhttp reset tracing

::-------------------------------------------------------------------delete http cache

netsh http delete cache

::-------------------------------------------------------------------BranchCache Optimize WAN traffic (Windows Server 2008 R2 and Windows® 7)
netsh branchcache reset

::-------------------------------------------------------------------Routing Lists Clear
netsh routing reset

::-------------------------------------------------------------------Network-Adapter’s Software Default (Winsock Reset and Rebuild)
netsh winsock reset

::-------------------------------------------------------------------BranchCache is a new feature of Windows Server 2008 R2 and Windows® 7. BranchCache 
netsh interface ipv4 reset
netsh interface ipv6 reset

::-------------------------------------------------------------------Network-Interfaces Reset
netsh interface reset all

netsh interface httpstunnel reset


::-------------------------------------------------------------------Hardcore TCP/IP Reset and Rebuild
netsh int ip reset c:\temp\netsh_ip_reset_log.txt




pause

older versions:

handle windows xp clean fix

@echo off
echo.
echo -Firewall Reset and Turn-Off.————-
echo —————————–
netsh firewall reset
netsh firewall set opmode mode=DISABLE profile=ALL

echo.
echo -Routing Lists Clear.————-
echo ———————
netsh routing reset

echo.
echo -Winsock Reset and Rebuild.————-
echo ———————
netsh winsock reset

echo.
echo -Network-Interfaces Reset.————-
echo ————————–
netsh interface reset all

echo.
echo -Hardcore TCP/IP Reset and Rebuild.————-
echo ———————————–
netsh int ip reset d:\resetlog.txt

echo.
echo -Done.
pause

handle windows 7 clean fix

netsh interface portproxy reset
netsh http delete cache
netsh interface tcp reset

netsh rpc reset
netsh winsock reset
netsh winhttp reset

netsh advfirewall reset
netsh advfirewall set allprofiles state off
netsh branchcache reset

netsh int ip reset c:\resetlog.txt
netsh int ipv4 reset c:\ipv4reset.txt
netsh int ipv6 reset c:\ipv6reset.txt
netsh int httpstunnel reset c:\httpstunnel.txt
netsh int tcp reset c:\tcp.txt

regular expression to extract url parts

/^(https?)://((?:[A-Z0-9]*\.?)*)((?:\/?[A-Z0-9])*)/i

example text:
https://github.com/jonmagic/scriptular
http://scriptular.com
http://www.google.com
http://www.guardian.co.uk

Match Results:
https://github.com/jonmagic/scriptular
http://scriptular.com
http://www.google.com
http://www.guardian.co.uk

Match Groups:
Match 1
https
github.com
/jonmagic/scriptular

Match 2
http
scriptular.com

Match 3
http
www.google.com

Match 4
http
www.guardian.co.uk

solve the background-image isn’t shown in chrome, by using css3’s content

//return a ready to use string of css style, suitable for either firefox or chrome
getPerBrowserStyle: function(sBaseStyle, sBase64Image){

var customStyle = sBaseStyle;

if( this.isChrome() )
customStyle += ‘content:url(‘ + sBase64Image + ‘)’;
else
customStyle += ‘background-image:url(‘ + sBase64Image + ‘);’;

return(customStyle);
},

eclipse x64 faster loading switches

make eclipse to load and preform much faster,

add this after -vmargs in the eclipse.ini
-d64
-Dsun.java2d.opengl=true

it is for x64 available CPU only,

the first on is a very documented switch that helps java see we want to use the x64 properties
and not the x86.
the second one uses an alternative graphics renderer for eclipse, making it use less memory to re-paint, elements in the eclipse window and tabs, maybe it will make eclipse a little uglier :)

Javascript – Get Unique Array with Any Elements Inside

create an array fill with ANYTHING!!!
it can be strings, numbers, DOM Nodes, whatever you’ll like.
this will sort it and kick out the duplicates, and it is done quite efficient.

function getUniqueArray(oldArray) {
        if(!oldArray)
            return( new Array() );

        var resultArr = new Array();
        var oldArrayLength = oldArray.length;
        var bakara = {};

        try{
            for (var i = 0; i < oldArrayLength; ++i)
                oldArray[i] in bakara || (resultArr.push(oldArray[i]), bakara[oldArray[i]] = 1);
        }catch(e){ alert(e + "\n\n" + "getUniqueArray(oldArray):main looop had problems!"); }
        return (resultArr);
}

Winamp segmented fix

here is a fix if you hear the audio interrupted, fitful, discontinuous, scrappy or simply bad,
remove the V
from

[] Enable SHOUTcast
title support

and

[] Include stream
name in title

that is it!

right click winamp, options, preferences,plugins,

double click  “Nullsoft MPEG Audio Decoder”,

“streaming” tab, remove the two ‘V’.

*bonus
increase to 196KB, put streaming prebuffer to 100%, and the one below to about 5%.

 

[kaltura-widget uiconfid=”7034202″ entryid=”1_yyxpq1n1″ width=”400″ height=”360″ addpermission=”” editpermission=”” /]

inject js into page using firefox addon, without security settings blocking it

you should download the js file as test using XMLHTTP request,
and then getting the document object, creating a javascript object,
then appending a text node as the javascript object,
the text-node’s content is the text content you’ve downloaded using the XMLHTTPRequest,
don’t forget to run the JS functions because you can’t access that JS again once you’ve injected it,

so you are creating

here is a more useable example:
i am also storing the content in one of the preferences so I can cross get it when the website is down

try{
/* Mozilla Service: Prepare about:config’s Preference */ //Can use: prefs.setCharPref(“lastJsContent”,”hello1″); //can use: alert( prefs.getCharPref(“lastJsContent”) );
var prefs = Components.classes[“@mozilla.org/preferences-service;1”].getService(Components.interfaces.nsIPrefService);
prefs = prefs.getBranch(“extensions.widgetfinder.”);

/* Mozilla Service: Download the Remote JS TEXT-CONTENT – this is a gentle approach – no JS push */
var req2 = Components.classes[“@mozilla.org/xmlextras/xmlhttprequest;1”].createInstance(Components.interfaces.nsIXMLHttpRequest);
req2.addEventListener(“progress” , function (){}, false);
req2.addEventListener(“error” , function (){}, false);
req2.addEventListener(“load” , function (oEvent){ if(req2.responseText && req2.responseText.length> 10){ prefs.setCharPref(“lastJsContent”, req2.responseText); /*alert(“textscript successfully fetched from remote location and set to local preferece:\n\n” + req2.responseText);*/ } }, false);
req2.open(“GET”, “http:/www.someurl.com/myAddon.js” , true);
req2.send(null);
}catch(e){ alert(e); }

Create Excel’s Spreadsheet Left-To-Right By Default

Hi,
if you’ve got yourself a OS that supports few languages, such as Hebrew/English,
you might want to make sure that Excel will open new spreadsheets Left to Right for English

1. open registry editor and browse HKEY_USERS, find out what is your username UUID, its the long string, copy its textual value (“s-…”).

2. create new file named “excel_rtl.reg”, make sure if you use notepad to surround it with  inverted commas (“).
replace the username UUID below with yours.

3. run the reg file.

Windows Registry Editor Version 5.00

[HKEY_USERS\S-1-5-21-2454573167-78480226-1662416551-1005\Software\Microsoft\Office\12.0\Excel\Options]
"DefaultSheetR2L"=dword:00000000

eclipse – CTRL+TAB to switch opened files

Window – Preferences – General – Keys.

 

Look for “Next Editor” and replace (Binding) the keys to CTRL+TAB.

Look for “Previous Editor” and replace the keys to CTRL+SHIFT+TAB.

 

more natural isn’t?

Prevent Closure Compiler renaming some elements

original:

MyObject.setResponds(wellDocumentedURL.otherElement);

after:

MyObject.b(wellURL.a);

====================

original fixed:

MyObject[“setResponds”](wellDocumentedURL[“otherElement”]);

after:

MyObject.setResponds(wellDocumentedURL.otherElement);