Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Sasha http://nothing-less.net

« Newer Snippets
Older Snippets »
Showing 41-52 of 52 total

How To Fix Incorrect Disk Space

/scripts/fixquotas
/scripts/updatemysqlquota

How To Turn Off/On Stats For One Account

http://forums.cpanel.net/showthread.php?t=15967&highlight=urchin

You can edit the:

pico /var/cpane/users/accountname


file and add settings for the stats packages.

skipanalog=1
skipawstats=1
skipwebalizer=1


That will turn them off and override the server setttings.

To update the stats now:

/scripts/runweblogs username
/scripts/runlogsnow

How To Fix Fantastico SourceGuardian Error

http://netenberg.com/forum/viewtopic.php?t=1937
http://www.netenberg.com/forum/viewtopic.php?t=2480

Please make sure to select "Sourceguardian" in WHM -> Tweak Settings (section "Software"). If that doesn't work:

pico /usr/local/cpanel/3rdparty/etc/php.ini


change:
extension_dir = ./ ;

to
extension_dir = ;


and
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

to
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
extension="/usr/local/cpanel/3rdparty/etc/ixed/ixed.lin.4.3.10.pxp"
;;;;;;;;;;;;;;;;;;;;;; 

How To Fix MySQL Error 28

MySQL: 1030: got error 28 from server handler

cd /tmp
df -i /tmp
df -h /tmp


Delete anything that�s not supposed to be there.
Stop all databases:

/etc/rc.d/init.d/chkservd stop
/etc/rc.d/init.d/mysql stop


Then fix tables:

cd /var/lib/mysql


Check each letter for errors:

myisamchk -cs a*/*.MYI


Repair where necessary:

myisamchk -r a*/*.MYI
myisamchk -r b*/*.MYI
myisamchk -r c*/*.MYI
myisamchk -r d*/*.MYI
myisamchk -r e*/*.MYI
myisamchk -r f*/*.MYI
myisamchk -r g*/*.MYI
myisamchk -r h*/*.MYI
myisamchk -r i*/*.MYI
myisamchk -r j*/*.MYI
myisamchk -r k*/*.MYI
myisamchk -r l*/*.MYI
myisamchk -r m*/*.MYI
myisamchk -r n*/*.MYI
myisamchk -r o*/*.MYI
myisamchk -r p*/*.MYI
myisamchk -r q*/*.MYI
myisamchk -r r*/*.MYI
myisamchk -r s*/*.MYI
myisamchk -r t*/*.MYI
myisamchk -r u*/*.MYI
myisamchk -r v*/*.MYI
myisamchk -r w*/*.MYI
myisamchk -r x*/*.MYI
myisamchk -r y*/*.MYI
myisamchk -r z*/*.MYI


Turn everything back on:

/etc/rc.d/init.d/chkservd start
/etc/rc.d/init.d/mysql start

Quick Cheat Sheet

DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Quick Cheat Sheettitle>





"WeblogIDs" cellpadding="5">
"heading">

{exp:query sql="SELECTweblog_id,blog_name,blog_title,blog_urlFROMexp_weblogsORDERBYblog_title"}

{/exp:query}
Full Weblog Name Short Name Weblog ID
{blog_title} {blog_name} {weblog_id}
"CustomFieldIDs" cellpadding="5"> "heading"> {exp:query sql="SELECTgroup_id,field_name,field_label,field_typeFROMexp_weblog_fieldsORDERBYfield_name"} {/exp:query}
Full Field Name Short Name Field Type
{field_label} {field_name} {field_type}
"CategoryIDs" cellpadding="5"> "heading"> {exp:query sql="SELECTcat_name,cat_id,group_idFROMexp_categoriesORDERBYgroup_id"} {/exp:query}
Full Category Name Category ID
{cat_name} {cat_id}


This EE code will create a quick Cheat Sheet that will list all your Weblogs with their short names and IDs, all your Custom Fields with their short names, and all your Categories with their IDs. This one page will save you having to look this up in the Admin panel constantly when editing/creating templates for your site. :)
Also posted at the EEWiki:
http://www.eewiki.com/wiki/Cheat_Sheet.

List all Weblogs

{exp:query sql="SELECT weblog_id, blog_name, blog_title, blog_url FROM exp_weblogs WHERE weblog_id != '100' ORDER BY blog_title"}
<li><a href="{blog_url}">{blog_title}a></li>
{/exp:query}


Lists all weblogs in one installation and shows how to exclude one by example.

Category Count

{exp:query sql="SELECT count(exp_category_posts.entry_id) AS count,exp_category_posts.cat_id, exp_categories.cat_name
FROM exp_categories, exp_category_posts WHERE exp_category_posts.cat_id = exp_categories.cat_id GROUP BY exp_categories.cat_name"}

<a href="{path=weblog/view}C{cat_id}/">{cat_name}
a> ({count})

{/exp:query}


Displays a list of categories with an entry count for each category. Alternatively, you can also use this query together with the {exp:weblog:categories} tag, making the query a lot smaller:

{exp:weblog:categories weblog="weblog1"}
<a href="{path=weblog/index}">{category_name}a>
{exp:query sql="SELECT count(exp_category_posts.entry_id) AS count
 FROM exp_category_posts  WHERE exp_category_posts.cat_id =  {category_id} "}
({count} entries)
{/exp:query}
{/exp:weblog:categories}

Monthly List

<ul>
<MTArchiveList archive_type="Monthly">
<li><a href="<$MTArchiveLink$>"><$MTArchiveTitle$>a> [  ]</li>
MTArchiveList>
</ul>


A list of the Monthly Archive pages linked to their archives.

Recent Entries

<ul>
<MTEntries lastn="10">
<li><a href="<$MTEntryPermalink$>"><$MTEntryTitle$>a> [ "></a> ]li>
</MTEntries>
ul>


List of the latest 10 entries linked to their Individual Archive Pages.

Category List

<ul>
<MTCategories>
<li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$>a> [  ]</li>
MTCategories>
</ul>


List of all categories in an MT blog linked to their archive pages.

Related Entries

<ul>
{exp:weblog:related_entries weblog="caps" orderby="title" sort="asc"}
<li><a href="{title_permalink="caps/view"}">{title}a></li>
{/exp:weblog:related_entries}
</ul>


Lists all entries in the same category as the one you're currently viewing.

Category Header

{exp:weblog:category_heading  weblog="weblog1"}{category_name}{/exp:weblog:category_heading}

Show the currently viewed category as a heading outside of the {weblog.entries} tag.
« Newer Snippets
Older Snippets »
Showing 41-52 of 52 total