Author: Jon

Drupal 4.7.0 Released

Drupal 4.7.0 Released

From the Drupal Homepage:

After more than a year of development we are ready to release Drupal 4.7.0 to the world. More than five years, 13 major releases, 30+ servicing firms employing 100+ Drupal professionals, 300+ third party modules, and over 55,000+ Drupal powered sites later, Drupal 4.7.0 is finally here and it rocks!

Needless to say, I’m going to be updating this version very quickly, aka as soon as my laptop starts up. Look for the next post to be from Drupal 4.7.0!

Later,
Jon Howe

JustBlogIt

JustBlogIt

I’m posting this from a Firefox extension called JustBlogIt. You can find it here. It puts a new item in your right-click menu and let’s you blog links and pages that you find.  Only problem is, that function doesn’t work with Drupal. I’m sure it’s supposed to, but I’m not sure exactly how Drupal works, so all I can get is the page to post content.

uTorrent RSS

uTorrent RSS

Adding a feed

Click on the RSS button, then click Add. Paste in the feed URL and hit OK. If you want to name the feed, simply type the name in front of the URL, like so:
TV Feed|http://somesite.com/rss.xml (NO SPACE BEFORE OR AFTER THE | )

Note that the RSS Downloader will NOT consume any extra resources if you have no feeds present/enabled. Some feeds do not give direct links to the .torrent files (most notably Mininova) and as such won’t work, but you can use the MiniRSS feed fixer to modify those feeds to work properly. For Mininova’s feeds, you can use MiniRSS.org

Disabling a feed or filter

Simply uncheck the box next to the feed or filter, and it will no longer be used.

Renaming a feed or filter

You can rename a feed by selecting it, then single clicking or pressing F2. You can do the same thing for renaming filters.

Sorting filters

You can sort filters by drag and drop. Simply click, hold, and drag to wherever in the list you’d like it.

Using feeds that require HTTP authentication

For feeds that require HTTP authentication, simply use this format for the feed URL: http://username:password@sometorrentsite.com/rss.php

Using feeds that require cookies

To use feeds that require cookies, you must find the cookie for the site, and grab UID and pass from it.

* IE users will find their cookies in %UserProfile%Cookies
* Firefox users will find their cookies in Tools -> Options -> Privacy -> Cookies -> View Cookies
* Opera users will find their cookies in Tools -> Advanced -> Cookies, but they must scroll down manually, find doesn’t work
* Users of other browsers will have to consult their browser’s documentation

Once you have the appropriate information, use this format for the feed URL:
http://sometorrentsite.com/rss.php:COOKIE:…jh12378912y3lkj

Some sites do not use uid and pass as the variables, or use additional ones, so you MUST use the exact variable name and the extra variables they specify! For example, on a certain site, it uses id, password, and secure as the cookie variables you must use.

Automatically downloading torrents

To automatically download specific torrents from a feed, you can use Favorites to specify your own filters to grab torrents. It does NOT support regular expressions. Here’s a tutorial explaining the various options and how to use them (with examples).

* Hit Add, then type the name of the filter.
* Click on the editbox next to Filter: and add your filter. The allowed wildcards are * ? and |. An example of a filter you could use would be *MP3 Archives*
If you have a strange feed using underscores or something besides periods, you can also try something like *Go?Open*
You cannot specify the season or episode number in the filter if it is decoded by

AJAX Based MySql Live Search

AJAX Based MySql Live Search

This is a little something that I made up this afternoon at school.

It’s an implementation of a search app with out a celing. In other words , there’s no submit button. With each keystoke that you type, the query get’s more accurate.

If you just want to check it out (with source, and an example) then Click Here
The code is commented pretty well.

If you want a little explanation read on.

I used a library called Xajax for this project (and the last one as well). It’s an extremely useful and easy to use library because of the fact that it doesn’t require the coder to know any javascript. This is a goood thing, because I HATe javascript.

The Xajax library allows you to take a PHP function and essentially use it as a javascript function asynchronously.

What this script does is check to see if the user presses a key. Each time that they do the PHP function autoSearch() runs. autoSearch() has one paramater, the current value of the input box. Read the code comments for more info on this.

If the entered query is 2 or more charachters, then a mysql query is executed. If there are result(s), then they are diplayed.

Practical Application:
Personally, I hope to use this in the content mananagement system that I’ll be starting soon. I’m planning on having it parse through blog entries, and display the title and the publishing date of the post.

When you click on the link above you’ll see the example page. At the bottom of it are links to the PHP source, as well as the MySql Source.

If you have any questions email me at “howe -dot- jon – at – gmail – dot – com”, and I’ll get back as soon as I can.

Later,
Jon Howe

How to get Logitech mice to work in Ubuntu

How to get Logitech mice to work in Ubuntu

Most Logitech mice are connected via USB, and I have not tested this with PS/2 mice.

Open xorg.conf

sudo gedit /etc/X11/xorg.conf

Now find the section that says something like:

Section "InputDevice"
Identifier "Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
Option "Buttons" "7"
EndSection

and comment it out by putting a # symbol in front of each line. It should look like this:

#Section "InputDevice"
# Identifier "Mouse"
# Driver "mouse"
# Option "CorePointer"
# Option "Device" "/dev/input/mice"
# Option "Protocol" "ImPS/2"
# Option "Emulate3Buttons" "true"
# Option "ZAxisMapping" "4 5"
# Option "Buttons" "7"
#EndSection

Now make some space under or above that section and paste in the following:

Section "InputDevice"
Identifier "Mouse"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Name" "Logitech USB-PS/2 Optical Mouse"
Option "Dev Phys" "usb-*/input0"
Option "Device" "/dev/input/event2"
Option "Buttons" "10"
Option "ZAxisMapping" "4 5"
EndSection

Save the file and restart the X server by pressing Ctrl+Alt+Backspace.

Note: If the X server fails to start, use the command “sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf” to restore your original settings.

After the X server is restarted and your mouse is still working, you have to edit the .Xmodmap file.

sudo gedit ~/.Xmodmap

Paste the line “pointer = 1 2 3 6 7 8 9 10 4 5” without quotes in this file. If there’s already a “pointer” section, overwrite it.

Now run xmodmap to apply the settings:

xmodmap ~/.Xmodmap

Now to get the side buttons working in Nautilus and Firefox. Install xvkbd and xbindkeys with:

sudo apt-get install xvkbd xbindkeys

Create a configuration file for these new program by:

gedit ~/.xbindkeysrc

Paste the following into that file, then save and exit:

"/usr/X11R6/bin/xvkbd -xsendevent -text "[Alt_L][Left]""
m:0x0 + b:6
"/usr/X11R6/bin/xvkbd -xsendevent -text "[Alt_L][Right]""
m:0x0 + b:7

Now add this program to you session by adding it to “System > Preferences > Sessions”. Click on the “Startup Programs” tab and click “Add” and enter “xbindkeys”. This makes sure that everytime you log in, your setting are loaded.

Install the logitech applet (not really an applet by the way) by:

sudo apt-get install checkinstall build-essential libusb-dev
wget http://freshmeat.net/redir/logitech_applet/53319/url_tgz/logitech_applet-0.4test1.tar.gz
tar xvfz logitech_applet-0.4test1.tar.gz
mv ./logitech_applet-0.4test1 ./logitech-applet-0.4test1
cd ./logitech-applet-0.4test1
./configure --prefix=/usr
make
sudo checkinstall

Just hit enter when checkinstall prompts you. Everything should now be installed.

Use the command:

sudo logitech_applet -s 800 -e

This sets you mouse at optimum resolution. You might have to adjust the mouse setting in Gnome as the mouse will be much more accurate now. Go to “System > Preferences > Mouse” and adjust the settings to your liking.

Now to make all this load at boot time. Make a file in /etc/init.d/local to keep local settings.

sudo gedit /etc/init.d/local

Paste this into the file, save, and exit:

echo "Setting up Logitech mouse..."
logitech_applet -s 800 -e

Make that file executable by:

sudo chmod 755 /etc/init.d/local

Now run the following command to make the “local” script run when the system boots:

sudo update-rc.d local defaults

Now you should have a fully working Logitech USB mouse in Ubuntu.

Howto: AJAX Regular Expression Email Verifier

Howto: AJAX Regular Expression Email Verifier

It’s important to do form validation for obvious reasons. This is an implementation of an email checker that uses php regular expressions, and a little bet if pizzaz with asynchronous javascript and xml, or AJAX.

Here’s the example.

A quick rundown of how this works is:

  1. You type in a string
  2. You hit submit
  3. The data is transfered asynchronously (without refreshing the page) to the server
  4. The server checks to see if the email is valid or invalid
  5. If it’s valid it tells you so, as well as if it’s not
  6. The guts of the script are here:
    if (eregi("^[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-_.]+$",$email)) {
    //return confirmation that it worked
    }
    else {
    //return that it didn't work
    }

    Basically, it checks to see if there’s either a lowercase or uppercase a-z or 0-9 or an underscore, or a dash, or a period before the @ sign ([a-zA-Z0-9_-.+]+@). Then after the @ sign it checks for the same thing except for the period and the underscore up until another dot. After that dot it checks once again for the same charachters as the first set.

    Hopefully this helps someone. If you have any questions feel free to email me at “howe -dot- jon -at- gmail -dot- com” and I’ll help you however I can.

    Later,
    Jon Howe

Howto: Set Up Your Own Snort Intrusion Detection System with a Database Backend

Howto: Set Up Your Own Snort Intrusion Detection System with a Database Backend

Okay, truth told, I’m completely bored, so I’m going to write a quick tutorial on how to install and set up the Snort IDS on a Debian Sarge System (although it should work on other distros as well).

Download and Install Snort
apt-get install snort-mysql

Enter values in the following screen, but forget about the part about the database
cd /usr/share/doc/snort-mysql
mysqladmin -u -p create
zcat create_mysql.gz | mysql -u -p

HOWTO: Create a Logging Redirection Page using PHP and MYSql

HOWTO: Create a Logging Redirection Page using PHP and MYSql

Since I’ve already been on the topic of doing small beginner PHP tutorials, here’s another one. This one is pretty self explanitory.

You can see it here.

Basically what this does is let you enter a domain or page or whatever and it redirects you to the page. On top of just redirecting you, it logs all of the redirections along with the request date, and requester ip address.

If you have a need for this, you’ll most likely know how to implement it. If not, feel free, as always, to email me (howe -dot- jon -at- gmail -dot- com), and I’d be happy to help you out to the best of my abilities.

Later,
Jon Howe

Howto: PHP Secure Download Script

Howto: PHP Secure Download Script

I’ve been wanting to make a script in PHP that handles downloads for a while. Last night I was bored, so I made one.

DISCLAIMER:
This is a very basic example, but if you have any use for this, I’m sure that you can figure out how to use it. If not, I’ll probably work more with it in the future anyways.

This system works with two PHP files.

If you just want to see the script work, go Here.

From there you can download a sample file and see the source of the scripts.

Now, for how it works…

All that the first script (dl.php) does is display a link to the main download script (which handles the actual download) and sets a session variable for 60 seconds in the future.

Once you click on the link, the main download script (dl2.php) sets another session variable containing the time that the link was clicked.

It checks to see if the time that dl.php was generated no more than 60 seconds later than the link was clicked. If it was later than that the download fails.

Feel free to email me (howe -dot- jon -at- gmail -dot- com) if you have any questions, or requests or whatever, and I’ll do my best to get back to you that day.

Later,
Jon Howe

Copyright VirtJunkie.com © 2024