Showing posts with label getting. Show all posts
Showing posts with label getting. Show all posts

Fix the problem of Show hidden files and folders getting reset

Fix the problem of Show hidden files and folders getting reset
This is a common problem these days that the option of “Show hidden files and folders” always gets reset each time when we set it to show the hidden files. This is sure a case of infected system either with Trojan or virus.
Possibly the system is infected by a virus named “amvo.exe”. So let’s remove this first to be on a safer side.

Steps to remove amvo.exe:
1. We need to delete following files
  • amvo.exe
  • amvo0.dll
  • amvo1.dll

2. Open command prompt by typing cmd in the Run box. Then type
  • cd windowssystem32
  • attrib -s -h -r amvo*.*
  • del amvo*.*

Steps to fix the problem:
  1. Now open registry editor and navigate to the entry HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerAdvancedFoldersHiddenSHOWALL
  2. On the right side see the entry named “CheckedValue”, if the value is set to ‘0? change it to ‘1?.
  3. The “DefaultValue” under the “CheckedValue” should be set to ‘2?.
  4. Click Refresh under the view tab and if the entries the same that we set just now that means the problem is solved.
Read More..

Getting your fridge to order food for you with a RPi camera and a hacked up Instacart API

This is a detailed post on how to get your fridge to autonomously order fruit for you when you are low.  An RPi takes a picture every day and detects if you have fruit or not using my Caffe web query code. If your fridge is low on fruit, it orders fruit using Instacart, which is then delivered to your house. You can find the code with a walk through here:
https://github.com/StevenHickson/AutonomousFridge

Some of my posts are things I end up using every day and some are proof of concepts that I think are interesting. This is one of the latter. When I was younger, I heard an urban legend that Bill Gates had a fridge that ordered food for him and delivered it same-day whenever he was low. That story always intrigued me and I finally decided to implement a proof of concept of it. Below is how I set about doing this.

Hacking up an Instacart API

The first thing we need is a service that picks out food and delivers it to you. There are many of these, but as I live in Atlanta, I chose Instacart. Now we need an API. Unfortunately, Instacart doesnt provide one, so we will need to make our own. 

Head over to instacart.com and set up an account and login. Then right click and view source. You are looking for a line in the source like this:
FirebaseUrl="https://instacart.firebaseio.com/carts/SOME_HASH_STRING_HERE

That string is what you need to access your instacart account. Open up a terminal and type:
curl https://instacart.firebaseio.com/carts/YOUR_HASH_STRING.json

You should get back a response that looks like this:
{"checkout_state":{"workflow_state":"shopping"},"items":{"1069829":{"created_at":1.409336316211E9,"qty":1,"user_id":YOUR_USER_ID}},"users":{"-JXAzAp6rgtM4u2dV2tI":{"id":YOUR_USER_ID"name":"StevenH"},"-Jj2_kFsu5hvZRhx4KX1":{"id":YOUR_USER_ID,"name":"Steven H"},"-Jp8VvDusSDOyEiJ0J5D":{"id":YOUR_USER_ID,"name":"Steven H"}}}

Now we just need to figure out what different items are. Pick a store and start adding items to your cart and run the same command. If I add some fruit (oranges, bananas, strawberries, pears) to my cart and then run the same curl request. I get something like this:
{"checkout_state":{"workflow_state":"shopping"},"items":{"1069829":{"created_at":1.409336316211E9,"qty":1,"user_id":YOUR_USER_ID},"8182033":{"created_at":1.431448385824E9,"qty":2,"user_id":YOUR_USER_ID},"8583398":{"created_at":1.431448413452E9,"qty":3,"user_id":YOUR_USER_ID},"8585519":{"created_at":1.431448355207E9,"qty":3,"user_id":YOUR_USER_ID},"8601780":{"created_at":1.424915467829E9,"qty":3,"user_id":YOUR_USER_ID},"8602830":{"created_at":1.43144840911E9,"qty":1,"user_id":YOUR_USER_ID}},"users":{"-JXAzAp6rgtM4u2dV2tI":{"id":22232545,"name":"StevenH"},"-Jj2_kFsu5hvZRhx4KX1":{"id":YOUR_USER_ID,"name":"Steven H"},"-Jp8VvDusSDOyEiJ0J5D":{"id":YOUR_USER_ID,"name":"Steven H"}}}

Now empty your cart and we will make sure we can add all those things to your cart with a curl request. Take your response from earlier, and use it in the following line:
curl -X PATCH -d YOUR_FULL_CART_RESPONSE https://instacart.firebaseio.com/carts/YOUR_HASH_STRING.json

Now, your cart should be full of fruit again. Now we just need a way to recognize whether your fridge has fruit or not.

Detecting fruit in your fridge

For this we just need a Raspberry Pi 2 Model B Project Board - 1GB RAM - 900 MHz Quad-Core CPU and a Raspberry PI 5MP Camera Board Module.
Set up your camera following these instructions and you will be ready to go. Set up your camera module in your fridge (or wherever you store your fruit).

We are going to use the Caffe framework for recognizing whether fruit is in the refrigerator drawer or not. You can read about how to do that here.
We are going to set this up similarly. Run the following commands to set things up:

git clone https://github.com/StevenHickson/AutonomousFridge.git
sudo apt-get install python python-pycurl python-lxml python-pip
sudo pip install grab sudo apt-get install apache2
mkdir -p /dev/shm/images
sudo ln -s /dev/shm/images /var/www/images

Then you must forward your router from port 5005 to port 80 on the Pi
Now you can edit test.sh with your info and run ./test.sh
Or add the following line to cron with crontab -e:
00 17 * * * /home/pi/AutonomousFridge/test.sh

This script takes a picture with raspistill and puts it in a symlinked directory in memory accessible from port 80. Then it sends that URL to the Caffe web demo and gets the result.
The Caffe demo shows how well it classifies the existence of fruit as shown below:



The end result of this is a script that runs every day at 5 pm. When your fridge doesnt have fruit, it adds a bunch of fruit to your Instacart cart. You can order it at your leisure to make sure you are home when it arrives. You could also use my PiAUISuite to get it to text you about your fruit status. It can be alot of fun to make a proof of concept of an old urban legend.

Consider donating to further my tinkering since I do all this and help people out for free.



Places you can find me
Read More..

Getting Hulu Vimeo to work on the Raspberry Pi

This one isnt quite for the faint of heart as you have to install a lot of scripts but here is what I did to get hulu and vimeo working on the Raspberry Pi.

sudo apt-get install libwww-mechanize-perl libxml-simple-perl libcrypt-ssleay-perl libio-all-lwp-perl liblwp-protocol-http-socketunix-perl liblwp-protocol-socks-perl libdigest-hmac-perl libcrypt-blowfish-perl

sudo cpan "Module::Find"
sudo cpan "Crypt::Blowfish_PP"
sudo cpan "Crypt::Rijndael"

cd ~
git clone https://github.com/monsieurvideo/get-flash-videos.git
cd get-flash-videos
perl Makefile.PL
make
sudo make install

get_flash_videos --add-plugin http://gitorious.org/get-flash-videos-plugins/gfv-plugins/blobs/raw/release/Hulu.pm

It doesnt look to bad written out but it will take you a bit to install everything.
Once you do that, you can download any video from hulu (not the members only ones), vimeo, and many other sites without commercials like so:

get_flash_videos "http://vimeo.com/50796424"

Now you can get my updated youtube-safe script from here and use it to play videos for you as well.
Ill work on making a browser plugin for this as well. Then you can stream videos from those sites by typing:

youtube-safe "http://vimeo.com/50796424"

Consider donating to further my tinkering
Read More..