Showing posts with label hack. Show all posts
Showing posts with label hack. Show all posts

Sunday, July 23, 2023

Restoring Images Exif Data after upload to Google Photos

 Recently my Google free storage of 15GB is getting full so wished to get the photos back to my local system. Yes we can quickly download it but found that Google has wiped off of the Exif data, specially the dates.


So to restore it, luckily it still retained the file names like : IMG_20230508_110348.jpg

So quickly created the below script and it worked :)


SETLOCAL ENABLEDELAYEDEXPANSION

for %%c in (*.jpg) do ( 

set a=%%~nc

set x=!a:~4,15!

set y=!x:~0,4!:!x:~4,2!:!x:~6,2! !x:~9,2!:!x:~11,2!:!x:~13,2!

echo !y!

"<exiv2_location>\exiv2" -k -M"set Exif.Image.DateTime Ascii !y!" %%c

)


Also it need a PowerShell script to update the created Date and Modified date:


$modifyfiles = Get-ChildItem -force *.jpg| Where-Object {! $_.PSIsContainer}

foreach($object in $modifyfiles)

{

$object.CreationTime=[datetime]::ParseExact($object.BaseName.Substring(4),"yyyyMMdd_HHmmss",$null)

$object.LastWritetime=[datetime]::ParseExact($object.BaseName.Substring(4),"yyyyMMdd_HHmmss",$null)

}

Saturday, June 6, 2020

How to Set Up a WRT54G as a Repeater

I have been using Linksys WRT54G for over 15 years now and it has been an excellent router.

Over time the broadband speeds have increased and my current broadband plan supports 200 Mbps. My router has an official peak speed of 54 Mbps but practically even if I sit next to it, I get around 20 Mbps which falls to less than 10Mbps in the next room and by the time I reach my 3rd bedroom, the signal is almost gone. So I felt, I am losing out on the speed I am paying for.

Another issue was the increase of device counts connecting to the router. Earlier it used to be just my laptop. Now we have 3 laptops, 2 smart phones, 1 Smart TV and the count will simply increase in future. In here my router was unable to cope up with. So if my child is watching YouTube on TV in FullHD , (in lock down due to Corona), my Skype and Team calls get impacted although I have enough bandwidth to support all in parallel.

So it was time for an upgrade. Did my research and finally concluded on TP-Link Archer C60 AC1350 primarily due to:

  1. Wanted a dual band router as it can support up to 867 Mbps @ 5 GHz. I don't think I will cross that speed in next 3-4 years
  2. It support MU-MIMO which will help support multiple devices in parallel
  3. Has 5 Antennas
  4. Cost was Rs 2200 on Amazon which was like 300 more than next model but had more features.
With the new router coming in, I did not want to throw my old router as the new one still did not reach my 3rd bedroom well. So started looking up on Google to convert my Linksys WRT54G in to a repeated. And yes it was possible.

The 2 reference links are :
Although the links are pretty accurate, there are some misses in there which I believe is more like article was written in the past and things have changed.

To flash the router and install DD-WRT on it

  1. DO the hard reset exactly as its said i.e. 30-30-30. Actually I did like 60-60-60 to be safe and all went fine.
  2. The GV5Flash.zip download is missing vximgtoolgui executable although the folder name is the same. The executable inside the folder is wrt_vx_imgtool which is like command line version of the tool . To get the GUI, use this url : http://web.archive.org/web/20060708130642/http://www.bitsum.com/files/vximgtoolgui.zip
Configure the  repeater

  1. In here skip the 'Reset Router' and 'Update Firmware' sections
  2. Start from 'Set Static IP Address'
  3. if you favour command line, you can use
    netsh interface ip set address name="Ethernet" static 192.168.1.9 255.255.255.0 192.168.1.1
    netsh interface ip set address name="Ethernet" dhcp
  4. Change Router Settings : Step 7 - You can put a better SSID than 'bridge' like _rpt or _ext
  5. An important step missed in here is to secure the repeater itself. To do so, go to Wireless :: Wireless Security Tab :: Virtual Interfaces section. In there you can set security mode for the repeater like WPA2 Personal and the key.

Now a bigger issue is once you have setup the repeater, there is no way you can access it over WiFi as its a plain proxy. If you try http://192.168.0.1/ , you will end up with the primary router. and there is no http://192.168.1.1/. So to access it back again, 
  1. you will need to setup you local laptop with static IP :
    netsh interface ip set address name="Ethernet" 
  2. Connect your laptop to the repeater using the Ethernet cable
  3. Now try http://192.168.1.2/ as the repeaters own address is 1.2 with 1.1. being the gateway (as configured in Step 3 of 'Change Router Settings'

So all good, I ended up with 3 SSIDs:
  1. Primary 2.4 GHz
  2. Primary 5 GHz
  3. Repeater 2.4 GHz
and yes my whole house is now covered :)

Saturday, August 27, 2016

Rename images in batch using Irfanview

Earlier I used Exiv2 scripts to rename images.
Now Irfanview allows the same using GUI. The name pattern to be used is :
$E36868(%Y%m%d_%H%M%S)

Use the following powershell script to rename extension:
Get-ChildItem *.HEIC | Rename-Item -NewName { $_.name -Replace '\.HEIC$','.jpg' }

Tuesday, February 16, 2016

Rename Image File Name to Date-Time format

Earlier I had tried the command line tool like exiv2 to rename image file name. I had put down the steps to do so in this blog itself at Picasa: Renaming File Names to Picasa Captions.
Now I see a nice option in IrfanView to do so easily using GUI.
In Irfanview:
  1. Press B or File -> Batch Conversion/Rename
  2. On the top left menu, under Work As, select Batch Rename 
  3. In the name pattern textbox, put in $T(%Y%m%d_%H%M%S) to get image names in standard format of YYYYMMDD_HHMMSS. You can try other formats as well.
  4. Select files to be renamed and do Start Batch

Irfanview Batch Rename






































And its done :)

Tuesday, October 7, 2014

Outlook Conversation Cleanup

Earlier there used to be a tool which will retain only the last thread of the email chain hence saving disk space for MS Outlook.
Just got to know that this feature is now available natively in Outlook. Just go through : https://support.office.com/en-US/Article/Use-Conversation-Clean-Up-to-eliminate-redundant-messages-4a0aa10b-8342-4f75-b78c-2b8ca23eca8d

Wednesday, September 24, 2014

Commandline to change firewal rules in Windows 7/8

I was looking for a commandline based approach to add new rules on Windows Firewall and it was simple to do:

  • First check if there are already some rules set:
    netsh advfirewall firewall show rule name=**App**
  • Then you add a separate rule for allowing input traffic (as required)
    netsh advfirewall firewall add rule name=**App** dir=in action=allow profile=public program=**App_Location** enable=yes
  • And a separate rule for allowing output traffic (as required)
    netsh advfirewall firewall add rule name=**App** dir=out action=allow profile=public program=**App_Location** enable=yes
  • Finally if required, the rule can be deleted
    netsh advfirewall firewall delete rule name=**App**

Monday, February 25, 2013

Windows 7 : Windows event log error 4201

Today morning, I faced a new problem. When I tried to connect to my VPN, I got the following error:

"Could not start the Remote Access Connection Manager service on local computer. Error 1068. The dependency service or group failed to start."

That is simple. So I went to the Remote Access Connection Manager Service and found 2 dependencies : Telephony and SSL. Started both of them and tried to start the service again: Same Error !!

Hmm.. thats a problem. To know more details, I looked in to the Eventlog and now that too gave an error :

 The service has not started and when I tried to start the service I got the error :  Cannot start windows event log service on Windows 7. Error 4201.

Now that's a bigger problem. Something has gone real bad with my laptop. All the solutions pointed to deleting the "C:\Windows\System32\LogFiles\WMI\RtBackup" directory and to do so I need to go to Safe Mode. Now my company's laptop does not allow you to go to Safe Mode without a password. So what to do.


  1. Make a copy of the folder RtBackup - just to be safe.
  2. Take the ownership of the folder - From System to Yourself and reboot your computer
  3. Now that you are owner - you can delete the folder :)
  4. And yes post restart everything was back to normal.

Sunday, February 10, 2013

How to download videos in Opera

I have used Opera as my favorite browser for last 10 -12 years now (since its 6th version). I had always liked it for its tab support, being light weight and also being available in Linux (a browser with better fonts for those days). Internet Explorer was slow and Firefox in its earlier versions was good but got quickly gloated with extensions and addons. Chrome is way to heavy.

So the good and bad thing in Opera is that it does not have too many addons. Without them the browser was solid and light weight. Without them, its features were limited so was good for browsing but lacked some features readily available on others. One of the features was to download flash streaming videos. Firefox and Chrome, both have good extensions to support it. Opera did not have it readymade and and all its supposed extensions were links to some video donwloader site which I don't prefer So how to do it.

Yes there's a way. Opera is known for its excellent cache and I tried to use it. Lets take the example of dailymotion from which say I want to download a video. So here are the steps:
  1. First clear the cache (Setting :: Delete Private Data)  - It will help us clear the old data and knowing new URLs will be easy. Later you will almost remember them.
    Before I move ahead, let me explain how things are working for video sites. First say a site like www.dailymotion.com will use another site (CDN) to deliver it content. For dailymotion its dmcdn.net similarly for youtube its ytimg.com. Also now the whole video is not delivered as one big file to the client browser. Its broken in to fragments. So now if you pause a video, you can see the download stop after some time i.e. after the fragment ends. This was always the case with dailymotion. With youtube, the download did not stop earlier but now even they too have implemented it. Its more like dowload on demand. So when the player reaches the end of fragment one, it starts downloading the fragment two. So here we go.
  2. After the cache is cleared, type in "opera:cache" in your browser location bar. It should show the cache as empty.
  3. Open dailymotion.com and search for say "gangnam style"
  4. Don't open the video. In the "opera:cache" tab now you will see URL's being cached
  5. Now play the video and pause it after 10 seconds. Refresh the cache now. Select the 4 checkboxes for video and then click the Preview link next to dmcdn.net. It will open a new tab:
  6.  Play the video for another 30 seconds and refresh the Cached Video list for dmcdn.net. You will find more items getting listed there.
  7.  Now have a close look at the URLs. They look like:
    1. http://vid2.ak.dmcdn.net/sec(6f246bdc0f86287961fdadfc57ab38e2)/frag(1)/video/623/746/50647326_mp4_h264_aac.flv
    2. http://vid2.ak.dmcdn.net/sec(6f246bdc0f86287961fdadfc57ab38e2)/frag(6)/video/623/746/50647326_mp4_h264_aac.flv
    3. http://vid2.ak.dmcdn.net/sec(6f246bdc0f86287961fdadfc57ab38e2)/frag(4)/video/623/746/50647326_mp4_h264_aac.flv
  8.  From inspection, you can see that that the whole URL is same except for the frag(N) part.
  9.  So we now we have the URL of the whole video if we just remove the frag part. In the above case, it is : http://vid2.ak.dmcdn.net/sec(6f246bdc0f86287961fdadfc57ab38e2)/video/623/746/50647326_mp4_h264_aac.flv
  10. Open this link in a new tab and you can now save the video in you local disk.
Enjoy downloading videos. 

Hint: You can do the same in firefox using "about:cache" but with addons who will do all this :)

Friday, January 25, 2013

Microsoft Office 2010 icons missing in Windows 7

Since yesterday, I found the icons of Office 2010 files like Excel, Word, PPT's got replaced by the generic file icons.

I looked throughout the web for a solution but nothing worked. The primary solutions put forward were:
  1. Delete the IconCache.db file in %userprofile%\AppData\Local
  2. Create a registry key "Max Cached Icons" in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer and set it to 4096 (4MB) or 8192 (8MB)
Folks talked about fixing the "C:\Windows\Installer\" but the solution was not complete. So the steps are:
  1. Open Registry Editor : regedit.exe
  2. I have taken the example of Excel icons missing. So Navigate to HKCR\AppId\EXCEL.EXE
  3. Look for the value for "Appid". For me the value was "{00020812-0000-0000-C000-000000000046}"  - this may be different for you. So note it down.
  4. No look for the value HKCR\CLSID\{00020812-0000-0000-C000-000000000046}\DefaultIcon (Change the Appid value to what you noted above).
  5. Find the value for "Default". For me it is : "C:\Windows\Installer\{90140000-0011-0000-0000-0000000FF1CE}\xlicons.exe,3"
  6. Now look for this location "C:\Windows\Installer\{90140000-0011-0000-0000-0000000FF1CE}\xlicons.exe" in your drive. If you already have it then it is a different issue for you and look for other solutions in this thread. If you do not have this folder, copy it from some other desktop and it should work.
Good luck :-)

Wednesday, April 18, 2012

Automatic Logging in to .NET / ASPX using Firefox

If a .NET / ASPX site's authentication mode is marked as 'Windows Authentication', then IIS authenticates the web request with the domain on behalf of the site. This works seamlessly with Internet Explorer but with Firefox , it asks for domain credentials which shows up as a popup in Firefox. This is the usual situation in an Enterprise network where we have Sharepoint and some internal sites built on .NET technology.

Now how do we configure firefox to automatically send the user credentials to the server (IIS) which can authenticate it automatically. To do so:
  1. In the Firefox URL bar enter "about:config":
  2. Acknowledge the warning, and in the "Filter:" box, enter "network.negotiate-auth.trusted-uris". Double click on this, and give it a value of "ad.com,intra.com" (internal domains to which you want firefox to automatically log in to). Click OK.
  3. This will allow Firefox to log you in automatically to internal sites of your company.




Thursday, November 17, 2011

Error 1001. The specified service has been marked for deletion

Currently I am developing a windows service and after a few Install/UnInstalls from Visual Studio - I got this error:

Error 1001. The specified service has been marked for deletion

Looking at google, I found the most simplest answer to it although MSDN asks you to reboot you workstation:
Just close your Services console (services.msc). It creates a lock on the service hence prevents its complete removal. Just close down your Services console and wow its gone.

Sunday, May 1, 2011

Delete Internet Explorer History when disabled by Admin

Sometime Domain Admins disable deletion of Internet Explorer's history by setting a domain group policy. The Internet Explorer "Delete Browsing History" looks like:






















where the check-box next to History is disabled. Still if you want to clear it off, you have 2 options:
  1. Go to registry and enable the check-box - a cumbersome way
  2. Or go the command line way. Just type in the following in the command window:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1

and you are all set :)