GithubHelp home page GithubHelp logo

bcp's Introduction

Broadcast Copy

Any easy way to copy files between terminals or computers on a local network.

Note: bcp currently assumes a trusted network, use with caution

Compiling

make or gcc -D_FILE_OFFSET_BITS=64 -o bcp bcp.c

Installation

$ make install

One line install:

$ bash -c "mkdir /tmp/bcp && cd /tmp/bcp && curl -L# https://github.com/jgallen23/bcp/archive/master.tar.gz | tar zx --strip 1 && make install"

In OSX, you can use @gil's homebrew solution: https://github.com/gil/homebrew-bcp

Usage

To make file availabe for copying:

$ ./bcp filename

To receive the file:

$ ./bcp

Example

Sender

diginux@heisenberg:~/code/bcp/test$ ./bcp awesome.jpg
Listening for request..
Sending file to: 192.168.2.12:10789
Sent 107545
File sent.

Recipient

Jordans-MacBook-Pro:bcp diginux$ ./bcp
Requesting file..
Incoming connection from: 192.168.2.12
Receive: 107545
File received: awesome.jpg

Useful bash commands

bcpdir: to send directories

# zip directory to /tmp and bcp it
bcpdir() {

	curr_time=`date +%s`
	file=/tmp/files_$curr_time.zip

	if [[ -d $1 ]]; then

		# dir	
		cd $1
		zip -r -9 $2 $file .

	elif [[ -f $1 ]]; then

		# single file
		file_dir=`dirname $1`
		file_name=`basename $1`
		cd $file_dir
		zip -r -9 $2 $file $file_name

	else
		echo "$1 is not valid!"
		exit 1	
	fi

	bcp $file
	rm $file
	cd -
}

bcppass: to send files/directories protected with password

# zip file/directory with password to /tmp and bcp it
bcppass() {
	bcpdir $1 -e
}

Alternatives:

bcp's People

Contributors

bahaa-aidi avatar jgallen23 avatar jwilberding avatar jwilberding-sfdc avatar ragkousism avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bcp's Issues

No license used

As I have noticed there is no license used in the project. Shouldn't it be more appropriate to use one in order to protect the project from any unwanted implications ?
And as a free software supporter I suggest using GNU GPL license

Homebrew Formula

It would be swell if a homebrew formula existed for this simple utility. It's pretty great to use on a network of trusted machines and in labs where many of our users have OSX on their machines.

Major security issue: overwriting any file

If you turn on the server, that immediately gives anyone on the network the ability to make you overwrite any file on the file system (subject to permissions of the current user). You need to either let the receiver be the one who specifies the filename or strip the path from the filename.

Add piping

Thanks to latitude:

Try and add support for detecting piped input on the server side:
bcp < filename
because this would allow for things like
cat filename | gzip | bcp
with the receiving end doing
bcp | gunzip > filename

Fix os/arch dependency issues

Thanks to jbester:

  1. The code assumes both the client and the server have the same endian. This can be issue since a uint32 is used for both the synchronization code (BCP_CODE) and the port. This can easily fixed with htonl/ntohl conversions.

  2. it assumes both the client and the server define int to be the same size (may or may not be true based on compiler/processor/OS combinations). If you use stdint definitions, this typically won't be an issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.