Proxy On-Off Script

Save As VBS file

Set WshShell = WScript.CreateObject("WScript.Shell")

DimSetting = WshShell.RegRead ("HKCUSOFTWAREMicrosoftWindowsCurrentVersionInternet SettingsProxyEnable")

If DimSetting = 1 Then 
'Wscript.Echo "Proxy is Currently Enabled"

returnvalue=MsgBox ("Do you want to DISABLE the Proxy?", 36, "Proxy state is Currently ENABLED")


if returnvalue = 6 then 
' BEGIN CALLOUT A
WshShell.RegWrite "HKCUSoftwareMicrosoftWindows" & _
 "CurrentVersionInternet SettingsProxyEnable", _
 0, "REG_DWORD"
' END CALLOUT A

wShshell.Run "taskkill /im iexplore.exe",0,True
WScript.Sleep 500 'give kill time to take effect

wShshell.Run "iexplore.exe"
End If
WScript.Quit


Else 
'Wscript.Echo "Proxy is Currently Disabled" 
End If


'On Error Resume Next

returnvalue=MsgBox ("Do you want to ENABLE the Proxy?", 36, "Proxy state is Currently DISABLED")

If returnvalue = "" Then
 WScript.Quit
End If

if returnvalue = 6 then 
' BEGIN CALLOUT A
WshShell.RegWrite "HKCUSoftwareMicrosoftWindows" & _
 "CurrentVersionInternet SettingsProxyEnable", _
 1, "REG_DWORD"
WshShell.RegWrite "HKCUSoftwareMicrosoftWindows" & _
 "CurrentVersionInternet SettingsProxyServer","proxy.test.edu:80", "REG_SZ"
WshShell.RegWrite "HKCUSoftwareMicrosoftWindows" & _
 "CurrentVersionInternet SettingsProxyOverride","<local>", "REG_SZ"
' END CALLOUT A


wShshell.Run "taskkill /im iexplore.exe",0,True

WScript.Sleep 500 'give kill time to take effect

wShshell.Run "iexplore.exe"
End If

WScript.Quit
Advertisements

Matlab Noise Implementations

Poisson Noise:

Matlab’s Algorithm:

Adding Poisson Noise into an Image using ‘imnoise’

I = imread('2.jpg');

J = rgb2gray(I);

J = IMNOISE(J,'poisson')

Adding Poisson Noise Manually

I = imread('2.jpg');

a = rgb2gray(I);

a = im2double(a);

sizeA = size(a); % Matrix in MxN form

a = a(:);

b=zeros(size(a));

idx1=find(a<50);

% Matrix Positions whose pixels intensities are less than 50

t=ones(size(idx1));

% Matrix having all ones, the size is equal to idx size

em=-ones(size(idx1));

%Matrix having all -ones, the size is equal to idx size

idx2= (1:length(idx1))';

% Put values in idx2 equal to length of idx1

if (~isempty(idx1)) % if such pixels exists then

g=exp(-a(idx1)); % take Exponential of the values at those pixel

positions

while ~isempty(idx2)

em(idx2)=em(idx2)+1;

t(idx2)=t(idx2).*rand(size(idx2));

idx2 = idx2(t(idx2) > g(idx2));

end

b(idx1)=em;

end

idx1=find(a>=50);

% Cases where pixel intensities are more than 49 units

if (~isempty(idx1))

b(idx1)=round(a(idx1)+sqrt(a(idx1)).*randn(size(idx1)));

end

b = reshape(b,sizeA);

imshow(b)

Salt and pepper noise:

Matlab’s Algorithm:

Adding Salt n Pepper Noise into an Image using ‘imnoise’

I = imread('2.jpg');

J = rgb2gray(I);

K = IMNOISE(J,'salt & pepper',0.05);

figure, imshow(J), figure, imshow(K)

MANUAL Addition OF Salt n Pepper Noise

% p3 = density

I = imread('2.jpg');

J = rgb2gray(I);

p3= 0.05;

x = rand(size(J));

d = find(x < p3/2);

J(d) = 0; % Minimum value

d = find(x >= p3/2 & x < p3);

J(d) = 255; % Maximum (saturated) value

imshow(J)

Gaussian Noise:

Gaussian noise is an idealized form of white noise, which is caused by random

fluctuations in the signal. We can observe white noise by watching a television

which is slightly mistuned to a particular channel. Gaussian noise is white noise

which is normally distributed. The effect can again be demonstrated by the

imnoise function.

Matlab’s Algorithm:

b = a + sqrt(p4)*randn(sizeA) + p3;

ADDING GAUSSIAN NOISE INTO AN IMAGE USING IMNOISE

I = imread('2.jpg');

J = rgb2gray(I);

K = imnoise(J,'gaussian', 0.05);

figure, imshow(J), figure, imshow(K)

MANUAL ADDITION OF GAUSSIAN NOISE

% p3 mean

% p4 variance

I = imread('2.jpg');

J = rgb2gray(I);

p3= 0;

p4 = 0.05;

J = im2double(J);

b = J + sqrt(p4)*randn(size(J)) + p3;

imshow(b)

Speckle Noise:

Matlab’s Algorithm:

MANUAL ADDITION OF SPECKLE NOISE

% p3 = variance

I = imread('2.jpg');

J = rgb2gray(I);

p3= 0.05;

J = im2double(J);

b = J + sqrt(12*p3)*J.*(rand(size(J))-.5);

imshow(b)

ADDING SPECKE NOISE AUTOMATICALLY

I = imread('2.jpg');

J = rgb2gray(I);

K = imnoise(J,'speckle', 0.5);

figure, imshow(J), figure, imshow(K)

Squirrelmail Turkish Support Fix

functions/i18n.php
$languages[‘tr_TR’][‘NAME’] = ‘Turkish’;
$languages[‘tr_TR’][‘CHARSET’] = ‘utf-8’;
$languages[‘tr_TR’][‘LOCALE’] = array(‘tr_TR.utf-8′,’tr_TR.utf-8′,’tr_TR’);
$languages[‘tr’][‘ALIAS’] = ‘tr_TR’;

Download and upload tr_TR localization files to locale folder.

config/config.php
$squirrelmail_default_language = ‘en_US‘;
Change en_US to tr_TR
Change $default_charset = ‘iso-8859-1‘; to 8859-9