Resize Luks volume on LVM
# /etc/crypttab luks-volume /dev/lvm/volume /root/volume.key luks
lvresize -L +100G /dev/lvm/volume cryptsetup resize luks-volume resize2fs /dev/mapper/luks-volume
# /etc/crypttab luks-volume /dev/lvm/volume /root/volume.key luks
lvresize -L +100G /dev/lvm/volume cryptsetup resize luks-volume resize2fs /dev/mapper/luks-volume
To generate equal-sized thumbnails from video files
for x in *; do ffmpegthumbnailer -i "$x" -o "../artwork/$x.jpg" -t 15% -s 256 convert "../artwork/$x.jpg" -resize 192x144^ "../artwork/$x.jpg" convert "../artwork/$x.jpg" -gravity center -crop 192x144+0+0 "../artwork/$x.jpg" done
growisofs -dvd-compat -Z /dev/cd0 -J -R -r -V volume-name /path/to/data
-dvd-compat indicates that the disc should be finalized, so no additional data can be added
-r sets permissions to sane defaults that work cross-platform
-V creates a label on the volume, no more than 32 characters
If there are files bigger than 4GB, (or 2GB on an old OS) you are going to have a bad time. The largest file supported by ISO9660 is
There are many ways to do this, but here is a quick way to use wget. "-l 2" tells wget to only go 2 links deep from the URL provided, so if you need more, change that value.
wget -p -r -N -l 2 -nc --no-remove-listing -k -E https://www.example.com/
If you're archiving the site simply for future reference, it might be beneficial to remove large files. Such as anything bigger than 2MB.
find www.example.com/ -size +2M -exec rm {} \;
There is lots of great information about using exiftool at http://www.sno.phy.queensu.ca/~phil/exiftool/filename.html. The one I use to manage my photos is
exiftool -d %Y/%Y-%m-%d "-directory<datetimeoriginal" ./
Another pattern that I'm trying out, to play a bit nicer with image browsers. Puts all images from the same month into one directory, and prefixes the file name with YmdHMS_ to make sure chronological order is preserved.
I can honestly never remember the correct files for doing a rescan of a SCSI bus so I figured I'd post this here. This isn't rocket science, but is here for quick reference. This is confirmed to work on RHEL 5/6, CentOS 5/6 and OEL 5/6:
# for f in /sys/class/scsi_host/host*; do echo "- - -" > $f/scan; done
# for f in /sys/block/sd*; do echo 1 > $f/device/rescan; done
slapcat -v > openldap.ldif
/etc/init.d/slapd stop rm -rf /var/lib/ldap/* slapadd -l openldap.ldif chown -R openldap: /var/lib/ldap /etc/init.d/slapd start
property secondsInOneDay : 86400 tell application "Mail" set theInbox to mailbox "Inbox" of account "Exchange" set dateToday to current date set firstMessage to 1 set lastMessage to (get count of messages in theInbox) repeat with thisMessage from lastMessage to firstMessage by -1 set currentMessage to message thisMessage of theInbox set messageDate to date received of currentMessage set timeDifference to dateToday - messageDate if timeDifference ≥ secondsInOneDay then set archiveMailbox to (mailbox ("Exchange inbox archive" as string))
Save to ~/Library/Scripts
if application "Mail" is running then tell application "Mail" synchronize with account "Exchange" end tell end if
* * * * * /usr/bin/osascript '/Users/bharris/Library/Scripts/Sync "Exchange" Mail account.scpt'
If you require the need in Powershell (if you must) to send an automated report and attach it with priority, try this thinned out script for sending your message with an attachment. Note: The email address must be encapsulated in angled brackets