Higher Logic notes on screwing with tech…

Scripts

This page contains useful scripts that we use. We'll add more as we come to them.

MySQL

To find out how much disk space your databases are taking

SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 /
1024 "Data Base Size in MB",
sum( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;

To Export a query into a csv file

mysql -u db_user -p database_name -e 'SELECT * FROM table;' | perl -F"\t" -lane 'print join ",", map {s/"/""/g; /^[\d.]+$/ ? $_ : qq("$_")} @F '

Shellscripts

To find out how much space every file and directory inside your current directory is

du -sh *

To delete files that are older than X days


find /path/to/files/you/want/to/delete -mtime +60 -type f -fprint /path/to/log-file.log -exec rm -f {} \; &

SVN

To find out which files have changed without all the junk:
svn stat -qu

Comments (2) Trackbacks (0)
  1. Hi Barrett,

    Actually there is a lot of protection measures you can take against hackers.

    If you have full access to your server you can:
    Restrict permissions and privileges to where wordpress lives
    Lock down all attributes to how wordpress is run
    Lock down access to the actual PHP
    Take regular snapshots of the database and attachments
    Firewalls doesn’t hurt :)

    If you don’t have access to the server its hosted on:
    Make sure its always updated to the latest version
    Install only the plugins you need and do a little research on every plugin you install

    I will do a write up about this next week sometime… Just need to find the time.

  2. Webmaster, I am the admin at SEOPlugins.org. We profile SEO Plugins for WordPress blogs for on-site and off-site SEO. I’d like to invite you to check out our recent profile for a pretty amazing plugin which can double or triple traffic for a Worpdress blog. You can delete this comment, I didn’t want to comment on your blog, just wanted to drop you a personal message. Thanks, Rich


Leave a comment

(required)

No trackbacks yet.