Showing posts with label Utility. Show all posts
Showing posts with label Utility. Show all posts

Sunday, February 20, 2011

Mac OSX stacks on Windows 7

A stack is a Dock item that gives you fast access to a folder. When you click a Stack, the files within spring from the Dock in a fan or a grid, depending on the number of items (or the preference you set). Snow Leopard starts you off with three default Stacks: one for Applications, one for downloads, and the other for documents.  

here is a application stack,

image

If you need the same feature in windows 7, there is one free add on called 7Stack. you can get some effect like this

image

Steps, Download the 7Stack

create one stack, basically Chose one folder, and assign the options, then click generate , it will create one shortcut. you can drag and drop the shortcut to the taskbar.

image

Saturday, January 22, 2011

Copy MacBook MAC and Windows Partition from one Disk to another one

I have one 60G SSD HD with the mac OS and bootcamp windows 7 64. at one day, I get  a new 160G SSD, so need to find one way to copy all the bits in MAC and Windows to the new SSD HD.

first, copy the MAC Os from old disk to the new one.  this is much easy compared with the windows partition. Just connect the second HD using the USB adapter, or external HD enclosure. boot the os to mac, and run the Disk Utility. 
    format the New HD to MAC journal format.

restore the existing MAC partition to the new HD.  (drag and drop) That’s it.

image 

For the windows partition, Need back up it to a external HD using the winclone, then restore. 
Download and install the winclone(it’s free.)
image

Click preference, to disable the compressing.
image

Then click Image button to dump the windows partition to a DMG file.
image

It may take a while depending on your IO and CPU.

once done, Boot with the New HD to mac, create a windows partition using the bootcamp assistant.

then run the winclone to restore the windows partition to the new HD partition.
image

after that, done. for the first windows run, It may prompt you to run a diskcheck, you may skip it if you believe your HD is pretty reliable. Now you can boot the MAC/Win with the new HD.

Monday, November 8, 2010

yum updates through Microsoft ISA proxy which needs NTLM authentication /NTLM Authorization Proxy Server HTTP Error 407: Proxy Authentication Required

If you have a Centos VM or any other VM that need access internet to update or download some bits. And the Host machine is behind the ISA proxy which is NTLM authentication enabled.  Here is the basic Idea to make the guest OS can access the internet without having the Authentication problem.

for some security reason, IT admin might disabled the Basic authentication for ISA access. If you use YUM and have to pass the proxy. Yum only support Basic authentication. so there is the problem. if you put one ISA proxy into /etc/yum.conf like proxy=http://youproxyserver:port and run yum update, you will get 407 error which means authentication failed. even you put the username password into the config. (why? proxy server only accept ntlm authentication)

login as: root
root@192.168.209.128's password:
Last login: Fri Nov  5 02:25:34 2010
[root@linuxserver ~]# vi /etc/yum.conf
[root@linuxserver ~]# cls
[root@linuxserver ~]# yum update kernel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos-distro.cavecreek.net
* updates: centos.eecs.wsu.edu
* addons: mirror.nyi.net
* extras: centos.promopeddler.com
http://centos-distro.cavecreek.net/centos/5.5/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )


answer, install one NTLM Authorization Proxy Server on Host or guest OS. (the  APS is python based, run anywhere that has python.) 'NTLM Authorization Proxy Server' (APS) is a proxy software that allows you to authenticate via an MS Proxy Server using the proprietary NTLM protocol. then change the yum.config to use the new proxy server which is anonymous.

more steps,
Download and Install Python
Download and install NTLM Authorization Proxy Server

Change the server.cfg,  here is the key change

PARENT_PROXY:ISA01
PARENT_PROXY_PORT:8080
Accept:text/html, application/xhtml+xml, */*

User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8)
NT_DOMAIN:test.com
USER:useraccount
PASSWORD:password

LM_PART:1
NT_PART:1


NTLM_FLAGS: 07820000

Then startup the proxy utility ntlmaps-0.9.9.0.1\runserver.bat

Now change the yum.conf to the new proxy ISA01, Yum works now.

for Other http client like Wget, you need Export http_proxy=http://yourproxy:port

 

reference,
http://www.centos.org/docs/5/html/yum/sn-yum-proxy-server.html

Wednesday, September 15, 2010

programmatically retrieve SQL Server stored procedure source code, query wheter the code contains some keyword.

Here is a quick script to receptive the SQL Server sp source code, Or query whether it contains some keyword or Not. the keyword could be a table name, snippet. etc.

create table #test1( text varchar(2000))
create table #test2( text varchar(2000))
insert into #test1 select SCHEMA_NAME(schema_id) + '.'+name from sys.procedures

DECLARE db_cursor CURSOR FOR 
select text from #test1
declare @name varchar(3000)
OPEN db_cursor  
FETCH NEXT FROM db_cursor INTO @name  
WHILE @@FETCH_STATUS = 0  
BEGIN  
       insert into #test2   exec sp_HelpText @name
       if exists(select * from #test2 where  text like '%yourkeyword%')
        print 'found,procedure is '  + @name
        FETCH NEXT FROM db_cursor INTO @name  
END  

CLOSE db_cursor  
DEALLOCATE db_cursor
drop table #test1
drop table #test2

If you query all adventoreworks sp for AS keyword. you will get

(11 row(s) affected)
found,procedure is dbo.uspPrintError

(43 row(s) affected)
found,procedure is dbo.uspLogError

(31 row(s) affected)
found,procedure is dbo.uspGetBillOfMaterials

(30 row(s) affected)
found,procedure is dbo.uspGetEmployeeManagers

(30 row(s) affected)
found,procedure is dbo.uspGetManagerEmployees

(31 row(s) affected)
found,procedure is dbo.uspGetWhereUsedProductID

(35 row(s) affected)
found,procedure is HumanResources.uspUpdateEmployeeHireInfo

(24 row(s) affected)
found,procedure is HumanResources.uspUpdateEmployeeLogin

(22 row(s) affected)
found,procedure is HumanResources.uspUpdateEmployeePersonalInfo

Tuesday, August 10, 2010

replace Google Search provider url with HTTPS,SSL

you may have already noticed that Google supports SSL for the search page, SSL is a great protocol which enables the point-to-point transport security, with SSL, Nobody can filter or monitor you searching activity,I think it’s a Pain for the IT security Guy:).  SSl does require more server side capacity to handle the SSL handshake and encryption which is CPU expensive. Google offer those features to end users at Google's cost, what a great company.

Simply replace any url begins with http://www.google.com with https://www.google.com. i.e https://www.google.com/finance.

image

Here I will show to to replace the default Google search provider url with https. Different Browser differs.

For Internet Explorer.
  IE keeps those search provider data in registry.
  here is the key, HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes
  just go the the google provider, replace the url as https://www.google.com/search?q={searchTerms}&sourceid=ie7&rls=com.microsoft:{language}:{referrer:source}&ie={inputEncoding?}&oe={outputEncoding?}
you have to change the default search provider to others in order to apply the change. otherwise IE will override all you settings

image

Firefox
  Firefox store the configuration in a xml file. which is located in C:\Program Files\Mozilla Firefox\searchplugins

rename the google.xml as gogole.xml.bck
create a new xml file named googlehttps.xml
copy the content from google.xml and replace http with https for the search url
like this

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>Google</ShortName>
<Description>Google Search</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image>
<Url type="application/x-suggestions+json" method="GET" template="https://suggestqueries.google.com/complete/search?output=firefox&amp;client=firefox&amp;hl={moz:locale}&amp;q={searchTerms}"/>
<Url type="text/html" method="GET" template="https://www.google.com/search">
  <Param name="q" value="{searchTerms}"/>
  <Param name="ie" value="utf-8"/>
  <Param name="oe" value="utf-8"/>
  <Param name="aq" value="t"/>
  <!-- Dynamic parameters -->
  <Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/>
  <MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/>
</Url>
<SearchForm>https://www.google.com/firefox</SearchForm>
</SearchPlugin>

  


google chrome
the most straightforward one, just click edit serach providers. add a new one and set it as the default one.
image

the url is : https://www.google.com/search?{google:RLZ}{google:acceptedSuggestion}{google:originalQueryForSuggestion}sourceid=chrome&ie={inputEncoding}&q=%s

Free PDF Annotation Tools on Windows

Weird enough, If you want to put some comments or highlight some text using the acrobat pdf reader, you have no access by default. what you have to do is install a PDF Acrobat Professional, and enable the commenting access explicitly. what a Pain? how about those PDFS we just downloaded from internet, we don’t control the file generation process.
So here is the thing, Acrobat Reader does support commenting and highlighting, you can the tools are there.

image

But NO Commenting access for almost every PDF files in the world.
image

After some research, I found the Xchange Viewer, which has the free version and pretty powerful and have all the features to comment and highlight. No need to change the Comment Privilege any more.
Download Here, http://www.tracker-software.com/product/downloads chose the PDF Xchange Viewer.

image

enjoy your reading and commenting now with Xchange PDF viewer. Also it uses the standard PDF api, so when you save the commented PDF, you can open it use the standard acrobat pdf reader. and the comment is there also.
image


more FREE tools for application developers and system administrators.

 
Locations of visitors to this page