Using SSH without using or needing a password

Linux SSH keygen -t DSA command executionI’ve tried many methods now of using SSH keys to login without a password.  Needless to say, I had to mix a couple methods to make this work.  This isn’t that hard.

Step 1) You’re on a linux machine (or putty’d into a linux box) trying to SSH into a remote host without having to use a password.   In my case i need to run automated commands to upload files to a remote host.  You need to create a SSH key for both machine.  Do this by running the following command:

ssh-keygen -t rsa

The default file should already be set, press enter.

The passphrase will remain empty (since you don’t want to type it every time you log in) Press Enter again.

Then press Enter for a third time to confirm the empty passphrase.

It should look something like the picture above.

Step 2) Upload the SSH Public Key to the remote server.  Use the following command:

scp ~/.ssh/id_rsa.pub username@whateveryourdomain.com:.ssh/authorized_keys

This will upload the file to your remote and will place the pub key file in .ssh/authorized_keys.

upload ssh key to remote host

Now type “logout” to get out of your remote host’s SSH.  Then log back in via:

SSH user@remotehost.com

It shouldn’t ask for a password anymore.  If any of this information doesn’t apply to you, or you have any questions please feel free to ask.  Thanks for reading.

Thanks to the 2 sources that I used to come up with my own, thank you:
http://support.suso.com/supki/SSH_Tutorial_for_Linux
http://linuxproblem.org/art_9.html

~Steven Kohlmeyer

Posted in techblog | Leave a comment

WordPress Starter Plugin

Everything you need to write your own plugin. This is the starter solution. It shows how to plugin with your own class to wordpress, already set up custom functions. This is version 1 of this empty plugin. The admin menu (with a submenu), a settings page, another settings page. You can do just about anything your heart desires with wordpress, and plugging into it is pretty easy. Check this out:

/////////////////////////////////////////////////////////////////
/*
Plugin Name: Steve's Starter Plugin
Plugin URI: http://stevesplugin.StevenKohlmeyer.com/
Version: v1.00
Author: Steven Kohlmeyer
Description: A starter Plugin to write any plugins from.
Copyright 2010  Steven Kohlmeyer  (email : StevenKohlmeyer [a t ] g m ail DOT com)
*/

/*  Copyright 2010
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

if( !class_exists('MY_Plugin') )
{
	class MY_Plugin
	{
		var $thispluginurl = '';
		var $thispluginpath = '';
		var $adminOptionsName = "MY_Options";  

		function MY_Plugin()
		{
			//constructor
		}
		function init()
        {
            $this->getAdminOptions();
        }
		function getAdminOptions()
        {
			$MYPluginOptions = array(
                'abc' => '',
                'def' => '',
                'ghi' => '',
				'jkl' => '',
				'mno' => '',
				'pqr' => '',
				'stu' => '');
			$MYOptions = get_option($this->adminOptionsName);
			if (!empty($MYOptions))
            {
                foreach ($MYOptions as $key => $option)
                {
                    $MYPluginOptions[$key] = $option;
                }
            }
            update_option($this->adminOptionsName, $MYPluginOptions);
            return $MYPluginOptions;
		}
		function printAdminPage()
		{
			global $wpdb;
			$MYOptions = $this->getAdminOptions();

			//Print Admin Settings Page Here

			echo "Admin Page Settings. . . . . . . .
n";
		}
		function printImportPage()
		{
			global $wpdb;
			$MYOptions = $this->getAdminOptions();

			//Print Admin Settings Page Here

			echo "Import Page . . . . . . . .
n";
		}

	}
}

if (class_exists("MY_Plugin"))
{
    $MY = new MY_Plugin();
}
if (!function_exists("MY_admin"))
{
    function MY_admin_menu()
	{
		global $MY;
		if (!isset($MY))
        {
            return;
        }
		if (function_exists('add_menu_page'))
        {
			//add_menu_page('Page title', 'Top-level menu title', 'manage_options', 'my-top-level-handle', 'my_magic_function');
            add_menu_page( 'MY Settings', 'MY', 'install_plugins', basename(__FILE__), array(&$MY, 'printAdminPage'), 'icon.jpg', 1 );
			//add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );

		}
		if (function_exists('add_submenu_page'))
		{
			add_submenu_page( basename(__FILE__), 'MY Settings', 'Settings', 'install_plugins', basename(__FILE__), array(&$MY, 'printAdminPage'));
			add_submenu_page( basename(__FILE__), 'MY Import', 'Import', 'install_plugins', 'MY_import.php', array(&$MY, 'printImportPage'));
			//add_submenu_page( 'my-top-level-handle', 'Page title', 'Sub-menu title', 'manage_options', 'my-submenu-handle', 'my_magic_function');

		}

	}
}

if (isset($MY))
{
	//Actions here
	add_action('admin_menu', 'MY_admin_menu');

	//Filters here

}
Posted in Internet, PHP, techblog, Web Development & Administration, Wordpress | 2 Comments

WordPress custom menu disappear on home page when using custom post types and/or taxonomies.

Wordpress custom menu disappears on home page.

As you’re developing a theme, you try one of WordPress’s newer options: Custom Post Types.  Searching the internet you stumble upon Justin Tadlock’s blog.  You try his way of showing custom post types on your home page of your wordpress blog.  Then boom. You’re custom menu is not showing on your homepage.  Now what do you do.

I spent about a week going back and forth with my custom taxonomies, and WordPress 3.0′s new custom menu editor trying to figure out why the hell my home page isn’t showing my custom menu.  It shows all on my other pages.

Out of all the code, from all over the internet, that I used.  I had put the following code in my functions.php hoping to show my custom post types.

add_filter( 'pre_get_posts', 'my_get_posts' );

function my_get_posts( $query )
{
    if ( is_home() )
    {
        $query->set( 'post_type', array( 'any' ) );
        //$query->set( 'post_type', array( 'post', 'products', 'downloads' ) );
        return $query;
    }
}

add_filter( 'pre_get_posts', 'my_get_posts' );

function my_get_posts( $query )
{
    if ( is_home() )
    {
        $query->set( 'post_type', array( 'products' ) );
	  //$query->set( 'post_type', array('post', '{CUSTOM-POST-TYPE-NAME}') );
        return $query;
    }
}

This code works, unless you’re using a custom menu you’ve made in the back end of wordpress.  This will for whatever reason (to which I have not investigated) make your custom menu’s disappear from your home page faster than a rabbit can crap.  So I’ve spent a whole week investigating my custom taxonomies, and wordpress’s custom menu editor, when the only thing I messed up was using Justin Tadlock’s code.

Here is what you do instead of putting that jargon of a excuse for code into your functions.php:

Pick any of your template files that show your posts or pages: pages, loop, home, index, or whatever single-{taxonomy name}.php you want to edit and add your custom post types to and add the following code above the loop:

query_posts( 'post_type=products&posts_per_page=20');

or whatever you needs may be:

query_posts( 'post_type={custom_post_types_name}');

Happy coding, and careful who’s blog you read ;) Thanks JustinTadlock I was stuck on that crap for a week.

~Steven Kohlmeyer

Posted in Internet, techblog, Web Development & Administration, Wordpress | 5 Comments

Microsoft SuperFetch

Intelligent Security? Or a Demon Service? Here’s an article i strongly agree with…

http://www.pcreview.co.uk/forums/thread-3779788.php

I suggest stopping superfetch from slowing network file copies down.

Related Posts

Posted in techblog | Leave a comment

How do I unlock my LG LW 310 Helix Phone when I never set a lock code?

A question that pondered me for about 10 minutes. I search google and all I come across is Q & A websites with this question, and NO ANSWERS. Thanks to my co-worker for his brilliance in user electronics. He suggested trying the last 4 digits of my phone #. THAT WORKED!

SOLUTION: Last 4 Digits of your Cell Phone #

Thanks Saul: Lomaximo

Posted in techblog | 4 Comments

156 Run Commands

[Description]
[command]

Accessibility Controls
access.cpl

Accessibility Wizard
accwiz

Add Hardware Wizard
hdwwiz.cpl

Add/Remove Programs
appwiz.cpl

Administrative Tools
control admintools

Adobe Acrobat (if installed)
acrobat

Adobe Designer (if installed)
acrodist

Adobe Distiller (if installed)
acrodist

Adobe ImageReady (if installed)
imageready

Adobe Photoshop (if installed)
photoshop

Automatic Updates
wuaucpl.cpl

Bluetooth Transfer Wizard
fsquirt

Calculator
calc

Certificate Manager
certmgr.msc

Character Map
charmap

Check Disk Utility
chkdsk

Clipboard Viewer
clipbrd

Command Prompt
cmd

Component Services
dcomcnfg

Computer Management
compmgmt.msc

Control Panel
control

Date and Time Properties
timedate.cpl

DDE Shares
ddeshare

Device Manager
devmgmt.msc

Direct X Control Panel (If Installed)*
directx.cpl

Direct X Troubleshooter
dxdiag

Disk Cleanup Utility
cleanmgr

Disk Defragment
dfrg.msc

Disk Management
diskmgmt.msc

Disk Partition Manager
diskpart

Display Properties
control desktop

Display Properties
desk.cpl

Display Properties (w/Appearance Tab Preselected)
control color

Dr. Watson System Troubleshooting Utility
drwtsn32

Driver Verifier Utility
verifier

Event Viewer
eventvwr.msc

Files and Settings Transfer Tool
migwiz

File Signature Verification Tool
sigverif

Findfast
findfast.cpl

Firefox (if installed)
firefox

Folders Properties
control folders

Fonts
control fonts

Fonts Folder
fonts

Free Cell Card Game
freecell

Game Controllers
joy.cpl

Group Policy Editor (XP Prof)
gpedit.msc

Hearts Card Game
mshearts

Help and Support
helpctr

HyperTerminal
hypertrm

Iexpress Wizard
iexpress

Indexing Service
ciadv.msc

Internet Connection Wizard
icwconn1

Internet Explorer
iexplore

Internet Properties
inetcpl.cpl

Internet Setup Wizard
inetwiz

IP Configuration (Display Connection Configuration) ipconfig /all

IP Configuration (Display DNS Cache Contents) ipconfig /displaydns

IP Configuration (Delete DNS Cache Contents) ipconfig /flushdns

IP Configuration (Release All Connections) ipconfig /release

IP Configuration (Renew All Connections) ipconfig /renew

IP Configuration (Refreshes DHCP & Re-Registers DNS) ipconfig /registerdns

IP Configuration (Display DHCP Class ID) ipconfig /showclassid

IP Configuration (Modifies DHCP Class ID) ipconfig /setclassid

Java Control Panel (If Installed)
jpicpl32.cpl

Java Control Panel (If Installed)
javaws

Keyboard Properties
control keyboard

Local Security Settings
secpol.msc

Local Users and Groups
lusrmgr.msc

Logs You Out Of Windows
logoff

Malicious Software Removal Tool
mrt

Microsoft Access (if installed)
access.cpl

Microsoft Chat
winchat

Microsoft Excel (if installed)
excel

Microsoft Frontpage (if installed)
frontpg

Microsoft Movie Maker
moviemk

Microsoft Paint
mspaint

Microsoft Powerpoint (if installed)
powerpnt

Microsoft Word (if installed)
winword

Microsoft Syncronization Tool
mobsync

Minesweeper Game
winmine

Mouse Properties
control mouse

Mouse Properties
main.cpl

Nero (if installed)
nero

Netmeeting
conf

Network Connections
control netconnections

Network Connections
ncpa.cpl

Network Setup Wizard
netsetup.cpl

Notepad
notepad

Nview Desktop Manager (If Installed)
nvtuicpl.cpl

Object Packager
packager

ODBC Data Source Administrator
odbccp32.cpl

On Screen Keyboard
osk

Opens AC3 Filter (If Installed)
ac3filter.cpl

Outlook Express
msimn

Paint
pbrush

Password Properties
password.cpl

Performance Monitor
perfmon.msc

Performance Monitor
perfmon

Phone and Modem Options
telephon.cpl

Phone Dialer
dialer

Pinball Game
pinball

Power Configuration
powercfg.cpl

Printers and Faxes
control printers

Printers Folder
printers

Private Character Editor
eudcedit

Quicktime (If Installed)
QuickTime.cpl

Quicktime Player (if installed)
quicktimeplayer

Real Player (if installed)
realplay

Regional Settings
intl.cpl

Registry Editor
regedit

Registry Editor
regedit32

Remote Access Phonebook
rasphone

Remote Desktop
mstsc

Removable Storage
ntmsmgr.msc

Removable Storage Operator Requests
ntmsoprq.msc

Resultant Set of Policy (XP Prof)
rsop.msc

Scanners and Cameras
sticpl.cpl

Scheduled Tasks
control schedtasks

Security Center
wscui.cpl

Services
services.msc

Shared Folders
fsmgmt.msc

Shuts Down Windows
shutdown

Sounds and Audio
mmsys.cpl

Spider Solitare Card Game
spider

SQL Client Configuration
cliconfg

System Configuration Editor
sysedit

System Configuration Utility
msconfig

System File Checker Utility (Scan Immediately) sfc /scannow

System File Checker Utility (Scan Once At Next Boot) sfc /scanonce

System File Checker Utility (Scan On Every Boot) sfc /scanboot

System File Checker Utility (Return to Default Setting) sfc /revert

System File Checker Utility (Purge File Cache) sfc /purgecache

System File Checker Utility (Set Cache Size to size x)
sfc /cachesize=x

System Information
msinfo32

System Properties
sysdm.cpl

Task Manager
taskmgr

TCP Tester
tcptest

Telnet Client
telnet

Tweak UI (if installed)
tweakui

User Account Management
nusrmgr.cpl

Utility Manager
utilman

Windows Address Book
wab

Windows Address Book Import Utility
wabmig

Windows Backup Utility (if installed)
ntbackup

Windows Explorer
explorer

Windows Firewall
firewall.cpl

Windows Magnifier
magnify

Windows Management Infrastructure
wmimgmt.msc

Windows Media Player
wmplayer

Windows Messenger
msmsgs

Windows Picture Import Wizard (need camera connected)
wiaacmgr

Windows System Security Tool
syskey

Windows Update Launches
wupdmgr

Windows Version (to show which version of windows)
winver

Windows XP Tour Wizard
tourstart

Wordpad
write

Related Posts

Posted in techblog | Leave a comment

Fun with Web Browsers

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)

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

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

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