Thanks to everyone for helping me on various topics. Thought I’d give something back with some tinkering.
Got a few things running after trying to implement a few of them as dockers and failing.
Dropbox
curl -Lo dropbox-linux-x86_64.tar.gz https://www.dropbox.com/download?plat=lnx.x86_64
sudo mkdir -p /opt/dropbox
sudo tar xzfv dropbox-linux-x86_64.tar.gz --strip 1 -C /opt/dropbox
/opt/dropbox/dropboxd
Visit link it gives you to link your dropbox account. You now have a dropbox folder in ~/Dropbox/ that you can symlink other folders. (Note rockstor shares are in places like /mnt/books/ and /mnt2/movies/ depending on which user owns them.)
Dropbox service
sudo curl -o /etc/init.d/dropbox https://gist.githubusercontent.com/thisismitch/6293d3f7f5fa37ca6eab/raw/2b326bf77368cbe5d01af21c623cd4dd75528c3d/dropbox
sudo curl -o /etc/systemd/system/dropbox.service https://gist.githubusercontent.com/thisismitch/6293d3f7f5fa37ca6eab/raw/99947e2ef986492fecbe1b7bfbaa303fefc42a62/dropbox.service
sudo chmod +x /etc/systemd/system/dropbox.service /etc/init.d/dropbox
sudo nano /etc/sysconfig/dropbox
Change file to look like this:
DROPBOX_USERS=“your_user_name”
Back to Bash:
sudo systemctl daemon-reload
sudo systemctl start dropbox
sudo systemctl enable dropbox
Dropbox Command Line (bc headless)
cd ~
curl -LO https://www.dropbox.com/download?dl=packages/dropbox.py
chmod +x ~/dropbox.py
ln -s /opt/dropbox ~/.dropbox-dist
~/dropbox.py
Link above shows basic commands like:
~/dropbox.py status
~/dropbox.py exclude add
~/dropbox.py exclude list
And one I found useful:
This contextually shows the directory’s dropbox status and colors files based on sync status (too cool)
~/dropbox.py ls
Exiftool organizing photo share
cd ~
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-10.51.tar.gz
tar -xzvf Image-ExifTool-10.51.tar.gz
Move the folder to wherever you like to install things. I prefer /opt/exiftool/ for mine.
Check that exiftool is working ./exiftool SOME_PICTURE and make sure it prints out data.
To make your picture directory self-organizing:
- Make sure your files have proper dates in whatever field you like. Some people like using filemodifydate, I like using the exif data directly (EXIF:datetimeorignal). You can set dates by using the
exiftool “-xmp:datetimeorignal=“YYYY:MM:DD”” DIR_WHERE_PICS_ARE
and you can always use the -r command to make anything recursive (be careful!)
- Add your existing pictures with good dates to this picture folder. /mnt2/pics/ for me.
Attempt a sort (try a small number of photos first please). Note: you may need to modify this command to suit your needs like a different exiftool location or wanting to use a different date or directory structure.
/opt/exiftool/exiftool -r “-filename<datetimeoriginal” -d /mnt2/pics/%Y/%m/%d-%H-%M-%S%%-c.%%e /mnt2/pics/
This one is recursive.
- If this sort worked well. Add a few test pictures into the root.
crontab -e
Insert the following
0 0 * * * /opt/exiftool/exiftool “-filename<datetimeoriginal” -d /mnt2/pics/%Y/%m/%d-%H-%M-%S%%-c.%%e /mnt2/pics/
I personally don’t use -r option in my daily exiftool run because the pictures in folders are already organized and there is not point wasting effort Another option is to use an inbox folder like /mnt2/pics/inbox/ with the -r option.
Congrats, your pictures are self-organizing (assuming they have good dates in their metadata
Pi-hole
Version released on July 2016 now compatible with CentOS.
Very simple to install and get running. Can confirm it works with no real issues.
curl -sSL https://install.pi-hole.net | bash
Also you will want to point your router’s DNS to your Rockstor server. So in my case 192.168.1.121. You can manually configure each client computer’s DNS but this seems more tedious.
Beware some of the default lists for pi-hole are a little tedious and block referral links etc and most notably don’t block youtube ads well. But I figure it still saves me a ton of bandwidth. Sometimes upwards of 50% of the day’s queries are blocked. Also Pi-hole works for mobile devices on your wifi. A nice bonus!
Pip based tools I find cool / useful on my headless server
sudo yum install python-pip
uTorrent Command Line Control
uTorrent is awesome but it’s webui isn’t. It lacks simple features like being able to shift a torrent up to the top of the pile of downloading torrents. BTC allows this and much more via searching for torrents and piping them into other BTC commands.
BTC Github Page
sudo pip install -U https://github.com/bittorrent/btc/tarball/master
Instant music
This tool downloads music files from youtube videos in a friendly way.
sudo pip install instantmusic
Ideas / Ask for Improvements
- pi-hole rockon - in the works below
- Dropbox rockon
- Plexrequests docker working - @Fredrik finished.
- Installing beets through pip and having it correct music metadata in background
- Trying Snort IDS, Squid, Squid Guard
- Scripting video transcodes in background
- Log file aggregation tool
- Scripting connecting my phone and syncing my music to it / pulling pictures off of it
- Scripting exiftool organization of my photos share - see above @coleberhorst finished.
If you have any suggestions, they are welcome! Or you can kind of see my interests from above, if you have anything you feel matches them, I am more than happy to tinker