• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Posts in category Web Development

BASH> Mass rename files

Mar04
2015
Written by Scott Rowley
for file in *.html; do mv -- "$file" "${file%.html}.php"; done
drwxrwxr-x 11 apache sas 4096 Mar 4 12:08 .
drwxrwxr-x 4 apache sas 4096 Feb 26 17:38 ..
-rw-rw-r-- 1 sasowner sas 10763362 Mar 4 11:48 AdminTheme.zip
drwxrwxr-x 4 sasowner sas 4096 Dec 8 2012 bootstrap
-rw-rw-r-- 1 sasowner sas 18949 Dec 8 2012 calendar.html
-rw-rw-r-- 1 sasowner sas 20676 Dec 8 2012 charts.html
drwxrwxr-x 4 sasowner sas 4096 Dec 8 2012 css
drwxrwxr-x 4 sasowner sas 4096 Dec 8 2012 custom-plugins
-rw-rw-r-- 1 sasowner sas 15572 Dec 8 2012 error.html
drwxrwxr-x 2 sasowner sas 4096 Dec 8 2012 example
-rw-rw-r-- 1 sasowner sas 19769 Dec 8 2012 files.html
-rw-rw-r-- 1 sasowner sas 54023 Dec 8 2012 form_elements.html
-rw-rw-r-- 1 sasowner sas 48582 Dec 8 2012 form_layouts.html
-rw-rw-r-- 1 sasowner sas 48867 Dec 8 2012 form_wizard.html
-rw-rw-r-- 1 sasowner sas 29210 Dec 8 2012 gallery.html
-rw-rw-r-- 1 sasowner sas 26691 Dec 8 2012 grids.html
-rw-rw-r-- 1 sasowner sas 286390 Dec 8 2012 icons.html
drwxrwxr-x 3 sasowner sas 4096 Dec 8 2012 images
-rw-rw-r-- 1 sasowner sas 45088 Mar 4 12:08 index.php
drwxrwxr-x 5 sasowner sas 4096 Dec 8 2012 js
drwxrwxr-x 5 sasowner sas 4096 Dec 8 2012 jui
-rw-rw-r-- 1 sasowner sas 2998 Dec 8 2012 login.html
-rw-rw-r-- 1 sasowner sas 1780 Mar 4 12:08 navigation.php
drwxrwxr-x 2 sasowner sas 4096 Dec 8 2012 php
drwxrwxr-x 17 sasowner sas 4096 Dec 8 2012 plugins
-rw-rw-r-- 1 sasowner sas 69763 Dec 8 2012 table.html
-rw-rw-r-- 1 sasowner sas 27285 Dec 8 2012 typography.html
-rw-rw-r-- 1 sasowner sas 61362 Dec 8 2012 widgets.html

After

drwxrwxr-x 11 apache sas 4096 Mar 4 12:08 .
drwxrwxr-x 4 apache sas 4096 Feb 26 17:38 ..
-rw-rw-r-- 1 sasowner sas 10763362 Mar 4 11:48 AdminTheme.zip
drwxrwxr-x 4 sasowner sas 4096 Dec 8 2012 bootstrap
-rw-rw-r-- 1 sasowner sas 18949 Dec 8 2012 calendar.html
-rw-rw-r-- 1 sasowner sas 20676 Dec 8 2012 charts.html
drwxrwxr-x 4 sasowner sas 4096 Dec 8 2012 css
drwxrwxr-x 4 sasowner sas 4096 Dec 8 2012 custom-plugins
-rw-rw-r-- 1 sasowner sas 15572 Dec 8 2012 error.html
drwxrwxr-x 2 sasowner sas 4096 Dec 8 2012 example
-rw-rw-r-- 1 sasowner sas 19769 Dec 8 2012 files.html
-rw-rw-r-- 1 sasowner sas 54023 Dec 8 2012 form_elements.html
-rw-rw-r-- 1 sasowner sas 48582 Dec 8 2012 form_layouts.html
-rw-rw-r-- 1 sasowner sas 48867 Dec 8 2012 form_wizard.html
-rw-rw-r-- 1 sasowner sas 29210 Dec 8 2012 gallery.html
-rw-rw-r-- 1 sasowner sas 26691 Dec 8 2012 grids.html
-rw-rw-r-- 1 sasowner sas 286390 Dec 8 2012 icons.html
drwxrwxr-x 3 sasowner sas 4096 Dec 8 2012 images
-rw-rw-r-- 1 sasowner sas 45088 Mar 4 12:08 index.php
drwxrwxr-x 5 sasowner sas 4096 Dec 8 2012 js
drwxrwxr-x 5 sasowner sas 4096 Dec 8 2012 jui
-rw-rw-r-- 1 sasowner sas 2998 Dec 8 2012 login.html
-rw-rw-r-- 1 sasowner sas 1780 Mar 4 12:08 navigation.php
drwxrwxr-x 2 sasowner sas 4096 Dec 8 2012 php
drwxrwxr-x 17 sasowner sas 4096 Dec 8 2012 plugins
-rw-rw-r-- 1 sasowner sas 69763 Dec 8 2012 table.html
-rw-rw-r-- 1 sasowner sas 27285 Dec 8 2012 typography.html
-rw-rw-r-- 1 sasowner sas 61362 Dec 8 2012 widgets.html

osTicket> “First Client” Theme

Nov11
2013
Written by Scott Rowley

Up for grabs by donation ($25) is the “First Client” theme. Every page has been gone over to rework the design to the beautiful result below! Recently updated for use with 1.9.14!

First Client osTicket Home Page

First Client osTicket Home Page

First Client osTicket Home Page

First Client osTicket Home Page

First Client osTicket Home Page

Creating a Deployment Plan in Oracle WebLogic

Oct10
2013
Written by Ben Garin

Deployment Plans

Deployment plans can be used by administrators to override application settings and variables without modifying the actual jar/war/ear file contents.

Creation

Creating a deployment plan for a deployed application.

  1. Open a Web browser and go to http://<hostname>:<port>/console.
  2. Log in as the administrator.
  3. In the Change Center, click Lock & Edit to enable configuration changes.
  4. Navigate to <domain_name>, then Deployments.
  5. Click on the <application_name> you are creating a deployment plan for.
  6. Click on the Configuration tab.
  7. Click Save.
  8. Enter the path and name of the deployment plan and Click OK.
  9. In the Change Center, click Release Configuration.

Customization

Customizing a deployment plan involves 2 parts, creating variables and assigning them.

Creating Variables:

Variable definitions should be entered below <application-name> inside the <variable-definition> tag.
Each variable requires a <name> and <value> tag.

Example:

 <application-name>upload</application-name>
<variable-definition>
<variable>
<name>secureCookie</name>
<value>true</value>
</variable>
</variable-definition>

Assigning Variables:

Variable assignment needs to take place in the correct <root-element>, which in most cases is weblogic-web-app.
Depending on the variable assignment, it needs to be in the correct <uri> tag. The example below shows a variable assignment which would normally exist in the WEB-INF/weblogic.xml file.
Each variable assignment requires a <name> and <xpath>. The <name> is the name of the variable with a value created above and the <xpath> is the context path or tags in which the variable exists.

So normally in the weblogic.xml file this would look like:

<weblogic-web-app>
<session-descriptor>
<cookie-secure>SOME_VALUE</cookie-secure>
</session-descriptor>
</weblogic-web-app>

But in the <xpath> each tag is separated by a / resulting in:

/weblogic-web-app/session-descriptor/cookie-secure

Example:

 <root-element>weblogic-web-app</root-element>
<uri>WEB-INF/weblogic.xml</uri>
<variable-assignment>
<name>secureCookie</name>
<xpath>/weblogic-web-app/session-descriptor/cookie-secure</xpath>
</variable-assignment>

Full Deployment Plan Example:

<?xml version='1.0' encoding='UTF-8'?>
<deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd">
<application-name>upload</application-name>
<variable-definition>
<variable>
<name>secureCookie</name>
<value>true</value>
</variable>
</variable-definition>
<module-override>
<module-name>SOME_APPLICATION.ear</module-name>
<module-type>ear</module-type>
<module-descriptor external="false">
<root-element>weblogic-application</root-element>
<uri>META-INF/weblogic-application.xml</uri>
</module-descriptor>
<module-descriptor external="false">
<root-element>application</root-element>
<uri>META-INF/application.xml</uri>
</module-descriptor>
<module-descriptor external="true">
<root-element>wldf-resource</root-element>
<uri>META-INF/weblogic-diagnostics.xml</uri>
</module-descriptor>
</module-override>
<module-override>
<module-name>SOME_APPLICATION.war</module-name>
<module-type>war</module-type>
<module-descriptor external="false">
<root-element>weblogic-web-app</root-element>
<uri>WEB-INF/weblogic.xml</uri>
<variable-assignment>
<name>secureCookie</name>
<xpath>/weblogic-web-app/session-descriptor/cookie-secure</xpath>
</variable-assignment>
</module-descriptor>
<module-descriptor external="false">
<root-element>web-app</root-element>
<uri>WEB-INF/web.xml</uri>
</module-descriptor>
</module-override>
<config-root>DOMAIN_HOME/servers/AdminServer/upload/plan</config-root>
</deployment-plan>

osTicket> Reports 6.x Change Log

Jul29
2013
Written by Scott Rowley

6.0.8
Fixed issue with Help Topic not reporting correctly, effected files: reports.php, reports_includes/functions.php, reports_includes/groups.php, reports_includes/reportGraph.php. Also removed several unneeded files that reduced the MOD zip file from over 4mb to just over 1mb.

Posted in MySQL, osTicket - Tagged 6.x, change, change log, log, reports, reports mod, track, tracker, tracking, updates

osTicket> Reports 7.5 (1.10+)

Jun17
2013
Written by Scott Rowley

The reporting plugin has been moved to http://www.software-mods.com/reports.html

Thanks,
Scott

Posted in MySQL, osTicket, PHP - Tagged 1.10, 1.7, 1.7 Release, 1.8, 1.9, 6.0, osTicket, osTicket Reports Plugin, release, reports, Reports Plugin, support, ticket, ticketing, version

Google> Search by Image instead of text (Identify Image)

Sep12
2012
Written by Scott Rowley

So the other day someone on facebook asked who someone was and supplied a picture. As it happens I had no idea who it was so I started wondering how I could still identify the person and supply the answer. Well, as is often the case, Google has already thought this up and supplied the answer. Take a look at the following short video to see how this is easily done.

Tagged google, image, images, photo, picture, result, search, text

osTicket> Refresh ticket page every N seconds (1.6RC5)

Aug07
2012
Written by Scott Rowley

Just a simple one today to show you how to get the ticket page to automatically refresh itself every n seconds:

scp/tickets.php
Insert the following just after the requires at the top of the file:

define('MAIN_PAGE',1);
if(defined('MAIN_PAGE') && !isset($_GET['id']) && !isset($_GET['status']) && !isset($_GET['a'])) {
echo "<meta http-equiv='refresh' content='60'>";
}

*60 seconds is my recommendation, you can of course change this number as desired.

Posted in osTicket - Tagged content, meta, osTicket, page, refresh, reload, seconds, ticket

Web Dev> pChart WriteValues text color

Jun07
2012
Written by Scott Rowley

Just a quick post since I started toying around with pChart 2.x to add emailed reports to my osTickets Reports MOD. This took me awhile to locate and that was including 20 minutes of googling failing me.

In order to change the font color of the WriteValues (the values that show up over your generated charts). You can modify the numbers in the following file
pChart/class/pRadar.class.php

developing apps for smart tv

$ValueR = isset($Format["ValueR"]) ? $Format["ValueR"] : 0;
$ValueG = isset($Format["ValueG"]) ? $Format["ValueG"] : 0;
$ValueB = isset($Format["ValueB"]) ? $Format["ValueB"] : 0;

Setting the above to 0’s instead of 255 will change the text from white to an easier to read black.

Posted in PHP - Tagged Charts, Format, pChart, php, ValueB, ValueG, ValueR, WriteValues

Web Dev> Obtaining Google PageRank

Jun06
2012
Written by Scott Rowley

As a part of Search Engine Optimization (SEO) you may want to be aware of your websites (or clients websites) page rank on Google. After some researching I’ve found the following solutions to be best. I’ll be presenting a few options here, first we’ll cover how to look it up on prchecker.info. Second we’ll be covering how to look up the page rank using a perl script and finally we’ll cover how to look up your page rank with the perl script and update a mysql database with the information (for long term tracking and/or tracking multiple websites.)
READ MORE »

Posted in MySQL, Perl, PHP, SEO - Tagged database, google, MySQL, page, page rank, Perl, php, prchecker.info, rank, script, search engine optimizaiton, SEO

Web Dev> Handling dynamically created checkboxes

May02
2012
Written by Scott Rowley

Ok, so let’s say I have a list of users in a database. I want to get that list out on the screen and allow someone to be able to use checkboxes to do something with each of those users. In this example we’re going to say we are deleting any users that have been checked. If you are not already familiar with building dynamic output from mysql then I suggest you first read over Web Dev> Populate PHP/HTML table from MySQL database

First we’ll build our form to show our users, in this example I’m actually building my list of users from a query to a mail server which gets returned to me first as a string. I need to change this into an array so I’m going to use explode(). I’ll go through this all step by step so it’s easy to follow along and you can skip whatever parts you feel you are already familiar with.

So lets say the mail server returns this string to me of users:

$members_string = 'Bruce Chuck Jackie Jet';
echo "Members string is '$members_string'";

Which gives us an output of

Members string is 'Bruce Chuck Jackie Jet'

Since I want to loop through each of these members I need to first create an array that I can loop through, this is where explode() comes in.

// Members are separated by spaces, so explode on spaces
$members = explode(' ',$members_string);

READ MORE »

Posted in PHP - Tagged checkbox, dev, dynamic, form, php, web, web dev
« Older Entries

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top