WarpConduit Computing

  • Quick Tips
  • Web Design & Development
  • WordPress Plugins
  • Home
  • Passphrase Generator
  • Password Generator
  • About
  • Contact

mailto: Email Link Obfuscation (Hiding)

April 1, 2010 by Josh Hartman

After searching for a good email link obfuscation script that allows the address to be seen as normal text i came upon a webpage that had a good solution, so i did a little reverse engineering and created this PHP script to output the same code, enjoy!

$v){
            $domain_array[$k] = strToHex($v,'%');
        }
        $domain = "'".implode("','",$domain_array);
        $domain .= "'";
        $output = $var1."=['".$user."',[".$domain."].reverse().join('.')].join('@');".$var2."=unescape(".$var1.");document.write(".$var2.".link('mai'+'lto:'+".$var1."));";
        $output = "";
        echo $output;
    }else{
        return false; //email address is not valid
    }
}

mailto_link('username@domain.com'); //use this function wherever you want an email link
?>

Filed Under: Web Design & Development Tagged With: email, link, mailto, obfuscation, php

Simple Standalone PHP Web Counter

December 3, 2009 by Josh Hartman

In my search for a simple PHP web counter it was difficult to find one that wasn’t somehow connected to an external host and didn’t write IP addresses to a file and then use resources to search the file later.  With all the NAT firewalls out there counting visitors based on IP address just doesn’t seem like a modern thing to do. I took a script by Eric Sizemore and modified it to create my own version.  What it does is add to the visitor count (stored in a txt file on the server) if they don’t have a cookie showing that they have visited before, then i set that cookie to expire after 60 days, after that if the visitor comes again they will be counted again.  It’s not the most accurate, but gives a good idea of how many people are visiting and i wanted to reduce server file operations.

The Code

  Simple Standalone PHP Web Counter (9.6 KiB, 904 hits)

Installation & Usage

  1. Unzip the code into your website’s root folder
  2. Change permissions on the counter log txt file so that it is writable (chmod 666).
  3. Add the following PHP code at the top of each root page you would like to display the counter on:
  4. Add the following PHP code where you want to have the counter display:
  5. Test the page you’ve included counter.php on and have show_counter() displayed.

Filed Under: Web Design & Development Tagged With: counter, php

Installing Metadot on Ubuntu Server 9.04

October 27, 2009 by Josh Hartman

Installing Ubuntu 9.04 on Virtual PC

Note: If not installing to Virtual PC, ignore any steps that have to do with GRUB, menu.lst and modifying the boot command line.

1. Boot to installation CD

2. Choose a language (English)

3. Press F6 and then ESC

4. Add “vga=791 noreplace-paravirt” before “quiet” in the boot command line and press ENTER

5. Choose a language (English)

6. Choose a country (United States)

7. Detect keyboard layout (No)

8. Origin of keyboard (USA)

9. Keyboard layout (USA)

10. Choose hostname (metadot6)

11. Choose time zone (Central)

12. Choose partition method (Guided – use entire disk and setup LVM)

13. Choose hard drive to partition (SCSI1 (0,0,0) – (sda))

14. Write the changes to disk and setup LVM (Yes)

15. Choose amount of volume group to use for guided partitioning (max)

16. Write the changes to disk (Yes)

17. Enter Full Name for new account

18. Enter Username for account

19. Enter Password for account

20. Encrypt your home directory (No)

21. Choose proxy (leave blank)

22. Choose upgrade management (Install security updates automatically)

23. Choose software to install (LAMP, OpenSSH, Samba)

24. Enter MYSQL root password

25. Installation is complete, continue to reboot automatically. IMPORTANT: Read next three steps before continuing

26. During boot, when GRUB menu shows, press ESC, E, and E again to edit the boot line

27. Add “vga=791 noreplace-paravirt” before “quiet” in the boot command line

28. Press ENTER and B to boot

29. Login with your admin account

30. Run: sudo nano /boot/grub/menu.lst

31. Find normal kernel boot command line in bottom part of file and add “vga=791 noreplace-paravirt” before “quiet”

32. Ctrl+O, ENTER and Ctrl+X to save and exit

33. Run: sudo reboot

 

Configure a Static IPv4 Network Address

1. Login with your admin account

2. Run: sudo nano /etc/network/interfaces

3. Remove the “iface eth0 inet dhcp” configuration line under the “# The primary network interface” section

4. Replace with the following:

iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

5. Ctrl+O, ENTER and Ctrl+X to save and exit

6. Run: sudo /etc/init.d/networking restart

7. Test pinging 192.168.1.10 from another PC

 

Install Latest Ubuntu Updates

1. Login with your admin account

2. Run: sudo apt-get update

3. Run: sudo apt-get upgrade

4. Run: sudo apt-get dist-upgrade

5. What to do with menu.lst (keep the local version)

6. Run: sudo reboot

 

Configure MySQL Server

1. Login with your admin account

2. Run: sudo nano /etc/mysql/my.cnf

3. Comment out the lines “skip-external-locking” and “bind-address = 127.0.0.1”

4. Ctrl+O and Ctrl+X to save and exit

5. Run: mysql -uroot -p mysql

6. Enter MySQL password

7. Run the following SQL commands:

update user set Host='%' where Host='127.0.0.1' and User='root';
FLUSH PRIVILEGES;
quit

8. Run: sudo /etc/init.d/mysql restart

9. Test connecting with HeidiSQL

 

Install Metadot6

1. Connect to the server with an SSH client and then login with your admin account

2. Run: sudo apt-get clean

3. Run: sudo apt-get install libapache2-mod-speedycgi speedy-cgi-perl libwww-perl libdbi-perl libapache2-mod-perl2 libapache-dbi-perl libxml-rss-perl libnet-ldap-perl liblog-agent-perl libmail-pop3client-perl libio-stringy-perl libmailtools-perl libmime-tools-perl libunicode-string-perl libspreadsheet-writeexcel-perl libdate-calc-perl libappconfig-perl libimage-size-perl libtemplate-perl liblingua-en-nameparse-perl libnumber-format-perl libxml-simple-perl libtext-csv-xs-perl libarchive-zip-perl libdate-manip-perl libxml-dumper-perl libhtml-tree-perl libhtml-format-perl

4. Run: sudo apache2ctl restart

5. Run: sudo -i

6. Run: useradd -m metadot

7. Run: passwd metadot

8. Enter password (metadot)

9. Run: chsh -s /bin/false metadot

10. Run: cd /home/metadot

11. Run: wget http://download.metadot.com/v6/Metadot6.4.5.4.tar.gz

12. Run: tar -zxvf Metadot6.4.5.4.tar.gz

13. Run: chown -R www-data.www-data metadot

14. Run: find . -type d -exec chmod 755 {} \;

15. Run: find . -type f -exec chmod 644 {} \;

16. Run: chmod -R o+w /home/metadot/metadot/sitedata

17. Run: chmod -R o+w /home/metadot/metadot/html

18. Run: chmod 640 /home/metadot/metadot/etc/metadot.conf

19. Run: exit

20. Run: sudo mysql -uroot -p mysql

21. Enter MySQL password

22. Run the following SQL commands:

INSERT INTO 'user' VALUES ('localhost','metadot',password('metadot'),'Y','Y','Y','Y','Y','Y','N','N','N','N','N','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','','0','0','0','0');
FLUSH PRIVILEGES;
CREATE DATABASE 'metadotdb';
use metadotdb;
SOURCE /home/metadot/metadot/default_data/sampledata.sql;
quit

23. Run: sudo /etc/init.d/mysql restart

24. Run: sudo nano /home/metadot/metadot/etc/metadot.conf

25. Change “pass=changeme” to “pass=metadot”

26. CTRL+O, ENTER and CTRL+X to save and exit

27. Run: sudo nano /etc/apache2/sites-available/metadot

28. Use the following configuration:



	ServerAdmin webmaster@localhost
	
	DocumentRoot /home/metadot/metadot/html
	
	
	
		DirectoryIndex index.html index.php
		
		Options Indexes FollowSymLinks MultiViews
		
		AllowOverride None
		
		Order allow,deny
		
		allow from all
	
	
	
	ErrorLog /var/log/apache2/error.log
	
	# Possible values include: debug, info, notice, warn, error, crit,
	
	# alert, emerg.
	
	LogLevel warn
	
	CustomLog /var/log/apache2/access.log combined
	
	Alias /images/ /home/metadot/metadot/html/images/
	
	Alias /js/ /home/metadot/metadot/html/js/
	
	Alias /metadot/ /home/metadot/metadot/metadot/
	
	Alias /public/ /home/metadot/metadot/sitedata/public/
	
	Alias /skins/ /home/metadot/metadot/sitedata/skins/
	
	# mod_perl2 goodness
	
	PerlOptions +Parent
	
	PerlOptions -ParseHeaders
	
	PerlSwitches -Mlib=/home/metadot/metadot/metadot
	
	
	
		use Cwd;
		
		chdir "/home/metadot/metadot/metadot/";
		
		1;
	
	
	
	
	
		DirectoryIndex index.pl
		
		SetHandler speedycgi-script
		
		PerlHandler ModPerl::Registry
		
		Options +ExecCGI
	
	


29. Run: sudo a2dissite default

30. Run: sudo a2ensite metadot

31. Run: sudo apache2ctl restart

32. Test going to http://192.168.1.10 with a browser on another PC

 

Additional Resources

Download metadot user and admin guide (PDF)
Skin cookbook (DOC)

Filed Under: Computers Tagged With: metadot, ubuntu

Create a Floating Menu with jQuery

October 7, 2009 by Josh Hartman

Here is the code you can use to create a floating jQuery menu that stays where you absolutely position it on the screen. Make sure you have jQuery loaded on whatever page you use this. Try it out yourself, check it out on JSFiddle.

HTML

Floating Menu

  • Menu Item 1
  • Menu Item 2
  • Menu Item 3
  • Menu Item 4
  • Menu Item 5
  • Menu Item 6
  • Menu Item 7
  • Menu Item 8

Javascript


CSS

#floatMenu {
	position:absolute;
	top:30%;
	left:10px;
	width:135px;
	background-color:#FFF;
	margin:0;
	padding:0;
	font-size:11px;
	border-left:1px solid #ddd;
	border-right:1px solid #ddd;
}

#floatMenu h3 {
	color:white;
	font-weight:bold;
	padding:3px;
	margin:0;
	background-color:#006;
	border-bottom:1px solid #ddd;
	border-top:1px solid #ddd;
	font-size:13px;
	text-align:center;
}

#floatMenu ul {
	margin:0;
	padding:0;
	list-style:none;
}

#floatMenu ul li {
	padding-left:10px;
	background-color:#f5f5f5;
	border-bottom:1px solid #ddd;
	border-top:1px solid #ddd;
}

#floatMenu ul li a {
	text-decoration:none;
}

Filed Under: Web Design & Development Tagged With: jquery, menu

  • « Previous Page
  • 1
  • …
  • 8
  • 9
  • 10
  • 11
  • 12
  • Next Page »

Connect

  • Facebook
  • GitHub
  • RSS
  • Twitter
  • YouTube

Recent Posts

  • Extremely Useful Applications for Web Development and IT Tasks
  • Installing BookStack Wiki on cPanel Shared Hosting
  • Media (MIME) Type Reference List

Tags

automatic benchmark cbc cipher class comparisons cpanel credit memo css decrypt encrypt font gzip htaccess html image increment javascript jquery list magento mcrypt mysql number old opencart order php profiling random redirect repository rijndael shipment software strict ubuntu url wincachegrind windows windows 7 wordpress xampp xdebug xss

Blogroll

  • CodeIgniter
  • Fusion Forward
  • jQuery
  • Nettuts+
  • Smashing Magazine

© 2023 WarpConduit Computing. All Rights Reserved.