Skip to content

Instantly share code, notes, and snippets.

@TacoSteemers
TacoSteemers / gist:11060507
Last active August 29, 2015 14:00
backuppc installation
In my setup, /var/lib/backuppc is a soft link to a directory on a different filesystem, lets say /backup
Problem one: could not start the service
Solved by setting
chmod g+s /backup
chown -R backuppc /backup
Problem two: web interface would not come up
Solved by running (as root):
@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:
@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: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: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:5716821
Created June 5, 2013 20:00
Set main / primary display when using X Window system and compatible driver
user@pc:~$ xrandr
Screen 0: minimum 320 x 200, current 3600 x 1080, maximum 8192 x 8192
DVI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 640mm x 360mm
1920x1080 60.0*+ 50.0 30.0 25.0 24.0
1920x1080i 30.0 25.0
1280x1024 60.0
1360x768 59.8
1280x720 60.0 50.0
1440x576i 25.0
1024x768 60.0
@TacoSteemers
TacoSteemers / gist:5690179
Created June 1, 2013 12:14
Drive or partition clone
sudo dd if=/dev/sdb of=/dev/sdc bs=4096 conv=noerror
@TacoSteemers
TacoSteemers / gist:5653440
Created May 26, 2013 17:32
grails integrate-with --git
$ cd to/grails/application/directory/
$ grails integrate-with --git
| Created Git '.gitignore' file..
$ cat .gitignore
*.iws
*Db.properties
*Db.script
.settings
stacktrace.log
/*.zip
@TacoSteemers
TacoSteemers / gist:5560959
Last active December 17, 2015 05:49
Partitioning and mounting a disk on a Debian system
What is present?
$ fdisk -l
To edit the partitions on /dev/sdz:
$ fdisk /dev/sdz
Follow the instructions.
Remove the partitions you want to remove, create new ones in their place.
Make sure to verify and write.
Then, update the kernel:
$ partprobe /dev/sdz
Then, create the filesystem(s):
@TacoSteemers
TacoSteemers / gist:5455651
Created April 24, 2013 21:16
python inspect object
import pdb, inspect
...
for m in inspect.getmembers(object):
print m
pdb.set_trace()