[Beaglebone Black] File Transfer with PC using SCP

On Windows, we can easily transfer files between the PC and the BBB through SecureShell File Transfer Client. However, in Linux, we will have to use the terminal program Secure Copy or SCP that’s built-in.

Overall, the scp command for copying to a computer (aka use the to computer’s username and ip) is:

 scp filename usename@ipaddress:/directory/ 

Continue reading

[BeagleBone Black] Expand File System Capacity on the MicroSD

In the previous section, we set up the BeagleBone Black Rev B to boot Debian OS off an MicroSD card. Here, we are going to expand the storage capacity in order to update the software and install apps.

Pretty much, I followed the instruction on the eLinux website, and it works perfectly! So you can read the details there, I will list the basic steps here.

Continue reading

[Java] Download File from URL

In your program, you might want to¬†acquire¬†files from the internet for purposes such as update, additional resources, web image gallery… so here’s a modified version of the codes I found on stackoverflow.com that you can just copy and paste into your Java program. Just supply the URL for path and the file name in filename.

 public static String downloadFile(String path, String filename)

 try {
 URL website = new URL(path);
 ReadableByteChannel rbc = Channels.newChannel(website.openStream());
 FileOutputStream fos = new FileOutputStream(filename);
 fos.getChannel().transferFrom(rbc, 0, 1 << 24);
 } catch (IOException ex) {
 Logger.getLogger(main.class.getName()).log(Level.SEVERE, null, ex);

 return path + "............ COMPLETED!";