sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plistStop the service with:
sudo launchctl unload -F /System/Library/LaunchDaemons/tftp.plist
I searched and didn't find, and had to figure stuff out... I hope to save you the trouble.
sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plistStop the service with:
sudo launchctl unload -F /System/Library/LaunchDaemons/tftp.plist
Can't open lease database /var/db/dhcpd.leases: No such file or directory --
check for failed database rewrite attempt!
sudo touch /var/db/dhcpd.leasesWe'll setup a basic network and give clients the 192.168.1.70-100 range.
curl -O http://ftp.isc.org/isc/dhcp/dhcp-3.1.3.tar.gzFor my uses, I want this dchpd to serve clients hooked up to my MacBook's ethernet port, so I manually set an IP address that's on the appropriate network range (it's okay if it already has an IP address, this will just give it another one):
tar xzvf dhcp-3.1.3.tar.gz
cd dhcp-3.1.3
./configure
make
sudo make install SUBDIRS='common dhcpctl omapip server'
sudo touch /var/db/dhcpd.leases
cat > dhcpd.conf <<END
default-lease-time 86400;
max-lease-time 604800;
ddns-update-style ad-hoc;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.70 192.168.1.100;
filename "pxelinux.0";
next-server 192.168.1.50;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
}
END
sudo cp dhcpd.conf /etc/
sudo ifconfig en0 192.168.1.50When you start the dhcp server, you'll probably get a warning that there's no subnet declaration for en1 since we didn't configure anything for the AirPort network. That's okay, just ignore that wordy warning:
No subnet declaration for en1 (192.168.10.100).
** Ignoring requests on en1. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface en1 is attached. **
sudo /usr/sbin/dhcpdStop the dhcp server:
sudo killall dhcpd
function pathremove()
{
local P=:$1:; shift
while [ "$1" ]; do P=${P/:$1:/:}; shift; done
P=${P#:}; P=${P%:}
echo ${P}
}
function pathprefix()
{
local P=$(pathremove $@); shift
local N=""
for n in $@; do N=${N}:$n; done
echo "${N#:}:${P}"
}
function pathsuffix()
{
local P=$(pathremove $@); shift
local N=""
for n in $@; do N=${N}:$n; done
echo "${P}${N}"
}
export PATH=$(pathsuffix $PATH $HOME/bin /opt/bin)
export PATH=$(pathremove $PATH /sbin)
export LD_LIBRARY_PATH=$(pathprefix $LD_LIBRARY_PATH /opt/lib)
# Check PS1 to determine if it's a login shell
if [ "$PS1" ]; then
SSH_ENV=$HOME/.ssh/env-$HOSTNAME
if [ -f "$SSH_ENV" ]; then
source $SSH_ENV > /dev/null
fi
ps $SSH_AGENT_PID 2> /dev/null 1>&2
if [ $? != 0 ]; then
echo "$(date) : Starting SSH agent on $HOSTNAME" | tee -a $HOME/.ssh/agent.log
ssh-agent > $SSH_ENV
chmod 600 $SSH_ENV
source $SSH_ENV
ssh-add
fi
fi
#! /bin/bash
# Script to use a visual differ to view svn changes,
# supporting multiple files in one session
SVN=/usr/local/bin/svn
DIFF=tkdiff
args=""
sep=""
while read pair; do
args="$args $sep $pair"
sep=":"
done < <($SVN diff "$@" --diff-cmd echo | \
awk '/^-L/ {gsub(/\/tmp\/tmp/, "/dev/null"); print $(NF-1), $NF; next}')
$DIFF $args
python -c 'import sys,base64; base64.decode(sys.stdin,sys.stdout)'
svn diff -r 12344:12345 | patch -R -p0
mkdir initrd-rootExamine or modify the extracted contents as you like. Then you can put your modified initrd back together:
cd initrd-root
gunzip -c ../initrd.gz | sudo cpio -imdv
cd initrd-rootBut, wait... you said this could be done on a Mac...
find . | cpio -ov -H newc | gzip > ../initrd.gz
ld: duplicate symbol _argp_fmtstream_putc in ../lib/libcpio.a(argp-fmtstream.o) and ../lib/libcpio.a(argp-help.o)The problem is related to Apple's gcc improperly handling extern inline in C99 mode. Since we're just building a binary and therefore don't particularly care about C99, we'll just disable it with a configure flag.
curl -O http://ftp.gnu.org/gnu/cpio/cpio-2.10.tar.gz
tar xzvf cpio-2.10.tar.gz
cd cpio-2.10
./configure ac_cv_prog_cc_stdc=no
make
sudo cp src/cpio /usr/local/bin
curl -OL http://iweb.dl.sourceforge.net/project/squashfs/squashfs/squashfs4.2/squashfs4.2.tar.gz tar xzvf squashfs4.2.tar.gz cd squashfs4.2/squashfs-tools sed -i.orig 's/FNM_EXTMATCH/0/; s/sysinfo.h/sysctl.h/; s/^inline/static inline/' mksquashfs.c unsquashfs.c cat <<END >> xattr.h #define llistxattr(path, list, size) \ (listxattr(path, list, size, XATTR_NOFOLLOW)) #define lgetxattr(path, name, value, size) \ (getxattr(path, name, value, size, 0, XATTR_NOFOLLOW)) #define lsetxattr(path, name, value, size, flags) \ (setxattr(path, name, value, size, 0, flags | XATTR_NOFOLLOW)) END make sudo cp mksquashfs unsquashfs /usr/local/bin
write_file: failed to create file squashfs-root/path/to/file, because Too many open filesJust change the limit in the shell before running unsquashfs:
ulimit -n 2000 sudo unsquashfs filesystem.squashfs