Skip to content

Instantly share code, notes, and snippets.

@TacoSteemers
TacoSteemers / gist:6358033
Created August 27, 2013 19:37
Mount card in USB card reader
~ $ sudo mkdir /media/card
~ $ dmesg | tail
[ 3757.984103] sd 12:0:0:1: [sdd] 7987200 512-byte logical blocks: (4.08 GB/3.80 GiB)
[ 3757.985347] sd 12:0:0:1: [sdd] No Caching mode page present
[ 3757.985350] sd 12:0:0:1: [sdd] Assuming drive cache: write through
[ 3757.987211] sd 12:0:0:1: [sdd] No Caching mode page present
[ 3757.987213] sd 12:0:0:1: [sdd] Assuming drive cache: write through
[ 3757.988466] sdd: sdd1
~ $ sudo mount -t vfat /dev/sdd1 /media/card
@TacoSteemers
TacoSteemers / gist:6405772
Last active December 22, 2015 02:49
rsync: My preferred rsync backup command -a : Recursive, including owner and group, permissions (a for archive) --delete : Remove everything that exists on the target, but does not exist on the original -v, --progress, --stats : This will keep you up to date on the progress -h : Filesize will be shown in human-friendly format
rsync -avh --delete --stats --progress /media/original/ /media/target
@TacoSteemers
TacoSteemers / gist:6797573
Created October 2, 2013 17:46
Recursive chown/chmod
Don't forget to use the correct user:group and permissions.
find . -print0 | xargs --null chown server:server
chmod for directories:
find . -type d -print0 | xargs --null chmod -R 755
chmod for files:
find . -type f -print0 | xargs --null chmod -R 755
@TacoSteemers
TacoSteemers / gist:7515911
Created November 17, 2013 17:39
'return' is not allowed in object initializer
Getting "Groovyc: 'return' is not allowed in object initializer"?
You forgot a pair of parenthesis.
The following code
public List getImportedClasses
{
return imports
}
is not valid in Groovy or Java. Add the pair of parenthesis: