Skip to content

Instantly share code, notes, and snippets.

@pavgup
pavgup / gist:30ba4b025126345cf7572e2835e5a329
Created February 7, 2020 19:49
move files to a hash of their contents
find . -name *.mp4 -exec md5sum '{}' ';' | while read sum file ; do cp "$file" /mnt/tmp-move/"$sum".mp4 ; done
@pavgup
pavgup / cipherExtract.sh
Created August 27, 2020 04:24
programmatically extracting a bunch of files that have been mangled with ciphercloud
#/bin/bash
# This script looks for the first argument to be in single quotes and relative to the base (and obviously a ccsecure file!)
# CipherCloud is annoying, but not hard. Lets manipulate this to extract!
open /Applications/CipherCloud.app "$1"
# Lets find the parent directory for each file, to place the extracted file after done
parentdir="$(dirname "$1")"
@pavgup
pavgup / server.py
Created June 16, 2023 20:27
using curl to send a file to a remote machine
# on the remote server you want to use to send a file, you run:
# curl -F "file=@/log.txt" http://100.100.100.100:8000/
# this will create the file log.txt in /tmp that will ideally containt he log.txt from the remote machine
from http.server import SimpleHTTPRequestHandler
import os
class FileUploadHandler(SimpleHTTPRequestHandler):
def do_POST(self):
content_length = int(self.headers['Content-Length'])