Archive for category Web

wp-make-me-happy


Ok this is kind of a repeat but instead of editing the original post I thought I would just repost it in its new form.  I was working on setting up a backup blog of this very blog to have on a local server… I don’t know in case of disaster… actually it was to see what it looked like with some new themes I have as this site is somewhat limited in it’s design choices… not complaining mind you, just wanted to see what it would look like with some nifty designs I made… The original post, WordPress Automation, was from a while back and I had the need to actually make a new host just for this occasion as I had blown away all of my web servers recently (I don’t actually recall why…???).  I was going through my script pad and found a really simple setup script I wrote that was better than the original post I put here… although it really is the same thing just without any comments… LOL Sorry I take for granted that you are just going to trust that it works and run it !!! Scary 🙂  I did find a few hiccups however… My sed lines didn’t take although they are correct… and this was a stinker… The repo I like to create here, although mostly this is if you were going to run multiple vhosts on the same physical server, (It does allow you to have only 1 repo for ALL themes and plugins for ALL users) does NOT work with the Worpdpress Import plugin… So I ended up un-linking the plugins link and just re-instating the original one, good thing I copied it to a backup in this script instead of just blowing it away huh??? 🙂  As I stated earlier, the entire script is based on the setup that Virtualmin creates in its vhost creation module so if you are using something else or doing that manually, you may need to change this up a bit… 29 lines on this one… sorry 😦  LOL

#/bin/bash
#
echo “Make sure you have created this VHost using virtualmin FIRST…”
sleep 5
echo “OK… moving on then”
sleep 2
echo “Enter the name of your new site, then press [ENTER}”
read newblog
cd /home/$newblog/public_html
wget http://www.wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
rm -Rf latest.tar.gz
mv wordpress/* .
rm -Rf wordpress
chmod 777 .
cd /home/$newblog/public_html/wp-content
mv themes bak.themes # <– Just in case we hose everything 😦
mkdir -p /var/www/repo/themes
ln -s /var/www/repo/themes /home/$newblog/public_html/wp-content/themes
mv plugins bak.plugins
mkdir -p /var/www/repo/plugins
ln -s /var/www/repo/plugins /home/$newblog/public_html/wp-content/plugins
cd ../
cp wp-config-sample.php wp-config.php
sed -i ‘s/putyourdbnamehere/’$newblog’/’ wp-config.php
sed -i ‘s/usernamehere/’$newblog’/’ wp-config.php
sed -i ‘s/yourpasswordhere/’$newblog’/’ wp-config.php
chown -R $newblog:$newblog *
# EOF

Advertisements

, , , , , , , ,

Leave a comment

WordPress Automation


OK so I had a few minutes to spare today and I  decided to finalize this mini-automation script for WordPress installs.  Keep in mind that  the assumption is made that you have used Virtualmin to create the preliminary aspects, vhost, mysql, doc root, etc… If not… this ain’t gonna work as it is.  I guess I could work up a more in-depth script to include these aspects, in fact that is how I started this idea in the first place, but the aspects of virtualmin really are pretty extensive and since I am using that to manage the vhosts anyway I just skipped that part, I mean why try to improve on a great integration aspect, besides it is unlikely I could do it better anyway.  I would however like to translate this piece into a Perl mod to be added to the virtualmin GUI, that would be a cool improvement.

#/bin/bash

#

echo “Make sure you have created this VHost using virtualmin FIRST…”

sleep 5

echo “OK… moving on then”

sleep 2

echo “Enter the name of your new site, then press [ENTER}”

read newblog

# You need these if you are NOT using virtualmin FIRST !!

# mkdir /var/www/html/$newblog

# useradd -c ‘$newblog user’ -p ‘$newblog’ $newblog

# chown -R $newblog:$newblog $newblog

cd /home/$newblog/public_html

wget http://www.wordpress.org/latest.tar.gz

tar xzf latest.tar.gz

rm -Rf latest.tar.gz

mv wordpress/* .

rm -Rf wordpress

chmod 777 .

# Link the themes & plugins from the default repo

# This makes the assumption that you actually HAVE a repo for themes and plugins…

# If you don’t this ain’t gonna do what we need it to !!

cd /home/$newblog/public_html/wp-content

mv themes bak.themes # <– Just in case we hose everything 😦

# Make the link directorie(s), if necessary and link ’em up

mkdir -p /var/www/repo/themes

ln -s /var/www/repo/themes /home/$newblog/public_html/wp-content/themes

mv plugins bak.plugins

mkdir -p /var/www/repo/plugins

ln -s /var/www/repo/plugins /home/$newblog/public_html/wp-content/plugins

cd ../

cp wp-config-sample.php wp-config.php

#

#

# Final directions

# Open the editor if needed but SED will do what you need

# vi wp-config.php

sed -i ‘s/putyourdbnamehere/’$newblog’/’ wp-config.php

sed -i ‘s/usernamehere/’$newblog’/’ wp-config.php

sed -i ‘s/yourpasswordhere/’$newblog’/’ wp-config.php

chown -R $newblog:$newblog *

# EOF

If you need webmin/virtualmin/cloudmin (I HIGHLY recommend them) you can spin this off:

# Virtualmin/Webmin/Cloudmin Installation

# cd /usr/src

# wget http://software.virtualmin.com/gpl/scripts/install.sh

# sh install.sh

# wegt http://cloudmin.virtualmin.com/gpl/scripts/cloudmin-gpl-redhat-install.sh

# sh cloudmin-gpl-redhat-install.sh

And that’s it! Just navigate to your new URL (assuming that you made the proper DNS entries…) and configure WordPress from its admin console.  I also thought this tutorial on SED was pretty useful although what I used here is very basic, just in case you need something more.

http://www.grymoire.com/Unix/Sed.html

Happy Blogging 🙂

, , , , , , , , , ,

3 Comments

CUPS… Ain’t no cup -o- Joe…


Ok… So I work in an environment that requires printing from the UNIX/Linux hosts I manage… Printing sucks… plain and simple.  Anyway… We are moving a customer from a SCO box to a new RHEL 5 platform so off I go into the testing phase for printing.  CUPS being my obvious choice, I will just give you the quick-n-dirty version here as I spent WAY too much time looking @ this, but too late now.

So lets say you are starting from the very beginning, like I was with a raw build.  First things first… get CUPS (LOL):

yum -y install cups cups-devel (I grabbed the devel just for the heck-of-it, you may not need it)

This will give you (As of 4-8-2010):

cups-1.3.7-11.el5_4.6
cups-libs-1.3.7-11.el5_4.6
cups-devel-1.3.7-11.el5_4.6

Make sure it is “ON”:

chkconfig –list cups
cups            0:off   1:off   2:on    3:on    4:on    5:on    6:off

Now for the actual setup…  This got a bit out of whack for me but I only say that to embarrass myself ?

We will be working from the /etc/cups directory here so navigate over there if you will please… 🙂  Not too much in here but a few files to config, the main file being cupsd.conf so lets open that one up and make something work shall we?

-rw——- 1 root lp      0 Mar  6 18:19 classes.conf
-rw-r–r– 1 root lp      0 Mar  6 18:19 client.conf
-rw-r–r– 1 root lp    141 Mar 10 13:00 client.conf.rpmsave
-rw-r—– 1 root lp   2704 Apr  8 11:28 cupsd.conf
-rw-r—– 1 root lp   2578 Mar  6 18:19 cupsd.conf.default
drwxr-xr-x 2 root root 4096 Mar  6 18:19 interfaces
-rw-r–r– 1 root root 4533 Mar  6 18:19 mime.convs
-rw-r–r– 1 root root 6298 Mar  6 18:19 mime.types
-rw-r–r– 1 root lp    215 Mar  6 18:19 pdftops.conf
drwxr-xr-x 2 root lp   4096 Apr  8 11:38 ppd
-rw——- 1 root lp    351 Apr  8 11:38 printers.conf
-rw——- 1 root lp      0 Mar  6 18:19 printers.conf.O
-rw-r–r– 1 root root  947 Mar  6 18:19 pstoraster.convs
-rw-r–r– 1 root lp    186 Mar  6 18:19 snmp.conf
drwx—— 2 root lp   4096 Apr  8 11:35 ssl

So there is the expected amount of jargon in here but we need to get the web interface working… Oh I should say that in fact some of what I am going to outline here is not necessary if you have an X Window running on the localhost (with a browser obviously).  I don’t have that in these installations so I need remote access to the CUPS web interface… I guess you could setup a VNC server as well and use that to the localhost, but that seems a bit to effort-full as I don’t need the VNC for anything else.  Anyway, open the file with your editor of choice and lets tweak a few things.  Most of this is @ the very top of the file so that is pretty reasonable.  For some reason this interface is REALLY finicky… so put this in correctly or you will be banging your head on the desk for a while…

# Only listen for connections from the local machine.
Listen localhost:631  <– This is the default, comes already written
Listen 192.168.11.25:631 <– I added this one…
Listen 192.168.11.25:80 <– and this one for remote access as I stated above. This is the server IP… That may not be as obvious as you think…
#Port 631 <– These can work also, but allow anything from anywhere, never a good idea
#Port 80
Listen /var/run/cups/cups.sock <– This is also a default, leave it alone

Go a few lines down…

# Default authentication type, when authentication is required…
DefaultAuthType Basic

# Restrict access to the server…
<Location />
Order allow,deny
Allow localhost <– Added
Allow @LOCAL <– Added
</Location>

# Restrict access to the admin pages…
<Location /admin>
#  Encryption Required <– this will force you to use HTTPS… not a bad idea, it is enabled by default
Order allow,deny
Allow localhost <– Added
Allow @LOCAL <– Added
</Location>

# Restrict access to configuration files…
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow localhost <– Added
Allow @LOCAL <– Added
</Location>

Basically, that’s it.  How the hell that took me more than 5 minutes to do is beyond me, but now it is guaranteed to take you only 5 minutes :).  I will also mention that I added a line in my firewall to allow port 631; I already allowed 80.

At this point you can browse to the CUPS web interface and start adding/managing your printers 🙂

https://<your-server-IP&gt;:631

The rest really is pretty self explanatory.  Happy printing 🙂

, , , , , , , , , , ,

Leave a comment

Corp Video


Vodpod videos no longer available.

more about "GCC – Global Consulting Company", posted with vodpod

, , , , , ,

1 Comment

Flowplayer 101


So I know that I have been MAJORLY slacking on this blog and for that I sincerely apologize, BUT.. I have really been hard at work on a number of aspects to the project @ hand.   Although the code listed below doesn’t seem to work as I would like in WordPress, I can none-the-less make it work as a stand-alone page… So something I have in a VHost config may be hosing this on my local WordPress test site… The code def works.  Anyway.. you guessed it, this is the minimal Flowplayer config, well a bit enhanced with some formatting and a splash image embedded in the player, but pretty basic otherwise.  I will also include the Yahoo! and Google embedded .mp3 players, but they are pretty straight forward and really need no explanation.

"Splash" screen

<html><head>
<meta http-equiv=”content-type” content=”text/html; charset=UTF-8″>
<!– A minimal Flowplayer setup to get you started –>
<script type=”text/javascript” src=”flowplayer-3.1.4.min.js”></script>

<!– some minimal styling, can be removed –>
<link rel=”stylesheet” type=”text/css” href=”style.css”>

<!– page title –>
<title>Flowplayer</title>
</head><body>

<div id=”page”>

<!– this A tag is where your Flowplayer will be placed. it can be anywhere –>
<a
href=”http://problog/video/GCCompany_Video.mp4&#8243;
style=”display:block;width:520px;height:330px”
id=”player”>
<!– specify a splash image inside the container –>
<img src=”../../img/Garot.png” border=”0″ vspace=”122″ align=”center” width=”200″ height=”80″ alt=”Search engine friendly content” />
</a>

<!– this will install flowplayer inside previous A- tag. –>
<script>
flowplayer(“player”, “../flowplayer-3.1.5.swf”);
</script>

</div>

</body></html>
<img src=”http://static.flowplayer.org/img/home/logo-3.1.jpg”/&gt;

Embedded Video Player

Here is the Yahoo! player

<img src=”http://l.yimg.com/a/i/ww/met/yahoo_logo_us_061509.png”/&gt;

<a href=”music/Kaskade-MoveForMe_Deadmau5.mp3″>Kaskade/Deadmau5 – Move 4 Me</a>
<a href=”music/Kaskade-IRemember.mp3″>Kaskade/Deadmau5 – I Remember</a>
<a href=”music/Deadmau5_Where_Is_Here.mp3″>Deadmau5 – Where Is Here</a>
<a href=”music/Deadmau5_Arguru.mp3″>Deadmau5 – Arguru</a>
<script type=”text/javascript” src=”http://mediaplayer.yahoo.com/js”></script></body&gt;

I’ll get the screenshots up in a few… bare-with-me 🙂

Yahoo! Player

Here is the Google plaer code.  This is a sharp looking player but only plays 1 file per instance… Somewhat limiting.  You can see it in the top left.

<!– embedded Google .mp3 player –>
<div id=”player”>

<h1><embed type=”application/x-shockwave-flash” src=”http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=music/Kaskade-MoveForMe_Deadmau5.mp3&#8243; width=”400″ height=”27″ allowscriptaccess=”never” quality=”best” bgcolor=”#ffffff” wmode=”window” flashvars=”playerMode=embedded” /></h1>

<!– –>

, , , , , , , ,

Leave a comment

Delay


Sorry for the delay on the web server project updates.. I have been caught up in issues @ work lately. I should be working more on this, this week for sure.

1 Comment