Skip to content

Instantly share code, notes, and snippets.

@ten0s
Last active September 30, 2016 01:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ten0s/8f67551fe7c3ac32501c20f7b7a39c6f to your computer and use it in GitHub Desktop.
Save ten0s/8f67551fe7c3ac32501c20f7b7a39c6f to your computer and use it in GitHub Desktop.
Dropbox protocol
dropbox stop
#
# Pretent Dropbox is running
# See 'is_dropbox_running' function
# Simulate 'dropbox' string in /proc/%d/cmdline
#
bash -c 'read dropbox' &
6103
echo 6103 > ~/.dropbox/dropbox.pid
dropbox running
echo $?
1
#
# Determine status and puburl commands
#
dropbox status
nc -l -U ~/.dropbox/command_socket | xxd
0000000: 6765 745f 6472 6f70 626f 785f 7374 6174 get_dropbox_stat
0000010: 7573 0a64 6f6e 650a us.done.
dropbox puburl /home/ten0s/Dropbox/tmp/d1
nc -l -U ~/.dropbox/command_socket | xxd
0000000: 6765 745f 7075 626c 6963 5f6c 696e 6b0a get_public_link.
0000010: 7061 7468 092f 686f 6d65 2f74 656e 3073 path./home/ten0s
0000020: 2f44 726f 7062 6f78 2f74 6d70 2f64 310a /Dropbox/tmp/d1.
0000030: 646f 6e65 0a done.
dropbox ls /home/ten0s/Dropbox/tmp/
nc -l -U ~/.dropbox/command_socket | xxd
0000000: 6963 6f6e 5f6f 7665 726c 6179 5f66 696c icon_overlay_fil
0000010: 655f 7374 6174 7573 0a70 6174 6809 2f68 e_status.path./h
0000020: 6f6d 652f 7465 6e30 732f 4472 6f70 626f ome/ten0s/Dropbo
0000030: 782f 746d 702f 6431 0a64 6f6e 650a x/tmp/d1.done.
dropbox stop
nc -l -U ~/.dropbox/command_socket | xxd
0000000: 7472 6179 5f61 6374 696f 6e5f 6861 7264 tray_action_hard
0000010: 5f65 7869 740a 646f 6e65 0a _exit.done.
#
# Cleanup
#
kill 6103
rm ~/.dropbox/dropbox.pid
dbus-launch dropbox start
#
# Usage
#
dropbox start
dropbox status
Up to date
echo -n -e "get_dropbox_status\ndone\n" | nc -U ~/.dropbox/command_socket | xxd
0000000: 6f6b 0a73 7461 7475 7309 5570 2074 6f20 ok.status.Up to
0000010: 6461 7465 0a64 6f6e 650a date.done.
dropbox puburl /home/ten0s/Dropbox/tmp/d1
Couldn't get public url: Unknown Error
echo -n -e "get_public_link\npath\011/home/ten0s/Dropbox/tmp/d1\ndone\n" | nc -U ~/.dropbox/command_socket | xxd
0000000: 6e6f 746f 6b0a 556e 6b6e 6f77 6e20 4572 notok.Unknown Er
0000010: 726f 720a 646f 6e65 0a ror.done.
dropbox filestatus /home/ten0s/Dropbox/tmp/d1
/home/ten0s/Dropbox/tmp/d1: up to date
echo -n -e "icon_overlay_file_status\npath\011/home/ten0s/Dropbox/tmp/d1\ndone\n" | nc -U ~/.dropbox/command_socket | xxd
0000000: 6f6b 0a73 7461 7475 7309 7570 2074 6f20 ok.status.up to
0000010: 6461 7465 0a64 6f6e 650a date.done.
echo -n -e "tray_action_hard_exit\ndone\n" | nc -U ~/.dropbox/command_socket | xxd
dbus-launch dropbox start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment