Show HN: pbcopy/pbpaste across machines via Gitlab Snippets
github.com
github.com
nc -l 1234 | pbcopy
And on the sending machine pbpaste | nc receiving-machine.local 1234
(where "receiving-machine.local" is the hostname or IP address of the machine you want to copy data to)nc (netcat) is installed on macOS by default, so this works everywhere without any configuration. It's unencrypted, but on my private LAN I don't worry about people snooping.
Another trick to send a whole directory to a local machine with no SSH access in either direction is to pipe a tarball into base64, then transport the base64 data as text (via nc or clipboard). On the destination it’s just a “base64 -d” to restore it.
Not that it matters, but I think KDE Connect was available even before Apple's cross device copy paste
The beauty of apples continuity feature is that the sync happens locally over Bluetooth/WiFi and secured by the Apple ID. Nothing is sent to a remote server, and each entry has a TTL.
it's automatic.
https://support.apple.com/guide/mac-help/copy-and-paste-betw...
“To use Universal Clipboard, your devices must meet Continuity system requirements. They must also have Wi-Fi, Bluetooth, and Handoff turned on in System Preferences (on your Mac) and in Settings (on your iOS and iPadOS devices). You must be signed in with the same Apple ID on all your devices”
System requirements more or less means “hardware is new enough” (https://support.apple.com/en-us/HT204689; I think the technical reason is that it requires a specific Bluetooth version and macOS/iOS version)
Apple doesn’t say it, but I think the devices also must be on the same WiFi network and within Bluetooth range of each other.
Edit: as a consequence, if you lend your iPad to somebody for a few minutes while working on stuff you don’t want them to know about, log out of your Apple account. Without it, they can paste whatever happens to be on your clipboard.
Conversely, if you borrow someone else’s phone, don’t copy any secrets to the clipboard, even if you later replace that by something innocuous.
I have 2 macs for work. One for my employer, and one sent by the company I am contracted to work for.
Contract-mac is hugely locked down, requires all traffic to go through the VPN, and only allows non-VPN connections to the VPN.
Work-mac is fairly ordinary, not locked down except for anti-virus.
To get Magnet and a couple of other Apple store apps on the contract-mac, I signed in to the Apple store. Immediately, copy and paste started working across both macs. I'm not sure of the mechanism by which the clipboard was being "shared", but it felt like I'd get chewed out by contract-mac's security folks if I continued using it.
It's convenient, for sure, but could very easily be against security policy in larger enterprises.
Source: Apple support to me when it stopped working
I get that your team self hosts gitlab. Very clever. Nicely done.
Pretty much every place I've ever worked has struggled with secure, ad hoc, short-lived file transfers, both large and tiny. (eg Someone in marketing needs a data dump that's too large to sneak thru as an attachment via corporate email.)
"virtual sneaker net"
Often, we give up and just pass around a thumb drive. Ridiculous.
I also toyed with making some kind of a `clipit` style clipboard stack with pushing and popping and listing items on the clipboard and all that... I may add that too if there is interest...
I hope I don't use your services.
I also use slack as a pastebuffer, but mostly just for links to documentation or articles.
And it's e2e ecrypted by default! You can use this to make a DIY encrypted chat app in a few lines. Just write to the respective folder which is implicitly there by default i.e `echo "Hello world" >> /keybase/private/alice,bob/chat.txt` and the files is automatically encrypted with alice and bob's keys
This isn't open source, it's CS 101.
$ go get github.com/bradwood/glsnip
I suppose $ go get gitlab.com/bradwood/glsnip
would work fine? Seemed to work here.I love Git Lab and strongly believe it should be the default home if open source. It seems wrong to me that a proprietary product (GitHub) is where open source lives.
That said, I also just GitHub because discoverability for a new project is terrible on GitLab because of the network effect. Even contributions, where people are more motivated to find and contribute, will drop 10x by moving to Git Lab. It sucks, but we have a hard chicken and egg problem here and I don't know how we fix it.
It almost seems easier to convince Microsoft to open source GitHub than to convince millions of people to migrate in unison.
Luckily I added a link to where I got it, because I had long forgotten. Thanks Nathan! Nathan's blog post is excellent and should be read: https://madebynathan.com/2011/10/04/a-nicer-way-to-use-xclip...
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
[0] https://superuser.com/a/288333/72342Just rebrand yourself as 20year-olds-read-hn-instead-of-the-docs.com and save my rss feed from the noise.