My brother recently shopped for a mobile broadband to use with his laptop. SmartBro is already off his list because of bad experiences. He first went to Sun Cellular, but to his disappointment there is no 3G signal where he lives (that what he's told).
So he checked out Globe's Tattoo. To his surprise, the sales staff told him that their USB sticks are Linux friendly. That really made his day, aside from the lady being beautiful she also acknowledges support for Linux.
When he got home, he plugged the USB stick to his laptop. openSUSE 11.2 immediately detected the device and configured the drivers. The only thing he had to do was specify the APN and he was immediately online. My brother is not new to 3G broadband. He's been using different products abroad and most of them requires a lot of tinkering with drivers and tools. To him Globe Tattoo was by far he most easiest to setup.
Read full article
2009-12-19
2009-04-22
How to enable SSL on your Tracks installation.
Go to your Tracks directory and open the file: vendor/rails/railties/lib/webrick_server.rb.
Make the following changes (in bold):
.
.
That's it, your done!
Read full article
Make the following changes (in bold):
require 'webrick'.
require 'webrick/https'
require 'cgi'
require 'stringio'
require 'dispatcher'
.
.
params = { :Port => options[:port].to_i,
:ServerType => options[:server_type],
:BindAddress => options[:ip],
:SSLEnable => true,
:SSLVerifyClient => ::OpenSSL::SSL::VERIFY_NONE,
:SSLCertName => [ ["C","PH"],
["O","Ferrer Family"],
["CN", "www.ferrer.com.ph"] ] }That's it, your done!
Read full article
Labels:
Tracks OpenSSL
2009-02-22
Treadmill, at last!
Tonight I went to a gym near where I live and spent 30 minutes on the treadmill. Finally, after a lot of delays due to some unexpected events and procrastination, I have started what I have planned to do back in October 2008.
As much as I can, I will do this every morning before going to work. I noticed that I am able to think better when I do things that makes my body exert some effort rather than just spend my time sitting in front of the computer all day.
Even though I enjoyed the work out, something happened at the end that I did not expect and I felt so embarrassed :(. I stopped the treadmill at a speed of 2.0 (I don't know what that represents), suddenly I felt dizzy and looked stupid. Later at home, I learned from some articles on the Internet that this is normal and expected for beginners. Next time I know what to do :)
Read full article
As much as I can, I will do this every morning before going to work. I noticed that I am able to think better when I do things that makes my body exert some effort rather than just spend my time sitting in front of the computer all day.
Even though I enjoyed the work out, something happened at the end that I did not expect and I felt so embarrassed :(. I stopped the treadmill at a speed of 2.0 (I don't know what that represents), suddenly I felt dizzy and looked stupid. Later at home, I learned from some articles on the Internet that this is normal and expected for beginners. Next time I know what to do :)
Read full article
2009-02-08
Making the document root a symlink to another directory in openSUSE 11.1
The default Apache settings in openSUSE 11.1 does not allow you to change /srv/www/htdocs into a symlink.
To change this behavior, simply edit /etc/apache2/httpd.conf and make sure you have something like the following:
The actual value you want is FollowSymLinks (and optionally SymLinksifOwnerMatch) but the All in Options All includes this already.
You might also need to do the same thing for <Directory "/srv/www/htdocs"> in /etc/apache2/default-server.conf.
Read full article
To change this behavior, simply edit /etc/apache2/httpd.conf and make sure you have something like the following:
<Directory />
Options All
AllowOverride All
Order deny,allow
Deny from all
</Directory>
The actual value you want is FollowSymLinks (and optionally SymLinksifOwnerMatch) but the All in Options All includes this already.
You might also need to do the same thing for <Directory "/srv/www/htdocs"> in /etc/apache2/default-server.conf.
Read full article
2009-01-25
Making the microphone work in KDE 4.1.3 running on openSUSE 11.1
With the release of openSUSE 11.1 came KDE 4.1.3 which, although still not perfect, is already usable for me at home and at work.
Everything was working fine until one day when I needed to talk to someone on Skype, I discovered that the microphone was not working.
Ok, here is how I finally made the microphone to work:

It turns out the the microphone was working all along (I never modified any configuration nor modified packages).
The trick is to adjust the right channels to just about the right levels. In the screenshot above, the important channels to note are Front Mic, Front Mic Boost, Front Mic Boost (capture), Capture, Digital and Input Source.
Adjusting the levels too low and you won't hear anything. Adjusting the levels too high and you'll hear a lot of noise coming from the mic.
Your mileage may vary but I was also able to get the microphone working on two other computers (a PC and a laptop) using the steps I described above. Read full article
Everything was working fine until one day when I needed to talk to someone on Skype, I discovered that the microphone was not working.
Ok, here is how I finally made the microphone to work:
It turns out the the microphone was working all along (I never modified any configuration nor modified packages).
The trick is to adjust the right channels to just about the right levels. In the screenshot above, the important channels to note are Front Mic, Front Mic Boost, Front Mic Boost (capture), Capture, Digital and Input Source.
Adjusting the levels too low and you won't hear anything. Adjusting the levels too high and you'll hear a lot of noise coming from the mic.
Your mileage may vary but I was also able to get the microphone working on two other computers (a PC and a laptop) using the steps I described above. Read full article
2008-12-29
Headless VirtualBox VMs
A simple guide to creating and running a VirtualBox VM that does not require a graphical environment. This is useful in hosting VMs on a remote server.
The VM can be remotely accessed via RDP or SSH. RDP access is a must when SSH is not available (e.g. During OS installation). RDP also makes it possible to view the boot up sequence.
For simplicity the commands given are executed as root. Of course, creating and running a VM under a non-privileged user is also possible.
I Create a directory to store VMs:
# mkdir /home/vms
II Create a VM:
# VBoxManage createvm -name thunderchild -ostype OpenSUSE_64 -basefolder /home/vms
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
Virtual machine 'thunderchild' is created.
UUID: 02ad7a14-73ee-478b-a8f8-4da5c826d045
Settings file: '/home/vms/thunderchild/thunderchild.xml'
-------------
Note: use 'VBoxManage list ostypes' to get the ID of the OS to be installed.
III Create a hard disk:
# VBoxManage createhd -filename /home/vms/thunderchild/thunderchild.vdi -size 3500 -static
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Disk image created. UUID: 0add238a-7461-4300-8ebe-61bde0ffb38f
IV Register a VM:
# VBoxManage registervm /home/vms/thunderchild/thunderchild.xml
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
V Register a hard disk:
# VBoxManage openmedium disk /home/vms/thunderchild/thunderchild.vdi
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
VI View VM information:
# VBoxManage showvminfo thunderchild
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
Name: thunderchild
Guest OS: openSUSE (64 bit)
UUID: 02ad7a14-73ee-478b-a8f8-4da5c826d045
Config file: /home/vms/thunderchild/thunderchild.xml
Memory size: 128MB
VRAM size: 8MB
Boot menu mode: message and menu
ACPI: on
IOAPIC: on
PAE: off
Time offset: 0 ms
Hardw. virt.ext: on
Nested Paging: off
VT-x VPID: off
State: aborted (since 2008-12-29T02:41:41.000000000)
Monitor count: 1
3D Acceleration: off
Floppy: empty
SATA: disabled
IDE Controller: PIIX4
DVD: empty
NIC 1: MAC: 080027EF5AA7, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reportedspeed: 0 Mbps
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
UART 1: disabled
UART 2: disabled
Audio: disabled (Driver: Unknown, Controller: Unknown)
Clipboard Mode: Bidirectional
VRDP: disabled
USB: disabled
USB Device Filters:
Shared folders:
Guest:
Statistics update: disabled
VII Configure a VM:
# VBoxManage modifyvm thunderchild \
-memory 256 \
-boot1 dvd \
-boot2 disk \
-sata on \
-sataportcount 1 \
-sataport1 /home/vms/thunderchild/thunderchild.vdi \
-dvd /home/shared/disk_images/iso/openSUSE-11.1-DVD-x86_64.iso \
-floppy disabled \
-nic1 hostif \
-hostifdev1 eth0 \
-vrdp on \
-vrdpport 10015
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
VIII Start headless VM:
# VBoxHeadless --startvm thunderchild
VirtualBox Headless Interface 2.1.0
(C) 2008 Sun Microsystems, Inc.
All rights reserved
Listening on port 10050
IX Connect to the VM via RDP:
# rdesktop localhost:10050
X Final notes:
* Detaching the ISO image:
VBoxManage modifyvm thunderchild -dvd none
* VMs and hard disks can be registered upon creation. The register commands above (IV and V) are useful when moving VMs to a different host.
Read full article
The VM can be remotely accessed via RDP or SSH. RDP access is a must when SSH is not available (e.g. During OS installation). RDP also makes it possible to view the boot up sequence.
For simplicity the commands given are executed as root. Of course, creating and running a VM under a non-privileged user is also possible.
I Create a directory to store VMs:
# mkdir /home/vms
II Create a VM:
# VBoxManage createvm -name thunderchild -ostype OpenSUSE_64 -basefolder /home/vms
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
Virtual machine 'thunderchild' is created.
UUID: 02ad7a14-73ee-478b-a8f8-4da5c826d045
Settings file: '/home/vms/thunderchild/thunderchild.xml'
-------------
Note: use 'VBoxManage list ostypes' to get the ID of the OS to be installed.
III Create a hard disk:
# VBoxManage createhd -filename /home/vms/thunderchild/thunderchild.vdi -size 3500 -static
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Disk image created. UUID: 0add238a-7461-4300-8ebe-61bde0ffb38f
IV Register a VM:
# VBoxManage registervm /home/vms/thunderchild/thunderchild.xml
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
V Register a hard disk:
# VBoxManage openmedium disk /home/vms/thunderchild/thunderchild.vdi
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
VI View VM information:
# VBoxManage showvminfo thunderchild
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
Name: thunderchild
Guest OS: openSUSE (64 bit)
UUID: 02ad7a14-73ee-478b-a8f8-4da5c826d045
Config file: /home/vms/thunderchild/thunderchild.xml
Memory size: 128MB
VRAM size: 8MB
Boot menu mode: message and menu
ACPI: on
IOAPIC: on
PAE: off
Time offset: 0 ms
Hardw. virt.ext: on
Nested Paging: off
VT-x VPID: off
State: aborted (since 2008-12-29T02:41:41.000000000)
Monitor count: 1
3D Acceleration: off
Floppy: empty
SATA: disabled
IDE Controller: PIIX4
DVD: empty
NIC 1: MAC: 080027EF5AA7, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reportedspeed: 0 Mbps
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
UART 1: disabled
UART 2: disabled
Audio: disabled (Driver: Unknown, Controller: Unknown)
Clipboard Mode: Bidirectional
VRDP: disabled
USB: disabled
USB Device Filters:
Shared folders:
Guest:
Statistics update: disabled
VII Configure a VM:
# VBoxManage modifyvm thunderchild \
-memory 256 \
-boot1 dvd \
-boot2 disk \
-sata on \
-sataportcount 1 \
-sataport1 /home/vms/thunderchild/thunderchild.vdi \
-dvd /home/shared/disk_images/iso/openSUSE-11.1-DVD-x86_64.iso \
-floppy disabled \
-nic1 hostif \
-hostifdev1 eth0 \
-vrdp on \
-vrdpport 10015
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
VIII Start headless VM:
# VBoxHeadless --startvm thunderchild
VirtualBox Headless Interface 2.1.0
(C) 2008 Sun Microsystems, Inc.
All rights reserved
Listening on port 10050
IX Connect to the VM via RDP:
# rdesktop localhost:10050
X Final notes:
* Detaching the ISO image:
VBoxManage modifyvm thunderchild -dvd none
* VMs and hard disks can be registered upon creation. The register commands above (IV and V) are useful when moving VMs to a different host.
2008-08-02
VirtualBox Host Interface networking in openSUSE
Update (2008.12.25): With the release of VirtualBox 2.1, there is no more need to mess around with TUN/TAP devices and bridging.
---
Host Interface networking is achieved by creating TUN/TAP devices and then bridging the TAP device together with your physical network interface.
The advantage of using Host Interface over NAT is that your VM will appear as a separate physical machine on your network.
I Creating the network bridge.
Since this article is about VirtualBox Host Interface networking in openSUSE, I decided to show how it is done via YaST. A lot of information on how to do this from the command line already exists out there, just do a search on it.
You should already have an existing network setup and working properly. You also need bridge-utils and tunctl packages.
Now, fire up YaST then go to Network Devices -> Network Settings. In the Overview tab, click on your network device (usually named eth0) and then the Delete button (Figure 1).
Click on Add button. In the screen that appears, choose Network Bridge from the Device Type drop down menu (Figure 2). Click Next.
The Network Card Setup dialog box now appears. In the General tab, choose On Hotplug from the Activate Device drop down menu (Figure 3).
In the Address tab, configure the bridge the same way you would configure your primary network device. Check your primary network device under Bridged Devices (Figure 4). Click Next.
You should now see two devices in the Overview tab of the Network Settings dialog box (Figure 5).
Select your primary network device then click Edit. In the General tab, choose On Hotplug from the Activate Device drop down menu (Figure 3). Click on the Address tab then select No IP Address (Figure 6). Click Next.
It is important that you configure configure the bridge first before configuring your primary network device since YaST won't let you attach your primary network device to the bridge if it is already configured.
Go to the Hostname/DNS and Routing tabs and enter the same information you use for configuring your network. Normally you wouldn't have to do this, but double check just in case. When your done click Finish.
You have now successfully created a network bridge (br0) and added your primary network device (usually eth0) as a slave to it. You should be able to access your network and the Internet like you would have if your not using a bridge.
II Creating the TUN/TAP devices
Creating the TUN/TAP devices is easy, as root do the following:
Now go to the Adapter0 tab in the Network section of your VM settings dialog. Check Enable Network Adapter and choose Host Interface from the Attached to drop down menu. Type tap0 in Interface Name (Figure 7). Click OK.
Start your VM and once logged in, configure networking in your VM like you would configure a physical machine on your network.
The TUN/TAP devices would be destroyed when you reboot but if you want to destroy them manually, as root do the following:
---
Host Interface networking is achieved by creating TUN/TAP devices and then bridging the TAP device together with your physical network interface.
The advantage of using Host Interface over NAT is that your VM will appear as a separate physical machine on your network.
I Creating the network bridge.
Since this article is about VirtualBox Host Interface networking in openSUSE, I decided to show how it is done via YaST. A lot of information on how to do this from the command line already exists out there, just do a search on it.
You should already have an existing network setup and working properly. You also need bridge-utils and tunctl packages.
Now, fire up YaST then go to Network Devices -> Network Settings. In the Overview tab, click on your network device (usually named eth0) and then the Delete button (Figure 1).
Click on Add button. In the screen that appears, choose Network Bridge from the Device Type drop down menu (Figure 2). Click Next.
The Network Card Setup dialog box now appears. In the General tab, choose On Hotplug from the Activate Device drop down menu (Figure 3).
In the Address tab, configure the bridge the same way you would configure your primary network device. Check your primary network device under Bridged Devices (Figure 4). Click Next.
You should now see two devices in the Overview tab of the Network Settings dialog box (Figure 5).
Select your primary network device then click Edit. In the General tab, choose On Hotplug from the Activate Device drop down menu (Figure 3). Click on the Address tab then select No IP Address (Figure 6). Click Next.
It is important that you configure configure the bridge first before configuring your primary network device since YaST won't let you attach your primary network device to the bridge if it is already configured.
Go to the Hostname/DNS and Routing tabs and enter the same information you use for configuring your network. Normally you wouldn't have to do this, but double check just in case. When your done click Finish.
You have now successfully created a network bridge (br0) and added your primary network device (usually eth0) as a slave to it. You should be able to access your network and the Internet like you would have if your not using a bridge.
II Creating the TUN/TAP devices
Creating the TUN/TAP devices is easy, as root do the following:
# tunctl -t tap0 -u YOURUSERNAME
# chown root.vboxusers /dev/net/tun
# chmod g+rw /dev/net/tun
# brctl addif br0 tap0
# ifconfig tap0 up
Now go to the Adapter0 tab in the Network section of your VM settings dialog. Check Enable Network Adapter and choose Host Interface from the Attached to drop down menu. Type tap0 in Interface Name (Figure 7). Click OK.
Start your VM and once logged in, configure networking in your VM like you would configure a physical machine on your network.
The TUN/TAP devices would be destroyed when you reboot but if you want to destroy them manually, as root do the following:
# ifconfig tap0 downRead full article
# brctl delif br0 tap0
# tunctl -d tap0
2008-07-19
Disposable emails with GMail
GMail has this nifty feature known as an address alias. Instead of giving away your main GMail address, you can use something like juandelacruz+youtube@gmail.com to sign up to YouTube. When GMail receives an email for juandelacruz+youtube@gmail.com it will send it to juandelacruz@gmail.com.
GMail will simply ignore everything from the + sign and before the @ sign. You can have address aliases like juandelacruz+rockmagazine@gmail.com, juandelacruz+rockerforums@gmail.com, juandelacruz+pinoyrockers@gmail.com to sign up to different forums, websites, mailing lists, etc.
Using filters, you can automatically redirect emails received under an address alias to Trash, apply a label or simply delete them.
Address aliases combined with filters gives you virtually unlimited disposable emails. Read full article
GMail will simply ignore everything from the + sign and before the @ sign. You can have address aliases like juandelacruz+rockmagazine@gmail.com, juandelacruz+rockerforums@gmail.com, juandelacruz+pinoyrockers@gmail.com to sign up to different forums, websites, mailing lists, etc.
Using filters, you can automatically redirect emails received under an address alias to Trash, apply a label or simply delete them.
Address aliases combined with filters gives you virtually unlimited disposable emails. Read full article
Labels:
address alias,
GMail
2008-04-14
Running Azureus 3 on a headless Linux box
If you are using a dedicated Linux computer for firewall and routing like I do, you might want to run Azureus on it and be able to access your torrents from any computer on your LAN.
The plugin Azureus HTML WebUI makes this possible. With this plugin you can access Azureus remotely and start/stop torrents using any browser (not sure whether you need JavaScript or not).
Please note that there is also another way of doing this, and that is through AzSMRC (pronounced AzSmirk). However, you need to have a Java-enabled browser.
1. Download
- Azureus (3.0.5.0 as of this writing)
- Azureus HTML WebUI (0.7.6 as of this writing)
- logs4j.jar
- commons-cli.jar
You will also need Java installed to run Azureus.
2. Preparations
# groupadd azureus
# useradd -g azureus -m -s /bin/bash azureus
# tar -xjf Azureus_3.0.5.0_linux.tar.bz2 -C /home/azureus
# mkdir /home/azureus/plugins/azhtmlwebui
- Copy logs4j.jar and commons-cli.jar to /home/azureus.
- Copy azhtmlwebui_0.7.6.jar to /home/azureus/plugins/azhtmlwebui.
# chown azureus:azureus /home/azureus -R
3. Run Azureus
su azureus -c "java -Dazureus.config.path=/home/azureus -Dazureus.install.path=/home/azureus -jar /home/azureus/Azureus2.jar --ui=console"
4. Configure
After doing step 3, you will be dropped into Azureus' command line interface. Type the following:
set "Use default data dir" 1
set "General_sDefaultSave_Directory" "/home/azureus/downloads"
5. Restart Azureus
While still logged in, type:
quit
Now this time, run Azureus like this:
su azureus -c "java -Dazureus.config.path=/home/azureus -Dazureus.install.path=/home/azureus -jar /home/azureus/Azureus2.jar --ui=console > /dev/null 2>&1 < /dev/null &"
This will make Azureus run in the background so you can log out from the terminal and leave Azureus running indefinitely. You can also create an init script and put it in there, however, that is beyond the scope of this article.
6. Usage
Simply point your browser to http://thehost.thedomain.com:6886. The interface is very intuitive so I don't need to write about it.
Enjoy!
resources:
- http://gentoo-wiki.info/Azureus
- http://www.azureuswiki.com/index.php/DaemonizedAzureus
- http://azsmrc.sourceforge.net/index.php
- http://azureuswiki.com/index.php/AzSMRC
Read full article
The plugin Azureus HTML WebUI makes this possible. With this plugin you can access Azureus remotely and start/stop torrents using any browser (not sure whether you need JavaScript or not).
Please note that there is also another way of doing this, and that is through AzSMRC (pronounced AzSmirk). However, you need to have a Java-enabled browser.
1. Download
- Azureus (3.0.5.0 as of this writing)
- Azureus HTML WebUI (0.7.6 as of this writing)
- logs4j.jar
- commons-cli.jar
You will also need Java installed to run Azureus.
2. Preparations
# groupadd azureus
# useradd -g azureus -m -s /bin/bash azureus
# tar -xjf Azureus_3.0.5.0_linux.tar.bz2 -C /home/azureus
# mkdir /home/azureus/plugins/azhtmlwebui
- Copy logs4j.jar and commons-cli.jar to /home/azureus.
- Copy azhtmlwebui_0.7.6.jar to /home/azureus/plugins/azhtmlwebui.
# chown azureus:azureus /home/azureus -R
3. Run Azureus
su azureus -c "java -Dazureus.config.path=/home/azureus -Dazureus.install.path=/home/azureus -jar /home/azureus/Azureus2.jar --ui=console"
4. Configure
After doing step 3, you will be dropped into Azureus' command line interface. Type the following:
set "Use default data dir" 1
set "General_sDefaultSave_Directory" "/home/azureus/downloads"
5. Restart Azureus
While still logged in, type:
quit
Now this time, run Azureus like this:
su azureus -c "java -Dazureus.config.path=/home/azureus -Dazureus.install.path=/home/azureus -jar /home/azureus/Azureus2.jar --ui=console > /dev/null 2>&1 < /dev/null &"
This will make Azureus run in the background so you can log out from the terminal and leave Azureus running indefinitely. You can also create an init script and put it in there, however, that is beyond the scope of this article.
6. Usage
Simply point your browser to http://thehost.thedomain.com:6886. The interface is very intuitive so I don't need to write about it.
Enjoy!
resources:
- http://gentoo-wiki.info/Azureus
- http://www.azureuswiki.com/index.php/DaemonizedAzureus
- http://azsmrc.sourceforge.net/index.php
- http://azureuswiki.com/index.php/AzSMRC
Read full article
Labels:
BitTorrent,
Headless Azureus,
Torrents
2008-04-13
BIND9 for a home network on Debian 4.0 ("etch")
This is how I installed BIND9 on Debian 4.0 ("etch") for my home network. BIND9 is running chrooted and since this is only for a small LAN, there is no secondary DNS server.
When It comes to DNS servers people think of them as a big and complicated piece of software. It turns out that running your own DNS server is very simple, if you can work with Apache or PHP configuration files you can also work with zone files.
1. Install
# aptitude install --without-recommends bind9
2. Configure
Make sure BIND9 is not running.
# invoke-rc.d bind9 stop
/etc/default/bind9:
OPTIONS="-u bind -t /var/lib/named"
RESOLVCONF=yes
2.1. Create chroot environment
# mkdir -p /var/lib/named/etc
# mkdir /var/lib/named/dev
# mkdir -p /var/lib/named/var/cache/bind
# mkdir -p /var/lib/named/var/run/bind/run
# mknod /var/lib/named/dev/null c 1 3
# mknod /var/lib/named/dev/random c 1 8
2.2 Move the default configuration directory to the chroot environment.
# mv /etc/bind /var/lib/named/etc
# ln -s /var/lib/named/etc/bind /etc/bind
2.3 Fix ownership and permission of the chroot environment.
# chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
# chown -R bind:bind /var/lib/named/var/*
# chown -R bind:bind /var/lib/named/etc/bind
2.4. Receive system logs from the chroot environment
/etc/default/syslogd:
SYSLOGD="-a /var/lib/named/dev/log"
# invoke-rc.d sysklogd restart
3. Start BIND9
# invoke-rc.d bind9 start
4. Use
/etc/resolv.conf:
domain thedomain.com
nameserver 127.0.0.1
At this point you should be able to access the Internet without using the nameservers your ISP gave you. The line
domain thedomain.com
makes using short names possible (i.e thehost.thedomain.com can be shortened to just thehost)
4. Setting up a zone
You did not went to the hassle of setting up BIND just to have a fancy replacement for your ISPs nameservers did you? Well this is the fun part of running your own DNS server, creating zones.
/etc/bind/named.conf.local:
zone "thedomain.com" {
type master;
file "/etc/bind/thedomain.com.db";
};
zone "10.168.192.in-addr.arpa" {
type master;
file "/etc/bind/192.168.10.rev";
};
/etc/bind/thedomain.com.db:
$TTL 3d
@ IN SOA ns.thedomain.com. thecontact.thedomain.com. (
2008041304
1h
15m
1w
3d )
IN NS ns.thedomain.com.
@ IN A 192.168.10.1
ns1 IN A 192.168.10.1
thehost1 IN A 192.168.10.1
thehost2 IN A 192.168.10.2
thehost3 IN A 192.168.10.3
/etc/bind/192.168.10.rev:
$TTL 3d
@ IN SOA ns.thedomain.com. thecontact.thedomain.com. (
2008041304
1h
15m
1w
3d )
IN NS ns.thedomain.com.
1 IN PTR thedomain.com.
2 IN PTR thehost2.thedomain.com.
3 IN PTR thehost3.thedomain.com.
5. Make BIND9 aware of the new changes.
# invoke-rc.d bind9 reload
Resources
Read full article
When It comes to DNS servers people think of them as a big and complicated piece of software. It turns out that running your own DNS server is very simple, if you can work with Apache or PHP configuration files you can also work with zone files.
1. Install
# aptitude install --without-recommends bind9
2. Configure
Make sure BIND9 is not running.
# invoke-rc.d bind9 stop
/etc/default/bind9:
OPTIONS="-u bind -t /var/lib/named"
RESOLVCONF=yes
2.1. Create chroot environment
# mkdir -p /var/lib/named/etc
# mkdir /var/lib/named/dev
# mkdir -p /var/lib/named/var/cache/bind
# mkdir -p /var/lib/named/var/run/bind/run
# mknod /var/lib/named/dev/null c 1 3
# mknod /var/lib/named/dev/random c 1 8
2.2 Move the default configuration directory to the chroot environment.
# mv /etc/bind /var/lib/named/etc
# ln -s /var/lib/named/etc/bind /etc/bind
2.3 Fix ownership and permission of the chroot environment.
# chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
# chown -R bind:bind /var/lib/named/var/*
# chown -R bind:bind /var/lib/named/etc/bind
2.4. Receive system logs from the chroot environment
/etc/default/syslogd:
SYSLOGD="-a /var/lib/named/dev/log"
# invoke-rc.d sysklogd restart
3. Start BIND9
# invoke-rc.d bind9 start
4. Use
/etc/resolv.conf:
domain thedomain.com
nameserver 127.0.0.1
At this point you should be able to access the Internet without using the nameservers your ISP gave you. The line
domain thedomain.com
makes using short names possible (i.e thehost.thedomain.com can be shortened to just thehost)
4. Setting up a zone
You did not went to the hassle of setting up BIND just to have a fancy replacement for your ISPs nameservers did you? Well this is the fun part of running your own DNS server, creating zones.
/etc/bind/named.conf.local:
zone "thedomain.com" {
type master;
file "/etc/bind/thedomain.com.db";
};
zone "10.168.192.in-addr.arpa" {
type master;
file "/etc/bind/192.168.10.rev";
};
/etc/bind/thedomain.com.db:
$TTL 3d
@ IN SOA ns.thedomain.com. thecontact.thedomain.com. (
2008041304
1h
15m
1w
3d )
IN NS ns.thedomain.com.
@ IN A 192.168.10.1
ns1 IN A 192.168.10.1
thehost1 IN A 192.168.10.1
thehost2 IN A 192.168.10.2
thehost3 IN A 192.168.10.3
/etc/bind/192.168.10.rev:
$TTL 3d
@ IN SOA ns.thedomain.com. thecontact.thedomain.com. (
2008041304
1h
15m
1w
3d )
IN NS ns.thedomain.com.
1 IN PTR thedomain.com.
2 IN PTR thehost2.thedomain.com.
3 IN PTR thehost3.thedomain.com.
5. Make BIND9 aware of the new changes.
# invoke-rc.d bind9 reload
Resources
Read full article
2008-04-12
RPM quick reference
At work, most of my package management routines are done using yum. However, sometimes I find myself needing to use the rpm command so I made this short and simple note as a reference.
- Install a package
# rpm -i package.rpm - Upgrage a package
# rpm -U package.rpm - List installed packages
# rpm -qa - Remove package
# rpm -e package
Labels:
RPM
Search and replace accross multiple files with find and sed
With find and sed, applying the same changes to multiple files is easy.
Here's how:
$ find . -type f -exec /bin/sed -i -e 's/SEARCH/REPLACE/g' '{}' ';'
In the above example, SEARCH is the text being searched and REPLACE is the text to replace SEARCH with.
Read full article
Here's how:
$ find . -type f -exec /bin/sed -i -e 's/SEARCH/REPLACE/g' '{}' ';'
In the above example, SEARCH is the text being searched and REPLACE is the text to replace SEARCH with.
Read full article
How to mount an ISO image via a loop device
One way to access the contents of an ISO image in Linux is to mount it via the loop device.
Suppose you have an ISO image named thedisc.iso, here's how it's done:
# mkdir /mnt/thedisc
# mount thedisc.iso /mnt/loop/ -t auto -o loop=/dev/loop0
Of course, you only create the mount directory once. Depending on your setup, you could have several loop devices (loop1, loop2, etc.).
Read full article
Suppose you have an ISO image named thedisc.iso, here's how it's done:
# mkdir /mnt/thedisc
# mount thedisc.iso /mnt/loop/ -t auto -o loop=/dev/loop0
Of course, you only create the mount directory once. Depending on your setup, you could have several loop devices (loop1, loop2, etc.).
Read full article
Labels:
Linux,
loop device,
mount
Subscribe to:
Posts (Atom)







