How to install and setup squid on freebsd February 6th, 2010
Web Server IP Address ā> 192.168.0.1
Public IP address (The Address that Squid will listen on to handle web requests) ā> 10.10.10.10
web Server FQDN name ā> http://linax.wordpress.com
# cd /usr/local/src/
# wget http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE6.tar.bz2
# tar -jxf squid-2.7.STABLE6.tar.bz2
# cd squid-2.7.STABLE6/
# ./configure --prefix=/opt/squid2.7 --disable-internal-dns \
--enable-forward-log --enable-follow-x-forwarded-for --enable-snmp \
--enable-linux-netfilter --enable-http-violations --enable-delay-pools \
--enable-storeio=diskd,aufs,ufs,coss --with-coss-membuf-size=8388608 --with-large-files \
--enable-large-cache-files --with-maxfd=8192 --enable-async-io=64 \
--enable-removal-policies=lru,heap --enable-useragent-log --enable-referer-log \
--enable-err-languages=English --enable-default-err-language=English
# make && make install
# cd /opt/squid2.7/etc/
# cp squid.conf{,-bak}
here is my squid.conf : Read the rest of this entry »
Posted in feebsd, Networking | 1 Comment »
How to enable SSHD in FreeBSD February 6th, 2010
Actually you will be asked whether to enable SSH, during a Standard Installation of FreeBSD.
Now, if you need to enable SSH after an installation, open the file rc.conf and add the line ` sshd_enable=”YES” `.
open the file # vi /etc/rc.conf
Now add the below line to the file. sshd_enable="YES"
Now start sshd.
# /etc/rc.d/sshd start source here for permitting root login edit /etc/ssh/sshd_config unhash PermitRootLogin no and make it
PermitRootLogin yes if password problem then add PasswordAuthentication YES
Posted in feebsd, Networking | No Comments »
Installing DHCP server on FreeBSD February 5th, 2010
I would like to automatically assign IP address to computers attached to my network rather than setting them manually everytime they are attached to my network. This time, Iām going to write how I install and configure the ISC DHCP on my FreeBSD Router.
What is DHCP
Dynamic Host Configuration Protocol (DHCP) is a protocol for automate the assignment of IP addresses in a network. Each computer connected to a network must have a unique IP, and without DHCP TCP/IP information must be assigned manually on each computer.
Installing ISC DHCP
The ISC DHCP server is a free implementation for the DHCP protocol. The software is available at DHCP Site
Before you install DHCP, you need to make sure the bpf device is compiled into your kernel. If you are using the default kernel (GENERIC) then it is built into your kernel by default.
To install ISC DHCP Server using ports on FreeBSD type (as root):
# cd /usr/ports/net/isc-dhcp3-server # make install clean
Once you have finished installing, we can move on to configuring the server. A sample configuration file is located in /usr/local/etc/dhcpd.conf.sample and you can copy it or rename it to dhcpd.conf.
Configuration Read the rest of this entry »
Posted in feebsd, Networking | No Comments »
How-To: Customize your Ubuntu Live CD July 1st, 2009
Live CD are great, they let you try out a distribution without installing it. They allow you to run your favorite distribution on any computer and on the top of this, they become handy to recover a system.
Ubuntu live CD is already packed up with some pretty nifty software that allow you to do pretty much everything with the Live CD, but still, they might be some software you don’t need that are include with it or, some software you need might be missing.
Another Pro for this is that by customizing your image, you will be able to install
This tutorial will show the steps to follow in order to customize an Ubuntu Live CD to your need by removing some component and adding some others.
During this tutorial, we are going to remaster our Ubuntu Gutsy Gibbon 7.10 Live CD with the following spec:
- remove non english language pack
- Update the softwares release shiiped in the live CD
- Enable universe and multiverse repository
- Include divx, mp3 support, realplayer ….
- Include ndiswrapper support
- Add Firefox flash-nonfree plugin, add skype.
- Add some network troubleshooting tools: traceroute, wireshark, kismet…
The resulting image will be bigger that 800M, so it won’t fit on a CD, but will be fine on a DVD.
1. Preparing the host
First of all, we need to get the current Gutsy Gibbon Live CD image and store it let say on ~/Desktop , also, we will need to install an extra piece of software to rebuild our gutsy live CD’s squashfs:
$ sudo apt-get install squashfs-tools chroot
Now let’s get started by setting up our working environment. First, we are going to mount the iso under /tmp/livecd:
$ mkdir /tmp/livecd
$ sudo mount -o loop ~/Desktop/ubuntu-7.10-desktop-i386.iso /tmp/livecd
Then create a directory containing our future CD image (cd) in our working directory (~/livecd) and copy all the CD content but casper/filesystem.squashfs in our ~/livecd/cd directory:
$ mkdir ~/livecd
$ mkdir ~/livecd/cd
$ rsync –exclude=/casper/filesystem.squashfs -a /tmp/livecd/ ~/livecd/cd
This copy all but the squashfs file, which is the compressed file containing our live CD filesystem.
Now we need to mount casper/filesystem.squashfs onto a directory called ~/livecd/squashfs in order to copy its content in a directory where we are going to edit our live CD filesystem: ~/livecd/custom
$ mkdir ~/livecd/squashfs
$ mkdir ~/livecd/custom
$ sudo modprobe squashfs
$ sudo mount -t squashfs -o loop /tmp/livecd/casper/filesystem.squashfs ~/livecd/squashfs/
$ sudo cp -a ~/livecd/squashfs/* ~/livecd/custom
And finally, let copy /etc/resolv.conf and /etc/hosts to our ~/livecd/custom/etc so we will be able to access network from within the image we are going to customize (through chroot):
$ sudo cp /etc/resolv.conf /etc/hosts ~/livecd/custom/etc/
2. Getting into our future image:
In order to customize the image, we will chroot into ~/livecd/custom directory, mount some necessary pseudo-filesystem (/proc and /sys). From there, we will be able to customize our Live CD.
$ sudo chroot ~/livecd/custom
# mount -t proc none /proc/
# mount -t sysfs none /sys/
# export HOME=/root
Now we are ready, let’s customize….
3. Customizing our future live CD
3.1. Removing packages
First of all, we are going to remove non-english language pack, and in order to free some more space, we are going to remove gnome-games packages.
# apt-get remove –purge gnome-games*
# apt-get remove –purge `dpkg-query -W –showformat=’${Package}\n’ | grep language-pack | egrep -v ‘\-en’`
Mind that you might want to remove some other software. In order to see installed software, you can run the following:
# dpkg-query -W –showformat=’${Package}\n’ | less
3.2. Updating the existing image
Now that we have remove softwares we do not need, we can update our /etc/apt/sources.list in order to enable universe and multiverse repository along with gutsy-updates, gutsy-security and the partner repository so we can install vmware-server.
Open and edit /etc/apt/sources.list
# vim /etc/apt/sources.list
and make it look like:
deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu gutsy partner
deb-src http://archive.canonical.com/ubuntu gutsy partner
Now we can update the image by running:
# apt-get update
# apt-get dist-upgrade
3.3. Installing new packages
Let install all multimedia packages that we might need. As per http://www.debuntu.org/how-to-play-dvd-under-ubuntu-linux, we need to install:
# apt-get install gstreamer0.10-ffmpeg gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse vlc mplayer mplayer-fonts
# /usr/share/doc/libdvdread3/install-css.sh
Then, let install RealPlayer:
# wget http://www.debian-multimedia.org/pool/main/r/realplay/realplayer_10.0.9-0.1_i386.deb -O /tmp/realplay.deb
# dpkg -i /tmp/realplay.deb
Now, let’s install some utils that are not included by default on Ubuntu live cd but become handy most of the time:
# apt-get install rar unrar unace-nonfree
Plus, let’s install some wireless network utils so we might be able to get wireless functionning with the live CD:
# apt-get install ndiswrapper-common ndiswrapper-utils-1.9 cabextract unshield \
bcm43xx-fwcutter \
kismet aircrack-ng
Let’s add some other network network utility tools:
# apt-get install wireshark nmap ettercap traceroute
Also, we are going to add some firefox plugins:
# apt-get install flashplugin-nonfree mozilla-plugin-vlc
On the top of this, I want to be able to use skype and vmware-server:
# apt-get install libqt4-core libqt4-gui
# wget http://skype.com/go/getskype-linux-ubuntu -O /tmp/skype.deb
# dpkg -i /tmp/skype.deb
# apt-get install vmware-server
Well, that’s about it, we now have whatever software that we (I) will need when using our live CD.
It is now about time to do some clean up.
4. Cleaning up the chroot
When we install packages, apt caches the packages, we will need to remove them in order to save some space:
# apt-get clean
Also, there is some files in /tmp that need to be removed:
# rm -rf /tmp/*
Before chrooting, we have added 2 files: /etc/hosts and /etc/resolv.conf, let remove them:
# rm -f /etc/hosts /etc/resolv.conf
Finally, we are ready to exit the chroot and repack the CD. We need first to umount /proc and /sys:
# umount /proc/
# umount /sys/
# exit
Finally, we are back to our host, as we have modified some packages, we need to rebuild some manifest files, recreate the squashfs and recreate the ISO.
5. Recreating the ISO
Fisrt, lets recreate the manifest files:
$ chmod +w ~/livecd/cd/casper/filesystem.manifest
$ sudo chroot ~/livecd/custom dpkg-query -W –showformat=’${Package} ${Version}\n’ > ~/livecd/cd/casper/filesystem.manifest
sudo cp ~/livecd/cd/casper/filesystem.manifest ~/livecd/cd/casper/filesystem.manifest-desktop
And regenerate the squashfs file:
$ sudo mksquashfs ~/livecd/custom ~/livecd/cd/casper/filesystem.squashfs
Parallel mksquashfs: Using 2 processors
Creating little endian 3.0 filesystem on ~/livecd/cd/casper/filesystem.squashfs, block size 65536.
….
….
Now, alternatively, you might want to customize the file: ~/livecd/cd/README.diskdefines
and finally, update ~/livecd/cd/md5sum.txt which contains the files in ~/livecd/cd md5 sums:
$ sudo rm ~/livecd/cd/md5sum.txt
$ sudo -s
# (cd ~/livecd/cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)
We are now almost done, the last thing left is too create the ISO with the following command:
$ cd ~/livecd/cd
$ sudo mkisofs -r -V “Ubuntu-Live-Custom” -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/Desktop/Ubuntu-Live-7.10-custom.iso .
Here you go, you can now test your image by either booting your computer with or by using a virtualization/emulation software such as qemu, kvm, vmware…..
6. Conclusion
With a bit of work, one can customize an Ubuntu Live CD in order to remove/include some softwares, make sure the live CD is up-to-date, and on the top of this, allow administrator to deploy pre-customized Ubuntu distros.
Thanks to Author, orignal link http://www.debuntu.org/how-to-customize-your-ubuntu-live-cd

