Skip to content

Instantly share code, notes, and snippets.

View vmassuchetto's full-sized avatar

Vinicius Massuchetto vmassuchetto

View GitHub Profile
@vmassuchetto
vmassuchetto / youtube-dl-cron.sh
Last active September 26, 2023 12:21
Shell script cron job to download YouTube videos from your subscription feed
#!/bin/bash
#
# Script to keep downloading YouTube videos to your computer using youtube-dl:
# http://rg3.github.io/youtube-dl/
#
# Put it to work:
#
# sudo wget "https://gist.github.com/vmassuchetto/10338703/raw" -O /etc/cron.hourly/youtube-dl-cron.sh
# sudo chmod +x /etc/cron.hourly/youtube-dl-cron.sh
@vmassuchetto
vmassuchetto / purge.sh
Last active August 2, 2023 15:07 — forked from adrienbrault/purge.sh
Script to clean a Vagrant box before packaging it. Updated to work with Debian and some additional directories. It's also less general and does not remove any system packages at all.
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
# - https://gist.github.com/adrienbrault/3775253
# Unmount project
umount /vagrant
@vmassuchetto
vmassuchetto / winopen
Last active June 8, 2023 04:49
Shell script to open files in a VirtualBox Windows guest from the Linux host
#!/bin/bash
# Based on http://tinyurl.com/jmze5lw with some additions
# Dependencies: detox wmctrl
# In your VM, share the root host location "/" in $DRIVE
SCRIPTPATH="$(basename "$0")"
VMNAME="WindowsXP"
DRIVE="E:"
@vmassuchetto
vmassuchetto / remote-mysqldump.sh
Created July 4, 2017 15:14
Run mysqldump remotely via SSH to create local SQL dumps
#!/bin/bash
usage() {
echo ""
echo "USAGE:"
echo ""
echo " $0 [ OPTIONS and PARAMETERS ]"
echo ""
echo "OPTIONS:"
echo ""
@vmassuchetto
vmassuchetto / etc-init.d-protheus
Last active June 10, 2018 14:18
Initscript para o Totvs Microsiga Protheus: License server, cTree, DBAccess, Appserver e Workflow
#!/bin/bash
### BEGIN INIT INFO
# Provides: protheus
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop protheus server
### END INIT INFO
@vmassuchetto
vmassuchetto / shotwell-sync-dirs
Last active January 2, 2018 15:45
Syncronize Shotwell photos directories moving files to the exposure time adjusted in the application
#!/bin/bash
DBFILE=~/.local/share/shotwell/data/photo.db
PHOTODIR="~/photos"
STRUCTURE="%Y/%m"
UPDATE="$(mktemp -d "${TMPDIR:-/tmp/}$(basename 0).XXXXXXXXXXXX")/update.sql"
echo '' > $UPDATE
PHOTODIR=${PHOTODIR/#\~/$HOME}
@vmassuchetto
vmassuchetto / commit.sh
Created September 25, 2017 15:21
Commit and push changes on a shared codebase using a single user (used in Cobol mainframes for teams not familiar with Git)
#!/bin/sh
#
# Script to help users in version control in a shared codebase
# and a single user account. It will parse a USERS_FILE to
# fill the proper committer info and push changes. Pull and
# merges are not used. Pushes are forced because the main codebase
# is the work-tree and not the upstream code.
#
@vmassuchetto
vmassuchetto / cleanbox-centos5.sh
Created May 30, 2017 18:50
Script to clean a CentOS 5 virtual machine for pre-packaging on Vagrant
#!/bin/sh
usage() {
echo ""
echo "USAGE:"
echo ""
echo " Run as root on virtual environment:"
echo " $0"
echo ""
echo "RESULTS:"
@vmassuchetto
vmassuchetto / shotwell-thumbnailer
Last active April 10, 2017 04:12 — forked from benjaoming/shotwell_regenerate_thumbnails.sh
Regenerate Shotwell thumbnails in parallell processing
#!/bin/bash
THUMB_ROOT=~/.cache/shotwell/thumbs
MAX_PROCESSES=4
i=0
sqlite3 ~/.local/share/shotwell/data/photo.db \
"select id||' '||filename from PhotoTable order by exposure_time desc" |
while read id filename; do
@vmassuchetto
vmassuchetto / .gitignore
Created November 28, 2013 22:23
etckeeper sample .gitignore
# begin section managed by etckeeper (do not edit this section by hand)
# new and old versions of conffiles, stored by dpkg
*.dpkg-*
# new and old versions of conffiles, stored by ucf
*.ucf-*
# old versions of files
*.old