Skip to content

Instantly share code, notes, and snippets.

@tryp
tryp / do_squashfs
Created March 8, 2012 14:52
make a filesystem.squashfs for use in casper liveCD/liveUSB images
#!/bin/sh
#
# make a filesystem.squashfs for use in casper liveCD/liveUSB images
# usage sudo ./do_squashfs rootdir
rm filesystem.squashfs
chroot $1 dpkg-query -W --showformat='${Package} ${Version}\n' > filesystem.manifest
mksquashfs $1 filesystem.squashfs
printf $(sudo du -sx --block-size=1 $1 | cut -f1) > filesystem.size
@tryp
tryp / do_chroot
Created March 8, 2012 14:48
chroot into a rootfs for the same architecture
#!/bin/sh
#
# chroot into a rootfs for the same architecture
# usage: sudo ./do_chroot rootdir
echo chrooting into $1
mkdir -p $1/proc
mkdir -p $1/sys
mkdir -p $1/dev
@tryp
tryp / allow_unrestricted_root_login.sh
Created February 15, 2012 22:00
Modify /etc/shadow to allow unrestricted root login
#!/bin/sh
# /etc shadow fields are as follows:
# user:passwd:lastchange:minage:maxage:warndays:inactiveperiod:expdate:reserved
# remove root password, change requirement, and age restrictions
sed -e 's/^root:[^:]*:[^:]*:[^:]*:[^:]*:/root:::::/' -i etc/shadow
@tryp
tryp / picasabak
Created September 19, 2011 17:14
Backup a directory of folders to Picasa using GoogleCL
#!/bin/bash
# Backup a folder of to a Picasa album
if [ ! -n "$1" ]
then
echo "Backup a directory of photos to Google Picasa"
echo "Usage: `basename $0` Album_Directory/"
exit 1
fi