Raspberry Pi Flash Drive File Mover Utility

Raspberry Pi, the soon to be released $35 arm computer has a limited amount of USB ports. If you need to copy a file to a usb drive you will have to unplug your keyboard. Luckily, I have written a small python script that will solve this potential headache.

import time
import string
import os
import sys
lastspace = False
os.system("rm cat.txt cat2.txt device.txt")
if (len(sys.argv) > 1):
movefile = sys.argv[1]
else:
movefile = raw_input('Enter your file to be moved: ')
os.system("ls /media/ >> cat.txt")
raw_input('Press Enter and then insert USB device')
time.sleep(11)
os.system("ls /media/ >> cat2.txt")
os.system("diff cat2.txt cat.txt >> device.txt")
file = open("device.txt", "r")
device = file.read()
dlist = string.split(device,'<')
print device
print dlist
dlist[1] = string.strip(dlist[1],"\n")
x = 0
newfile = dlist[1]
while (x < len(dlist[1])):
     if(dlist[1][x] == " " and lastspace == False and x != 0):
         newfile = newfile[0:x-1] + "\ " + newfile[x:]
         lastspace = True
     if (dlist[1][x] == " " and x == 0):
         newfile = newfile[1:]
     if lastspace == True:
        x = x+1
     x = x+1
print "mv " + movefile + " /media/" + newfile + "/"
os.system("mv " + movefile + " /media/" + newfile + "/")

You can either enter your file name as an argument or it will prompt you. You can also tweak the waiting time that it takes before trying the move. I’m not sure how accurate the technique I have used to test for new devices is. But I thought it would be the easiest way.  Actually I’m pretty sure there has to be a more efficient way, but I didn’t want to implement a continuously polling program. I will definitely take suggestions and feedback in order to make it better.

Popularity: 1% [?]

Posted in Uncategorized | Leave a comment

If Apple Doesn’t Somebody Will: Revolutionizing the Textbook Industry

CNN Money declares that Apple’s Education even is grossly over-hyped. But is it? From that article it is made clear the Apple does not want to get into the Textbook market itself. Rather, it wants to empower the textbook industry to create the amazing, interactive textbooks that belong in the twenty-first century classroom.

This could be one of Apple's most important announcements in years http://t.co/0oTPyX8S #education #publishing
@brainpicker
Maria Popova

 

Walter Isaacson’s Steve Jobs biography, Steve talks about the antiquity of the so called  ”modern” textbook. It is clear that the Textbook (along with the television) industry was one of the next places that he wanted Apple to revolutionize (pg. 510).

If Apple can make the creation of digital textbooks easy, they can create a new use for their iPad. Their iPad sales will skyrocket if colleges and high schools start using digital textbooks. Apple will not become the producer nor the publisher but the distributor. It will be exactly like iTunes but all over again.

Popularity: 1% [?]

Posted in Uncategorized | Leave a comment
Link

Sliced Bread Notebooks [click me]

Just wanted to share this cool link for 12 notebooks that come in a package resembling a bread bag. Maybe it will help you with your New Years resolution. <via Uncrate> Who am I kidding nobody keeps their resolutions.

Popularity: 1% [?]

Posted in Uncategorized | Tagged , , | Leave a comment

Why Costolo is Wrong, Wikipedia Should Blackout Tomorrow (updated: why Carr misinterpreted Costolo)

@ @ that's just silly. Closing a global business in reaction to single-issue national politics is foolish.
@dickc
dick costolo

According to Paul Carr of Pandodaily (the new blog setup by some TechCrunch refugees), Wikipedia should not be going black in protest of SOPA. His main reasons ares that:

  • Wikipedia has asked their users for money in order to keep their servers up. The users have provided that money, and thus deserve uninterrupted service.
  • It marginalizes other important things such as human rights abuses in Libya.
  • It harms Wikipedia’s Neutrality.

Mr. Carr does have a point in that Wikipedia has been fundraising, and its users deserve the up time that they donated their money for. However, Wikipedia did not just make this decision on its own. Its users have voiced their opinions. If passed, SOPA/PIPA will bring down Wikipedia, not  for one day, but forever. SOPA/PIPA is also not just an issue in the United States. It also gives the ability for international sites to be brought down.

Mr. Carr’s second issue with Wikipedia’s marginalization of other issues is also somewhat valid. But, those other issues did not affect Wikipedia itself. SOPA will affect Wikipedia if passed. As a foundation that’s goal is to “empower and engage people around the world to collect and develop educational content under a free license or in the public domain, and to disseminate it effectively and globally.” Wikipedia should and must oppose all laws, American and Otherwise, that would make their mission impossible. 

Wikipedia’s articles must be neutral, but Wikipedia should not. It must serve its own interests. The Wikimedia foundation cannot roll over and allow the United States government to pass harmful bills that will negatively impact it.

This website will be joining Wikipedia in it’s protest. Wikipedia is making the right decisions and I fully support them.

 Update (Tuesday, @4:10):

@ was only referring to Twitter in response to explicit tweet suggesting we lacked courage for not shutting down.....
@dickc
dick costolo

As shown in the Twitter update above, Carr misinterpreted Cosotolo’s tweet. Mr. Costolo was only referring to the pressure that Twitter should go down tomorrow.  But my argument for Wikipedia’s blackout still stands.

 

Popularity: 1% [?]

Posted in Uncategorized | Leave a comment

Be Prepared for the January 18th, 2012 SOPA/PIPA Blackout

SAY NO TO SOPA
This is going to be wow. I hope Wikipedia will melt phone systems in Washington on Wednesday. Tell everyone you know!
@jimmy_wales
Jimmy Wales

The Internet is going to be turning black on Jan. 19th because of the copyright legislation currently going through the two houses of Congress. SOPA in the House of Representatives and PIPA in the Senate both threaten the wonderful community of creation that is the Internet.

If either of these bills are passed the major and minor sites (such as this one) could be taken down just for linking to a site that may or may not support piracy. Youtube could be taken down for one copyright infringing video. Same thing for Facebook, Wikipedia, or Etsy. That is why this site and many others will be going black on Wednesday.

Sites That I Know Are Going Black:

  • Reddit
  • Wikipedia (you better write your essays ahead of time)
  • Mojang
  • Major League Gaming
  • Cheezburger Sites

If you operate a website I suggest putting up a stop SOPA banner to increase awareness. It’s the only way we can keep the Internet as it is.

Popularity: 1% [?]

Posted in Community, Opinion, Politics, Tips | Tagged , , , , | Leave a comment

How To Install Emacs 24 on Debian Squeeze

You are probably wondering what all the fuss is about the newest prerelease versions of Emacs 24. Well, the best way to see them is to install the newest version.Here’s how you can do that on Debian.

This tutorial is based upon this official (more expert friendly) tutorial. If you want some challenge you can just try to install from there without reading the rest of this blog post. First you must install git if you don’t have git:

sudo apt-get install git

This will allow you to pull the newest release from the repository. Using this command:

git clone --depth 1 git://git.sv.gnu.org/emacs.git

Wait for your computer to download all of the files it might take a while. Now you need to install a  bunch of dependencies. You can try compiling without them and see which ones you absolutely need. But you at least need:

  • build-essential
  • xorg-dev
  • libgtk2.0-dev

All of these can be installed through “sudo apt-get install “.  Now you must compile the source by running “cd ~/emacs” then:

./autogen.sh
./configure
make bootstrap (this will take a while)
sudo make install

This should leave you with a working Emacs 24 install. It might take a long time but it is totally worth it

Popularity: 2% [?]

Posted in How To, Tips, Uncategorized | Tagged , , , , , | Leave a comment

The Era of Downtime: A Look at Some Memorable Internet Fails of 2011

Every time I see a discrepancy or a website offline I always like to screenshot. Imgur down? Better take a screenshot. Amazon’s pricing doesn’t make sense? Take that screenshot. Here’s some of the best so far:

Imgur:

Reddit:

Steam:

Amazon Pricing:

Amazon Shipping:

Hp Touchpad:

Captcha:

Popularity: 1% [?]

Posted in Uncategorized | Leave a comment

Grindcraft: My Windows “Port”, A Minecraft Soundtrack for your daily life

I stumbled upon this program called “GrindCraft“. It plays songs from the Minecraft soundtrack at random times while you are at your computer. However, it only works for Macs, well easily anyways. Today I ported it to Windows with Audiere. I own the Minecraft album so I just used that. But if you want you can probably get the songs from the minecraft game jar. (you need to go to:
“C:\Users\USERNAME\AppData\Roaming\.minecraft\resources” to find the .mp3 files. From there you can stick them in a separate folder.)

Keep in mind I wrote this as to make my experience as painless as possible. This probably means your experience will be very painful when you try to set this program up. But I figured someone might want to use it. So, here it is:

PCgrindcraft

PCgrindcraftv2

In the grindcraft.config file all you need is either “show” or “noshow” so say whether or not you want to know how long until the next song is played. And then the directory where all of your minecraft .mp3s are.

Here’s a preview of the sourcecode:

import audiere
import time
import random
import string
import os
f = open('grindcraft.conf','r')
read = f.read()
conf = []
conf = string.split(read)
d = audiere.open_device()
go = True
files = []
files = os.listdir(conf[1])
while(go == True):
    numb = random.randint(1,24)
    full = conf[1] + files[numb]
    f = d.open_file(full,1)
    f.play()
    rand_sleep = 600+(random.randint(-3,7)*60)
    while(rand_sleep > 0):
        time.sleep(5)
        rand_sleep = rand_sleep - 5
        if(conf[0] != 'noshow'):
            os.system("cls")
            print rand_sleep/60 , 'More minutes until music || Playing:', files[numb]

 

Popularity: 1% [?]

Posted in How To | Tagged , , | Leave a comment
Image

How Not To Make A Blog Theme

This is ridiculous. There is one thing that makes me angry and that is badly formatted blogs. As a writer/blog maintainer your most important job is to convey your writing in a well formatted and interesting way. A bad theme design impedes this goal and thus stops readers from returning to your site. This is an especially bad example from a blog I stumbled upon recently. It’s web page is 25% content and 75% meaningless ads and links.

Popularity: 1% [?]

Posted in Uncategorized | Leave a comment
Image

Who Took Down Steam? Was it you Humble Bundle?

This just happened repeatedly as I tried to download some of the new Humble Bundle 4 games on Steam. I can’t believe how quickly my steam library has grown after buying a couple of the Humble Bundles.

Has the Humble Bundle driven Steam to its knees?

Popularity: 1% [?]

Posted in Uncategorized | Leave a comment