Fun with Web Browsers

Select box Plugin option is: four

For those of you who care to mess with someone.. or anyone. Just load a web page up (or their web page if they have one) and run this command in the URL:


javascript: document.body.contentEditable= "true";
document.designMode= "on"; void 0

You can mess with about anybody, enjoy.

Posted in Development, Internet, JavaScript, Software, Web Browsers | Leave a comment

A great and FREE alternative to CPANEL or PLESK (WEBMIN in VIRTUALMIN)

Select box Plugin option is: four

step 1: cut a hole in the box

Anyways i got all this from: http://www.howtoforge.com/virtual-hosting-with-virtualmin-on-centos5.1-p2

Love this, virtualmin / webmin kick the shit out of cpanel or plesk.. For full control of your web server use webmin instead of paying for cpanel or plesk. Webmin and virtualmin are both free and opensource. Feel free to try this out on your linux webservers.

To enhance security and free system resources on the system we need to disable any services that are not required. You can run this script to do this for you.

* acpid
* anacron
* apmd
* autofs
* bluetooth
* cups
* firstboot
* gpm
* haldaemon
* messagebus
* mdmonitor
* hidd
* ip6tables
* kudzu
* lvm2-monitor
* netfs
* nfslock
* pcscd
* portmap
* rpcgssd
* rpcidmapd
* sendmail
* smartd
* yum-updatesd

Basics

We need to fix a few issues to prepare the system for configuration.

* Install updates

yum upgrade

* Switch the mta to postfix

alternatives –config mta

There are 2 programs which provide ‘mta’.
Selection Command
———————————————–
1 /usr/sbin/sendmail.postfix
*+ 2 /usr/sbin/sendmail.sendmail
Enter to keep the current selection[+], or type selection number: 1

* Install caching-nameserver config:

yum install caching-nameserver

* Install Build tools:

yum install gcc cpp gcc-c++ automake automake14 automake15 automake16 automake17 openssl-devel subversion ncurses-devel -y

Configure Network Alias

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1
Modify the file /etc/sysconfig/network-scripts/ifcfg-eth0:1 to look like this:

DEVICE=eth0:1
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.6
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes

Install Webmin / Virtualmin

* Import webmin pgp key:

wget http://www.webmin.com/jcameron-key.asc
rpm –import jcameron-key.asc

* Download the rpm:

wget http://prdownloads.sourceforge.net/webadmin/webmin-1.390-1.noarch.rpm

* Verify the rpm (should say OK or else download again):

rpm –checksig webmin-1.390-1.noarch.rpm

* Install the rpm:

rpm -Uvh webmin-1.390-1.noarch.rpm

Initial Webmin Config

We need to secure webmin by editing /etc/webmin/miniserv.conf and make the following changes:

* Using SSL only:

ssl=1

* Change the port to 443 and bind to the second nic only:

port=443
bind=192.168.1.6

* Disable UDP broadcasts:

#listen=10000

* Change host lockout on login failures to 3 :

blockhost_failures=3

* Increase host lockout timeout to 120:

blockhost_time=120

* Change user lockout on login failures to 3:

blockuser_failures=3

* Change user lockout timeout to 120:

blockuser_time=120

* Change the realm to something else:

realm=cpanel

* Log logins to utmp:

utmp=1

Install the webmin Tiger theme:

* Login to webmin via https://192.168.1.5:10000 using root and your password.
* Go to webmin ? Configuration ? webmin themes.
* Select From ftp or http URL and enter http://www.stress-free.co.nz/files/theme-stressfree.tar.gz
* Click install theme.
* Click “return to list themes”.
* Select StressFree as the Current theme then click change.

Install php-pear module:
Click Here!

* Go to webmin ? webmin configuration ? webmin modules.
* Select Third party module from and enter http://www.webmin.com/download/modules/php-pear.wbm.gz.
* Click install module.

Install virtualmin:

* Go to webmin ? webmin configuration ? webmin modules.
* Select install from ftp or http URL and enter http://download.webmin.com/download/virtualmin/virtual-server-3.51.gpl.wbm.gz
* Click install module.

Remove unwanted modules Go to webmin ? webmin configuration ? delete and select the following:

* ADSL client
* Bacula backup system
* CD Burner
* CVS Server
* Cluster change passwords
* Cluster copy files
* Cluster cron jobs
* Cluster shell commands
* Cluster software packages
* Cluster usermin servers
* Cluster users and groups
* Cluster webmin servers
* Command shell
* Configuration engine
* Custom commands
* DHCP server
* Fetchmail mail retrieval
* File manager
* Frox ftp proxy
* HTTP Tunnel
* Heartbeat monitor
* IPsec VPN
* Jabber IM server
* LDAP server
* Logical volume management
* Majordomo list manager
* NFS exports
* NIS client and server
* OpenSLP server
* PPP dialin server
* PPP dialup client
* PPTP vpn server
* PPTP vpn client
* Postgresql database server
* Printer admin
* ProFTPD server
* QMAIL mail server
* SMART drive status
* SSH / Telnet login
* SSL tunnels
* SAMBA windows file sharing
* Scheduled commands
* Sendmail mail server
* Shoreline firewall
* Squid analysis report generator
* Squid proxy server
* Voicemail server
* WU-FTP server
* Idmapd server

Restart webmin:

service webmin restart

Configure Rpmforge Repo

rpm -Uhv http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Related Posts

Posted in Plesk, Web Hosting | Leave a comment

How to start MySQL on Mac if it doesn’t start on bootup

Select box Plugin option is: four

Open MySQL on Mac if it fails to start during boot

Simple terminal command:

sudo /usr/local/mysql/bin/mysqld --user=mysql

Related Posts

Posted in Mac | Leave a comment

Zen Cart Override Structure

Select box Plugin option is: four

Zencart has a great override system. I’m currently setting up a Zen Cart website and loving this override system. The only improvement I see that is REALLY NEEDED is an ADMIN OVERRIDE. That would be terrific. Until then here’s a schematic of the current Zen Cart override system.
Zen Cart Override Diagram

Related Posts

Posted in Zen Cart | Tagged , , , | Leave a comment

WordPress custom Functions.php I need. Thanks digwp.com

Select box Plugin option is: four

Completely remove the version number from pages and feeds

A commonly cited security measure for WordPress-powered sites involves removing the automatically generated version number from appearing in the section of your pages’ source code. This type of security technique is referred to as “security through obscurity,” and aims at hiding potentially sensitive information from a would-be attacker. Here’s a function that does the job:

// remove version info from head and feeds
function complete_version_removal() {
return ”;
}
add_filter(‘the_generator’, ‘complete_version_removal’);
This will remove your site’s version and generator information from all of your pages and feeds, making it a little bit harder for the bad guys and a little bit safer for you and your visitors.

Delay feed update after posting

As a chronic perfectionist, I hate it when I post something only to discover an error a few minutes later. By the time I notice, fix and update the post, it’s already been beamed out all over the freakin’ place. To prevent this, I like to take the advice of WPEngineer and give myself a little buffer period or “safety net” after publishing my posts.

// delay feed update
function publish_later_on_feed($where) {
global $wpdb;

if (is_feed()) {
// timestamp in WP-format
$now = gmdate(‘Y-m-d H:i:s’);

// value for wait; + device
$wait = ’5′; // integer

// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
$device = ‘MINUTE’; // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

// add SQL-sytax to default $where
$where .= ” AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, ‘$now’) > $wait “;
}
return $where;
}
add_filter(‘posts_where’, ‘publish_later_on_feed’);
This code quietly and automatically gives me an extra five minutes before my post is added to my feeds. If you need more or less than five minutes, just edit the “$wait” variable with the integer of your choice.

Add an Admin link to the WordPress “All-Settings” page

As we’ve explained before, WordPress makes it easy to view and edit your blog settings from the Admin area. Thanks to a file named “options.php”, WordPress will display all of your database settings and enable you to edit a majority of them. To view this page, you need to log in as Admin and enter this URL in your browser’s address bar:

http://domain.tld/wp-admin/options.php

Having access to your “All-Settings” page can be extremely helpful, so it’s nice to display a direct link for easy access. The following slice of code in your functions.php file is all that’s needed:

// admin link for all settings
function all_settings_link() {
add_options_page(__(‘All Settings’), __(‘All Settings’), ‘administrator’, ‘options.php’);
}
add_action(‘admin_menu’, ‘all_settings_link’);
Once in place, you will see a link to your “All Settings” page in the WordPress Admin. You can change the name of the link to whatever you prefer by editing the two instances of “All Settings”.

Thanks for the great code DigWP.com
http://digwp.com/2010/04/wordpress-custom-functions-php-template-part-2/

Related Posts

Posted in PHP, Wordpress | Tagged , , , , , , | 2 Comments

ZenCart update from 1.3.8 to 1.3.9a FAILURE

Select box Plugin option is: four

Anybody else update from 1.3.8 to 1.3.9 and you cannot log into the admin anymore. Just an infinite loop of typing your password over and over again to end up back at the login screen with the username and password boxes cleared. When you type the password incorrect, it lets you know, but when it’s correct you’re stuck in an infinite loop of trying to log in over and over again.

Here’s what we do to fix this problem.

Stop using chrome because it’s horrible caching system messes me up developing 100% of the time! THANKS GOOGLE!

Related Posts

Posted in Zen Cart 1.3.9a | Tagged , | 2 Comments

Zen-Cart html_output.php overrides

Select box Plugin option is: four

Zen cart’s forums and wiki are great, just somewhat of a pain in the ass, so here’s what i found that is useful, and i may use in the future too.

bunyip
Posts: 2,925
Re: Overriding functions/html_output.php
There is no in-built override system for files in the includes/functions folder, but I recentyly figured out a method to do it by utilizing the override capabilities within the autoload/init_includes system.

First, make a copy of includes/init_includes/init_general_functions.php and save it in the includes/init_includes/overrides/ folder. Then edit that file to modify the loading of the html_output.php file so that it calls the file from an overrides folder like:
Code:
require(DIR_WS_FUNCTIONS . ‘overrides/html_output.php’);
Then you can create your new folder includes/functions/overrides/, and put an edited copy of html_output in there. This way you can edit or add functions within html_output.php and not have to worry about duplicate functions warnings, or about your changes getting overwritten during an upgrade.

You can use a similar method for overriding anything in the functions or classes folders, which don’t have an inherent override capability.
__________________
Neville
An assumption is what you arrive at when you get tired of thinking…
www.customcartmods.com

Related Posts

Posted in eCommerce, Web Development & Administration, Zen Cart | Tagged , , , , | 1 Comment

Moving / Backing Up a WordPress Database

Select box Plugin option is: four

Changing or moving your database is pretty easy.  I suggest using Navicat MySQL for database backing up and moving.

With Navicat it becomes extremely easy to move a database.
First thing you do, is set up your database connections in the software.
Then you open your database you want to move or backup.
Navicat Databases / Tables view

Next Select Backups from which database you’re moving or backing up.

Navicat MySQL Backups View

Click Backup

Navicat MySQL Backup Dialog

Now click Start.  You don’t have to set anything by default, it will just make a new backup.

Navicat MySQL Backup Complete

This is how you create backups.  Moving from one database to another is very easy as well. Open your backups from the tree view.  Right Click on the backup you want to copy to another database and COPY.

Navicat MySQL Copy Backup

Now find the database you want to put the backup in.  Go to it’s backups.  And Paste the backup into the other databases backups section.

Now open that database backup, and restore it.  As long as the database your moving too doesn’t already have the same tables, you shouldn’t have a problem.

Related Posts

Posted in MySQL, Wordpress | Tagged , , , , | 1 Comment

Moving a Zen Cart Installation

Select box Plugin option is: four

Here’s how I moved my Zen Cart installation to a sub directory.

1.) Create a sub directory on your site via: FTP or however you know to.

2.) Move all files of your Zen-Cart installation into your sub directory.

3.) Edit 2 configuration files of your zen-cart.

  • /includes/configure.php
  • /admin/includes/configure.php

In /includes/configure.php you want to edit:

  • DIR_WS_CATALOG
  • DIR_WS_HTTPS_CATALOG
  • DIR_FS_CATALOG
  • DIR_FS_SQL_CACHE

In /admin/includes/configure.php you want to edit:

  • DIR_WS_ADMIN
  • DIR_WS_CATALOG
  • DIR_WS_HTTPS_ADMIN
  • DIR_WS_HTTPS_CATALOG
  • DIR_FS_ADMIN
  • DIR_FS_CATALOG

In both of these files you simply want to add your <subdirectory> followed by a forward slash /

NOTE: All directories should not have a leading slash / and SHOULD ALL have a trailing /
example:

define(‘HTTP_SERVER’, ‘http://192.168.1.1/’);

define(‘HTTP_SERVER’, ‘http://www.example.com/’);

define(‘DIR_WS_ADMIN’, ‘shopping-cart/admin/’);

4.) Now you need to access your database via: phpMyAdmin or NaviCat

In your Zen Cart database you want to edit the configuration table in the following fields:

  • Log Destination – STORE_PAGE_PARSE_TIME_LOG
  • Session Directory – SESSION_WRITE_DIRECTORY

Use the following utility if you don’t know how to do step4:

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=82

This worked great for me.
Please comment here if you try this or have any questions.
Thank you.

Related Posts

Posted in Zen Cart | Tagged , , , | Leave a comment

Linux – User Commands (finding users registered in the system)

Select box Plugin option is: four

Find all users and services registered in the system:

cat /etc/passwd

Find all users registered in the system:

cat /etc/passwd | grep “/home”

To add a user to a group:

usermod -G<group> <user>

To delete a user and their home directory: (Users can have a “home” directory)

userdel -r <user>

Things i came across setting up VPS (servers) on linux.  In the midst of creating a domain i created users and webmin failed on me, and when i fixed the issue webmin failed on me again saying this user was already existed on the unix system.  Please feel free to comment.

Related Posts

Related Posts

Posted in Linux | Tagged , , | Leave a comment