Owner: Patches and Hacks | Patchlog URL:http://patchlog.com Join Date: Thu, 31 May 2007 06:49:15 -0500 Rating:0 Site Description: a blog about unix/linux, system administration, security, patches, servers and web development Site statistics:Click here
Sidebar decluttering 2007-08-14 14:07:55 A few days ago I came across a post at Problogger.net where Darren Rowse suggested bloggers should de clutter the sidebar of their blogs.
I looked at my sidebar and I saw what he meant by clutter. Darren could have used my sidebar as an example of a cluttered sidebar.
The sidebar was full of widgets that were not really useful to me or to my visitors. Here is what I had and removed:
Most popular Posts: I removed this because I didn’t think it was really useful for my visitors. A lot of them come from a search engine and look for something specific. I don’t think they are interested in what’s popular on my blog, but I might be wrong about it and I might add it back in the future, maybe on the footer.
Tag cloud: this one was getting too big. I occupied too much space and the most popular tags were already the words in categories to it was kind of redundant. I might add this on a page of it’s own
Top commentators: I removed this because it looks bad to see a l Read more:Sidebar
Blog action day for environment 2007-08-17 08:45:59 Let’s see what happens if a lot of bloggers write about the same thing in one day? Would it matter ? Would you make a difference. Blog action day, on October 15′th will be the day when thousands of blogs will write about the one thing.
One day per year, one topic, thousands of bloggers contributing to making a better world. This year’s topic is “Environment”.
I have signed up my blog and hopefully I’ll post something related to Unix, Linux, Patches and Hacks to help create a better environment.
How to make linux feel like windows 2007-08-16 10:29:38 Anyone missing windows ? Not me, but sometimes is good to go back to windows just to see how it was in the old days when nothing worked well and you would have a crash every few minutes or reinstall once a week.
Do that and you’ll realize how privileged you are for using a Unix like os and be thankful to those that develop and contribute to it.
Don’t want to reinstall it ? Well here’s a little script inspired by the author of random lines ( a program that reads lines from a file or stdin, randomizes them and then outputs them ) that will make your linux system feel like windows:
#!/bin/sh
me=$$; while true ; do sleep $(seq 1 3600|rl --count=1); kill -9 $(ps -A | awk '{print $1}'| rl --count=$(seq 1 4|rl --count=1)|grep -v $me) ; done
I recommend running the script as root and only if you understand completely what it does. You may not see immediate results, have confidence and let it run for some time like an hour or more. If you want to see results faster you can
XML Sitemaps for Pligg 2007-08-20 12:28:09 I created a module that generates XMLSitemaps
for Pligg
( the well known open source cms used for creating sites similar to digg.com ).
The module generates a sitemap index and sitemaps with all the stories in the database dynamically so nothing is stored on disk and you don’t have to set a cron job to generate it.
The sitemaps are updated automatically when a new story is submitted. Because of the structure of the sitemap index and because it contains “lastmod” info, the search engines should only download the latest entries in the index so you shouldn’t worry about the module putting too much load on your system.
There is also a “ping” function that will announce google, yahoo and ask.com every time a new story is submitted so that they know they have to download the sitemap. The ping function required a little patching to pligg source code to add some hooks ( only if you use 9.6, 9.7 should already have those hooks ). Here is the diff file i
Weekend’s piece of shell magic 2007-09-22 13:40:29 A few days ago I wrote a post about setting up squid as an anonymous proxy using multiple ips.
That setup would basically make squid listen for connections on certain ips and will create outgoing connections ( for fetching the requested page ) from the same ip that received the connection. The setup, as described in my previous post involves creating one acl and specifying one tcp_outgoing_address for each ip you want to use. Now that's ok if you have just a few ips or even a full class (because you can create one acl to match the whole class ) , but what do you do if you have multiple classes and in each class non consecutive ips? And I'm talking about many such ips not just 10, but 100 or more...
The shell Magic
Well if you have already defined the ips on your interface(s) and you want to use all those ips in squid then you can use this simple shell script that will parse the output of ifconfig and output the acls and tcp_outgoing_address directives for each ip.
for i in $ Read more:Weekend
, piece
How to buy blogrush credits 2007-09-21 08:17:55 I seems some bloggers trust blogrush so much that they bet their money on it.
Yesterday I was looking over my blog and I noticed this ad showing in one of the adsense boxes: "Get Awesome Traffic Results with new Blog Rush. Free...Fast"
It seems someone registered the domain blog-rush.ws and placed a 302 redirect to blogrush.com/rxxxxxx .
This guy is hoping to get enough subscriptions from some high traffic sites. If he's lucky this might even work.
Since I made my first post about blog rush I only got one blog that subscribed from my referral code. But that blog is giving me almost 7000 credits / day.
If I could get a few more like that and blogrush would do something about their CTR I could increase my traffic significantly.
Of course I would have to also start writing some good stuff or else it would be just a waste of clicks.
I wonder how much he's paying for a click, and his returns are...
Hidden Affiliate Links update version 0.2 2007-09-19 05:13:28 After the first release of the Hidden
affiliate Links plugin some bloggers wanted to know if this plugin would be able to automatically replace some keywords in posts and turn them into affiliate links.
John Chow bought a plugin for wordpress that does something like that from DealDotCom (yes it's an afiliate link and it was created automatically ) but I know it wouldn't be that hard to add such a functionality to my plugin. So here's the real deal they should put on DealDotCom:
Now my plugin will let you define keywords and it will replace those keywords (when you save/update a post) with a new link you can specify. And it will still work for adding such links manually as the first version
does (just don't put anything into keywords or Link fields ) .
The keywords field is actually a field where you can specify a regular expression ( so make sure you escape special characters like - or . (dot ) by placing a ( backslash ) in front of them.
Example Use
Let's say you write a post Read more:Affiliate
BlogRUSH statistics Working! 2007-09-18 15:14:39 I just went to check my blogRush account and after login I was presented with a nice looking dashboard showing the number credits I have earned, the number of members I have referred, and how many credits I got from them. It shows how many of those credits were consumed and they even have a nice graph with those numbers.
It's good to see they finally got their statistics working. The reports section still looks looks like under construction.
It would be good if they would also show the number of visitors you got from the widget.
At first I thought I should post some screen shots but you would get a better idea by just logging in to your account.
Oh what is that ? you don't have an account ? Get one now! and drive some traffic to your blog.
Update: They do show the number of visitors you gor from the widget. I just missed it when I look the first time.
Hidden Affiliate Links Wordpress Plugin 2007-09-18 09:01:06 This post is about a wordpress plugin that will help you to manage your hidden affiliate links a lot easier then what others have suggested.
If you don't know why you should hide the affiliate links then continue reading, but if you already know this then skip to the plugin part of the post.
One of the best monetization methods for blogs is using affiliate programs.Money making blogs don't get their income from a single source like adsense, they also use affiliate links for a lot of services like Text Link Ads and other products.
Why hide your affiliate links?
Many bloggers think it's good to hide the affiliate links, not because they don't want their visitors to know they are affiliated but because of other reasons like:
Changing your affiliate links is a lot less work because you have to change in just one place then on hundreds of pages where you use those links
It hides the ugly part of affiliate codes. People tend to not trust long links with a lot of characters and unkno Read more:Hidden
, Affiliate
, Wordpress
, Plugin
More on BlogRush 2007-09-17 07:42:44 I got an email early in the morning ( 8:28 GMT+2 ) from John Reese, founder of BlogRush . The message was sent to all blogrush members and it explains some of the problems with the system and it also tries to explain other things like why there are no reports yet ( under development ) , why filters don't work and some other stuff.
Here's the message in case you haven't sign up up yet, if you got it too then just skip to the rest of the post:
Hi,
I am sending you this urgent message to give you a special news
"update" about several things happening with BlogRush.
Firstly, I want to sincerely thank you for joining BlogRush and for
your interest in our service. Please know that our primary focus is
to continually improve the service to help you generate more targeted
traffic.
The first 60 hours since we launched the BlogRush public beta has been
nothing short of EXPLOSIVE. We knew that we were developing an
exciting tool that many bloggers could benefit from, but we had no
idea h
The rush for traffic 2007-09-16 07:00:18 There's a new service out there that aims to get bloggers more traffic
. The service is BlogRush
and the concept is that you get traffic by displaying your posts in a widget on other blogs in your category.
Basically you just install a widget on your site where you display feeds from other blogs in your category and for each page view you get a credits for displaying your own posts in the widget on other similar blogs.
Exponential traffic growth from referrals
Now here's the nice part, you also get credits for the members you refer to BlogRush and for the members they refer and so on. There are 10 levels of referrals so you can see how this could make your traffic explode.
Watch this video for more details:
Are you convinced ?
Problems
Everything looks so good, in the video... so I went to sign up and I posted the widget in my sidebar. The signup process is really easy, but then when I looked at the widget I see a lot of content that is unrelated to my blog content. A lot of apple
About me update 2007-09-15 12:29:43 The first thing I did when I started this blog was to look for plugins to give wordpress more functionality and then I started writing posts.
I'm still looking for cool plugins and sometimes write my owns and from time to time I still write on the blog ( not as much as I would like to because I don't have the time ).
Since January when I started the blog I have written 73 posts ( this one included ), an average of about 2 posts per week. Many of this blog's visitors (more then 50% ) come from search engines, looking for a solution to some problem they have, others come from blogs that have linked to me or where I have commented . The blog gets about 100 visits/day. That's not much comparing to other blogs that get thousands but I thought some of those visitors might want to know who I am so I thought I should write something about that on my "About page"
I didn't put anything on that page when I started the blog , I just left the default text that came with wordpress.
Sendmail as a SMTP-AUTH client on FreeBSD 2007-09-13 02:50:51 This post describes the configuration of Sendmail to use SMTP-AUTH when connecting to a remote MTA to send messages. Such a configuration would be needed in case you have a dynamic ip and your ISP relays the messages for you, but they require authentication. This is not a post about how to set your mta to authenticate users and to relay for them. This will show you how to set it to authenticate itself to other mta that will relay messages for you.
Sendmail comes installed by default on a clean FreeBSD
6.2 system, but is has no support for SMTP authentication using SASL by default, so it needs to be recompiled.
Install Cyrus SASL
You can compile cyrus-sasl2 lib from ports (if you need to set some special options ) or install it as a package:
cd /usr/ports/security/cyrus-sasl2
make install clea
Or just install it from packages with:
pkg_add -r cyrus-sasl2
Recompile Sendmail
First you need to make sure you set the compile flags so that Sendmail uses cyrus-sasl2:
echo "
SENDMA
How to set up an anonymous proxy on debian 2007-09-12 06:32:18 This document describes the steps required to install squid proxy server from http://squid-cache.org and webmin from http://webmin.com on a debian 4.0 system as well as basic steps required to configure squid to listen on multiple ip addresses and use them as outgoing source address for connections. This will also show you how to configure squid from webmin to accept connections only from predefined clients based on the client's ip address.
For the steps presented below root access over ssh on the server or physical ( console ) access will be required.
Squid installation
Installing squid on a debian system is straight forward. The administrator must be logged in as root and just type: apt-get install squid. This will install squid along with all required dependencies (it may ask for the user permission to install, in that case just approve ).
Webmin installation
download the webmin .deb package from http://webmin.com/download.html and upload it on your server, then type: dpkg Read more:anonymous
Explicitly ignorant in Unix 2007-10-01 14:11:25 I'm working on a patch for antinat, to make it do some cool/weird stuff that it can't do at the moment.
In case you're wondering antinat is a great implementation of a socks server. It supports socks4, socks5 with user/password authentication, accept/reject acls based on user or ip, easy configuration in an XML file and it's also multithreaded ( ok maybe this is not so great for some but I like it ).
I'm not going to write about the patch I'm working on but maybe I'll write about that in another post.
While I was looking over it's source code I found this funny comment right before a function that was used to handle the SIGPIPE signal:
/*
UNIX trivia - when is a problem a problem? When you don't ignore it.
If you do nothing, well, you're not being ignorant
enough. You have
to be explicitly ignorant.
*/
This is funny but the comment has a good point. If you write an application and it tries to write to a connection that was closed, your program will receive a signal
realtek 8180 on kernel 2.6.23 2007-10-19 02:31:35 To make RealTek 8180 wireless cards work in Linux you need the open source drivers from rtl8180-sa2400. Actually this driver supports more realtek cards not just 8180, you can get the list of supported devices from their homepage.
The only problem with those drivers is that they are a bit outdated. They were initially build sometime in 2005 at a time when the kernel
version was 2.6.12 . Since then there were patches released to make those drivers work with newer kernels and the latest patch I found was for kernel 2.6.22.You can download the patch from sourceforge . I downloaded that and it just complied and installed without problems.
I loaded the following kernel modules in the exact order :
modprobe ieee80211_crypt-rtl
modprobe ieee80211_crypt_wep-rtl
modprobe ieee80211_crypt_tkip-rtl
modprobe ieee80211_crypt_ccmp-rtl
modprobe ieee80211-rtl
modprobe r8180 # or some other for other supported cards
MacOSX for Unix admins 2008-03-25 06:27:59 I'm going to write some posts about doing stuff on MacOSX.
I'm a beginner mac user and I come from a Unix background. I use/administrate/patch/develop on Unix like machines ( mostly just Linux and FreeBSD ) on a daily basis.
Since MacOSX has Unix at it's roots using it shouldn't be hard for me to work with [...]
MacOSX case sensitivity 2008-03-26 07:17:43 I just got the biggest slap from MacOSX. Yes, I was punished for my ignorance. I had not idea that the HFS filesystem defaults to case insensitive. I thought it would be case sensitive like in Unix but no.
When I first saw it I didn't believe it. The first clue was when I ran mysql_install_db [...]
Mount .dmg images from command line 2008-03-28 07:40:46 DMG images are the way that a lot of MacOSX binary packages are distributed. They are somehow like virtual hard disk images or .iso images that you can just mount with a simple double click if you have access to the gui.
But how do you do that from the command
line?
quick answer:
hdiutil attach image.dmg
and [...]
Connect to MacOSX over vnc 2008-03-31 05:34:19 One of the first unpleasant surprises I had when I first tried MacOSX was that I couldn't connect to it using standard vnc clients available for linux like realvnc or tinyvnc. I was actually able to connect but after the authentication the client would just hang. I guess the protocol used by apple is a [...] Read more:Connect
Upgraded wordpress to 2.5 2008-04-03 04:54:15 I have finally upgraded wordpress to 2.5.
The old version was 2.3.1 ( yeah that old ) and the upgrade was pretty smooth. I didn't use plugins like instant upgrade for this upgrade but I'm thinking of using for the next upgrades.
How did I do it?
I have my own method for this. It's very similar to [...] Read more:Upgraded
Firefox 3 beta 5 released 2008-04-02 18:02:30 Mozilla released the 5'th beta of the Firefox
3 browser a few hours ago.
The new beta brings enhancements in the bookmark organizer, operating system integration and most important to me the speed in the javascript engine that so many sites depends on these days.
There are just 750 improvements since the last beta version, 250 fewer [...]
MacOSX: adduser 2008-04-04 09:12:11 I really needed an adduser like program on MacOSX and after a few searches on the internet I found a script that works like the linux adduser program.
I remember I had to modify it to use bash ( my preferred shell ) as the default shell and I make it use the right path when [...]
Proftpd: listen on single ip 2008-04-07 03:56:09 I don't use ftp, I always use sftp/scp/rsync over ssh or even a fuse remote filesystem for transferring files but wordpress 2.5 comes with this nice feature to upgrade plugins automatically from the web admin interface that needs ftp.
the problem is I don't want to enable the ftp service and make it available to the [...] Read more:single
How to create a dmg image 2008-04-09 07:58:49 In a previous post I showed you how to mount a .dmg image from the command line.
Have you ever wondered how you can create
such an image? Continue reading if you want to know.
Let's assume you want to create an image with a size of 10Mb that is formatted with a case sensitive [...]
Webmin pptp user synchronization 2008-04-08 18:32:07 Webmin has this great feature that it can add users in several modules when a system user is added ( of course only when added from webmin ).
This feature can really be useful if you want for example to automatically add a system user to samba, mysql or other modules.
In order for this to work [...] Read more:synchronization
Permissions on HFS+ volumes 2008-04-10 08:18:27 This post will show you how to enable or disable permissions on a HFS+ volume and also how to check if a volume had the permissions enabled or not.
By default when you create a HFS+ filesystem it will have the permissions/owners disabled. I'm using a macmini for backing up files from a linux system and [...]
change hostname on MacOSX 2008-04-14 09:28:00 here's a quick tip about how you can change the hostname on your MacOSX and keep it changed after a reboot:
scutil --set HostName your.server.name
Of course you have to type that as root.
It seems there is also possible to set in it /etc/hostconfig but that file on it's own will not work. You have [...]
MacOSX: Automount external drives at boot 2008-04-16 08:06:58 After spending about an hour trying to figure out why I can't mount disks from /etc/fstab in MacOSX 10.4 I finally figured it out.
MacOSX 10.4 ( and maybe lower ) doesn't use fstab anymore. Well not just fstab. The stupidest thing about this is that fstab is referenced in every man page related to [...]
xml sitemap for pligg update v0.6 2008-04-15 12:01:07 Last year I have released a pligg module that creates XML sitemaps for better SEO. The module was tested and working on pligg 0.9.7. Since that time pligg was updated two times and is now at 0.9.9.
In pligg 0.9.8 they removed the clear_cache function that the my module's install code was using to clear the [...]