How NOT to write a BASH script.

24 01 2011

Hey all!

Found another link for you guys to peruse at your leisure. I have found BASH scripting to be pretty much the most useful thing to know when administering Linux systems. Debugging a script which won’t play fair can be really time-consuming, and these tricks might just save you a heck of a lot of time!

Anyway. Here’s the link.

n00b





Incredibly Interesting Console Commands

21 01 2011

Found an interesting page, so thought I’d post a link to it! It’s a collation of lesser known, yet incredibly useful console commands.

Here’s the link to the page.

n00b





How To: Install Indy 10 on Lazarus

17 12 2010

Hi all,

Just a link here for you. I’ve been working closely with a programmer, who has used Kylix 3 for the last 6 years, and needed to change to an IDE which is being actively developed. This required switching to the Lazarus Freepascal IDE. As all of the project files used Indy components, I was asked to find a way to install the Indy component into Lazarus. A bit of trial and error, followed by some excellent tips from the following link, and I was well away!

Anyway, here’s the link… http://forum.lazarus.freepascal.org/index.php?topic=5096

Hope it’s of use!

n00b





Linux FTP file transfer failed problems

28 10 2010

Hey all!

Really quick post this time. I was having problems FTPing out to a corporate FTP site. I could log on, but I couldn’t list, put or get anything. I called our FTP host, and they could see no problems on their end until they ran a packet capture, filtered for our IP address.

What was happening was the outbound connection from our office to the FTP server was succeeding in making a connection, but the inbound connection from the FTP site to us was blocked. I tried connecting via FTP from three machines on the same network, and two out of the three could connect. A windows machine and a different Slackware Linux machine.

After a little exploration on the subject, it turned out that the answer was a simple module loading problem. The module ip_conntrack_ftp wasn’t loaded. All it took was editing /etc/rc.d/rc.modules, searching for the line which contained modprobe ip_conntrack_ftp, and taking the hash from the beginning of the line, then manually running the command, to avoid having to reboot.

Simples!

n00b





Simple Slackware Sendmail Server

5 10 2010

Hi folks!!

I almost can’t believe how long it’s been since I last posted anything on here! I’ve learnt loads, so undoubtedly I’ll be making a few new posts in the near future! Anyway, on with the post…

Setting up Sendmail in a full install of Slackware 12+ (I’ve not tried it in any previous versions) is as easy as 123… Just su to root, and enter the following…
cd /usr/share/sendmail/cf/cf
sh Build sendmail-slackware.mc
cp sendmail-slackware.cf /etc/mail/sendmail.cf
cp submit.cf /etc/mail/
chmod +x /etc/rc.d/rc.sendmail
/etc/rc.d/rc.sendmail start

That’s it configured (in a very simple manner) and started. That wasn’t what caused me all the trouble. The pain in my neck was caused when I tried to use telnet to test the server. I typed the following…
telnet localhost 25
HELO identifymyself
MAIL FROM: myaddress@mylittleemailserver.com

For the first two commands, I got the correct response. 220 on login, then 250 after the HELO.

After the MAIL FROM command, however, I got the response “550 5.0.0. Access Denied”. After much delving into the guts of the system, and making sure that my firewall wasn’t blocking anything from 127.0.0.1, I discovered the root of the problem. I had used the hosts.allow file fairly extensively to block external and internal access to services, and I had not included sendmail into this. The simple fix to the problem was to add the following to the /etc/hosts.allow and restart the sendmail server.
sendmail : ALL@127.0.0. ALL@10.0.0. ALL@192.168.1.

Now the use of telnet to send a test email goes smoothly, as follows (server responses are in parentheses):
telnet localhost 25
(220 myserver.mydomain ESMTP Sendmail 8.14.2/8.14.2)
HELO identifymyself
(250 myserver.mydomain Hello localhost [127.0.0.1], pleased to meet you)
MAIL FROM: randomaddress@randomdomain.com
(250 2.1.0 randomaddress@randomdomain.com... Sender ok)
RCPT TO: my.email.address@my.own.domain.com
(250 2.1.5 my.email.address@my.own.domain.com... Recipient ok)
DATA
(354 Enter mail, end with "." on a line by itself)
Test Email. Just for testing purposes.
.
(250 2.0.0 0094t89gfdgd09 Message accepted for delivery)
^]
quit

I then checked my email account and found a subject-less email with the sender “randomaddress@randomdomain.com”, and the text “Test Email. Just for testing purposes.”

Fantastic!!

n00b





Low cost upgrade to a home-use modem/router

8 06 2010

Hey folks,

I recently had a problem, where due to a VPN having so many clients, the home-use wireless modem/router we were using kept bumming out and causing connectivity problems for client machines. After a bit of a think, and deciding against spending a huge amount of money on a Cisco system, I came up with the following plan…

I built a barebones PC from a VIA EPIA 15000G motherboard we had lying around, a 160Gb HDD (although much smaller would have sufficed), and a spare gigabit ethernet card. I then installed Smoothwall Express 3.0 SP1, setting it to Green and Red mode, to allow a port for connection to the LAN, and a port to connect to the Internet.

The next problem I faced was how to go about connecting to our ISP’s PPPoA connection, as Smoothwall only has the facility for connecting to PPPoE. I attempted to get a couple of home-use modems to work in full-bridge (PPPoA-PPPoE) mode, but was unsuccessful with every attempt, so shortly abandoned that as a bad job. The solution to this problem was to use a Draytek Vigor 120, which acts as a modem, and a PPPoA-PPPoE converter. The only configuration which was then needed to connect the Smoothwall box to the Internet was done very simply via Smoothwall’s sleek web browser interface.

The final issues to clear up were that there was only one LAN port on the router, and that there was no wireless function as yet. Both of these issues were cleared up by connecting a Linksys WRT54GL with DD-WRT v24 SP1 installed, configured as an access point, with the WAN port used as another switch port. This achieved both wireless connectivity and allowed access for more than one wired connection to the Internet.

Once this was set up, the BIOS on the motherboard was set to auto-restart on AC loss, and the entire kit was plugged in. Any supplemental configuration, such as NAT/port forwarding, can be very simply configured from the Smoothwall box’s web interface.

Nice and simple, and far cheaper and easier to implement than a full blown Cisco system.

As always, if anybody has any questions, or even spots any errors I’ve made, just direct them to me via the comments! I’d also be glad to hear of any potential improvements people may have to the system!

n00b





Horde/Kronolith “no free/busy url” fix.

21 04 2010

Hi guys,

I’ve recently implemented Horde as a company-wide PIM, and as with any project, it’s had its configuration-oriented teething problems. It was nothing major, but every time anybody added an event, it came up with an error “Error retrieving free/busy information for user@domain: No free/busy URL found for user@domain”. After a bit of searching, I learned that the problem was just that Kronolith needed to be told to look in the correct address book/books. All our addresses are stored in a single company address book, so all that needed doing was to go into Kronolith’s config page in Horde, then select “Address Books”, add the corporate address book to the list, then select any relevant fields in the box at the bottom. Nice and easy!

Note: In order for the free/busy URLs to work at all you have to have configured each user with a free/busy url and an entry in the Turba address book. The URL should be in the format “http://localhost/horde/kronolith/fb.php?u=username“, replacing horde with the location of your horde install, and username with the horde user, who’s account is linked with their Turba entry.

n00b