Author Archives: Randy

SQL-fu #1

Nested select with an insert to create multiple rows — used this to add admin privileges for a client in Maia for all their domains: INSERT INTO maia_domain_admins (SELECT t2.domain_id,1013 from postfix_transport t2 WHERE t2.mta_host=’1.2.3.4′);

Search + Replace, Append, Prepend MySQL

Search and replace update [table_name] set [field_name] = replace([field_name],'[string_to_find]’,'[string_to_replace]’); Append update [table_name] set [field_name] = concat([field_name],'[string_to_append]’); Prepend update [table_name] set [field_name] = concat(‘[string_to_prepend]’,[field_name]);

Categories: Uncategorized. Comments Off on Search + Replace, Append, Prepend MySQL

Mcelog – Bad memory?

The original hardware did all kinds of strange things, stuff like SSH not working and RPM checksums failing, random rebooting, ect. I ended up swapping the chassis, mainboard and RAM but kept the HDD’s to avoid an OS reinstall. Now, I’ve gotten this twice on the new box followed by a hard freeze about 2 […]

Installing Subversion on Cpanel/WHM

Make and install Subversion: mkdir -p /usr/local/src/ wget http://subversion.tigris.org/downloads/subversion-1.5.2.tar.bz2 tar xfj subversion-1.5.2.tar.bz2 && cd subversion-1.5.2 ./configure –with-apxs=/usr/local/apache/bin/apxs –with-apr=/usr/local/apache/bin/apr-1-config –with-apr-util=/home/cpeasyapache/src/httpd-2.2.17/srclib/apr-util make && make install Add to pre-main include in Apache Configuration (WHM): LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so Set up EasyApache’s per-user virtualhost config directories (if not present): mkdir /etc/httpd/conf/userdata mkdir /etc/httpd/conf/userdata/std mkdir /etc/httpd/conf/userdata/std/2 Add a […]

Adding alias IP subnet to an interface or VLAN

In the PFsense docs it tells you to use the ‘alias’ option in the web interface… but this won’t work for routed (non-NAT) interfaces that require more than 1 subnet attached to them. To overcome this, I utilized this article: http://doc.pfsense.org/multiple-subnets-one-interface-pfsense.pdf In summary: Log into the webGUI, and click Diagnostics -> Backup/Restore. Click the “Download […]