Notes‎ > ‎

George Vanous

MySQL

create database x;
create user x identified by 'Nothing69';
grant all privileges on x.* to 'x';

mysqldump -p5CniirE4 template | mysql -p5CniirE4 $to

Repair and optimize all tables

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

Remove duplicate rows


Assuming your example:
CREATE TABLE bad_table2 (
id INT NOT NULL UNIQUE AUTO_INCREMENT,
name VARCHAR(20) NOT NULL
);

INSERT INTO bad_table2(id,name) VALUES
(1,'Things Fall Apart'),
(2,'Things Fall Apart'),
(3,'The Famished Road'),
(4,'Things Fall Apart'),
(5,'The Famished Road'),
(6,'Thirteen cents'),
(7,'Thirteen cents');

I can remove duplicates easily with the following line:
alter ignore table bad_table2 add unique index `unique_index` (name);

And then remove the added index.
alter table bad_table2 drop index `unique_index`;

vBulletin

Friendly urls
Url type > Mod rewrite friendly urls
Upload do_not_upload/rewrite/apache2/.htaccess


Friendly urls
Enforce canonical url > Strict

User registration options
Verify email address in registration > Yes

Server settings and optimizations
Use remote YUI > Google

Change "/forum.php" to "/"

Note: The breadcrumb doesn't work (shows "/.php")

AdminCP -> Go to Styles & Template -> Style Manager -> Edit Templates -> Navigations & Breadcrumbs Templates - Navbar

Remove .php on line 6 or Find 
<li class="selected"><a class="navtab" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}">{vb:rawphrase forum}</a>

Save

Then Go to AdminCP -> Setting -> Options -> Forum Home Page Options
and leave blank the Script Name for Forum Home Page

Save


Change background image

Admin CP> Styles & Templates> Style Manager
Choose Style> StyleVars>

On the Left you will find Variables Table:
Look for Common> doc_background :

Now in the Right table set this values: 

Background Image: url(imageurl.../myimage.png)
Background Repeat: choose what you desire

Fixed width

My hack
Style manager > Edit templates > CSS templates > Expand > vbulletin.css >Edit

.above_body,
.body_wrapper,
.below_body { margin:0 auto !important; padding-left:20px !important; padding-right:20px !important; width:900px !important }

Change YouTube embed code

Search in templates > youtube > bbcode_youtube

<vb:elseif condition="$provider == 'youtube'" />
<object class="restrain" type="application/x-shockwave-flash" width="640" height="385" data="http://www.youtube.com/v/{vb:raw code}?version=3&fs=1&showinfo=0">
<param name="movie" value="http://www.youtube.com/v/{vb:raw code}" />
<param name="wmode" value="opaque" />
<param name="allowFullScreen" value="true" /> 
<param name="allowScriptAccess" value="always" /> 
<!--[if IE 6]>
<embed width="640" height="385" type="application/x-shockwave-flash" src="http://www.youtube.com/v/{vb:raw code}?version=3&fs=1&showinfo=0" type="application/x-shockwave-flash" wmode="opaque" allowscriptaccess="always" allowfullscreen="true" />
<![endif]--></object>

Add Google Analytics

Styles > Edit templates > footer > edit

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-xxxx-xx']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = 'http://www.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

Change usergroup colors

Usergroups > Usergroup manager > (group) edit > Username HTML markup
Left box: <span style="color:#FF0000">
Right box: </span>


Linux

Which ports are active
netstat -tnlp

Slow running php files

See /var/log/php-fpm/www-slow.log
Comments