Home‎ > ‎

Write-ups

Chrome OS: How To Edit A Google Drive File In Offline Mode Using vim

posted Nov 23, 2012, 9:49 AM by Israel Torres   [ updated Nov 24, 2012, 8:00 AM ]

This demonstration performed on an S3 Arm Chromebook using Chrome OS 
Version 23.0.1271.84
Platform 2913.168.0 / stable
Firmware Google_Snow.2695.104.0
Date: 20121123
Environmental requirements: You need to be in dev-mode using crosh (Type Control+Alt+T) then type shell (if you aren't using dev-mode you are in normal mode where the 'shell' command is not available)

Disclaimer: Be sure to save your files as this is an unofficial workaround. 


1. Select File in Google Drive and put in offline mode [enable check box]

2. Locate the file file in ~/GCache/v1/persistent, display original using cat

3. Open persistent file using vim

4. Modify file using vim, and save

5. Display modified file using cat

6. Copy using Google Drive GUI to ~/Downloads and display again using cat to validate modifications

Israel Torres 2012-11-23
-- thanks to drezha for bringing up this question on /r/ChromeOS 
-- thanks to bodangren2 for mentioning further clarification on step 6

Because, 127.0.0.1, 1337

posted Sep 8, 2012, 3:21 AM by Israel Torres

Disclaimer: The contents herein are for informational purposes only. Do not do Bad Things (™).
So it's around 2AM and browsing /r/videos and come across this NSFW jewel ( http://www.reddit.com/r/videos/comments/zjp3i/what_all_music_videos_aspire_to_be/ ) which links to https://vimeo.com/14307779 - the video and music was quite appeasing and figured I'd download a copy for "offline viewing" - however it didn't offer a download option as some Vimeo videos do; so I loaded up youtube-dl ( http://rg3.github.com/youtube-dl/ ) but that didn't pan out I kept getting "ERROR: Unable to retrieve video webpage: HTTP Error 404: Not Found". 
I paused for a few moments and then recalling what I read from Practical Packet Analysis 2nd Edition by Chris Sanders ( http://nostarch.com/packet2.htm ) I loaded up Wireshark (http://www.wireshark.org) on my Mac and loaded up for capture by setting the wifi interface, and starting the live capture right before hitting the play button on the video.
Having the header info from the pcap at first I tried for the low fruit and mimic a browser using curl (i.e. curl -O --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" --referer https://vimeo.com/14307779 --location http://av.vimeo.com/{REDACT}/{REDACT}/{REDACT}.mp4aksessionid={REDACT}&token={REDACT}) - using the typical bells and whistles of curl (referer, location, user-agent) but that didn't work out either; it just paused so that was fruitless for a quick fix.
Next I cleared the packet buffer, and started the live capture again from the beginning. After the video was done I saved the stream from the pcap as test.mp4, and made a copy of the file in case my experimentation fails.

 After the files were saved I opened the extracted stream in UltraEdit for Mac ( http://www.ultraedit.com/products/mac-text-editor.html )
Comparing the TCP stream image to the hex data I chopped away the obvious text and noticed that the test.mp4 file still remained with a generic Quicktime MP4 icon (usually not good). 

So I kept removing one character at a time and saving the file each time… then suddently I saw the file change to an image! 

Without thinking I clicked it and it opened up in Quicktime and played normally all the way through! 

The only difference I noticed was that the original video stopped at 4:20 (coincidence - I think not as it was excessively fade to black to that specific time), and the carved .mp4 stopped at 4:19.

Lessons learned here: 
1. Don't bother purchasing silly third-party apps that state they can download vimeo vidoes. 
2. Don't waste time trying to workaround cheesy 'security features' (unless it's your only avenue). 
3. Instead invest that time learning how things work from the ground up to reap the rewards yourself. :)

Shoutz to MoltenAcoustics for posting the link on /r/videos.
Thanks to Vimeo for posing the challenge ;)
Extra Thanks to King Fantastic for the fantastic video production (I'm not bragg'n, I'm confess'n)
Special Thanks to Chris Sanders!

Israel Torres 2012-09-08

Installing Wireshark on Mac OS X 10.8 Mountain Lion

posted Jul 31, 2012, 5:24 PM by Israel Torres   [ updated Aug 17, 2012, 8:30 AM ]

This write-up quickly goes over installing Wireshark using XQuartz on Mac OS X 10.8 Mountain Lion. Things have changed since Lion and things don't work as expected as I found out :) Enjoy.

1. Download the latest version of Wireshark

2. After mounting the .dmg you are presented with the .pkg which folks normally double-click on to open; you can also right-click on the .pkg (or control-click if you have a single button mouse configuration). More importantly doing this will allow you to open the .pkg and continue installation without having to temporarily disable your security preferences settings (steps 3 and 4 below); on the warning prompt click Open and skip to step 5.


3. To modify your preferences go to System Preferences -> Security & Privacy [General]. Make sure you have it set to unlocked so you can make changes. Change "Allow applications downloaded from" the default setting of "Mac App Store and identified developers" to "Anywhere".
4. Be aware doing this makes your system "less secure" - which is why this is a temporary change only to install WireShark. After Wireshark has been installed change it back!
5. To run Wireshark you'll need to download XQuartz. Mountain Lion (removes if you upgraded from Lion) does not come with X11 support which Wireshark and other applications like ImageMagick need so you'll have to install it as recommended by Apple. Once you've installed XQuartz and start up Wireshark you'll be prompted to Choose Application for X11 since it doesn't find it in the default location it is expecting. You need to manually locate it by browsing for it in Applications/Utilities/XQuartz (by default it just looks in Applications). 
6. When you run Wireshark for the first time it may just throw up a bash prompt after locating X11 (XQuartz) so you'll need to close everything down; if you try to restart Wireshark too early you'll get this message stating that you should wait a little longer before restarting Wireshark.
7. The dock will show both Wireshark and XQuartz running.


8. Eventually Wireshark will start the GUI.

9. ... and Wireshark will display successfully.

I hope this helps you out in saving you a few minutes. When Apple makes updates things get confusing quickly especially at the lower layers where power users roam.

Israel Torres - 2012-07-31 

(updated 2012-08-17) Thank you Mika Ryynänen for updating step 2 for efficiency!

README.TXT

posted Jul 31, 2012, 4:57 PM by Israel Torres

This section "Write-ups" is allocated for small quick write-ups, how-tos, DIYs, etc.
Enjoy

1-4 of 4