my MySQL default configuration

my.cnf file. Try and use this before you start MySQL Server for the first time!

[mysqld]
log-output=TABLE
expire_logs_days=1
general_log=ON
general_log_file=/var/db/mysql/mysqld-queries.log
slow_query_log=ON
slow_query_log_file=/var/db/mysql/mysqld-slow-queries.log
log_queries_not_using_indexes=ON
log-error=/var/db/mysql/mysqld-error.log
default-storage-engine=innodb
innodb_file_per_table

Run the following SQL script to update the logs to use MyISAM (instead of CSV!).

SET @old_log_state = @@global.general_log;
SET GLOBAL general_log = 'OFF';
TRUNCATE TABLE general_log;
ALTER TABLE mysql.general_log ENGINE = MyISAM;
ALTER TABLE mysql.general_log ADD COLUMN `id` INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT;
SET GLOBAL general_log = @old_log_state;
SET GLOBAL general_log = 'ON';
 
SET @old_log_state = @@global.slow_query_log;
SET GLOBAL slow_query_log = 'OFF';
TRUNCATE TABLE slow_log; 
ALTER TABLE mysql.slow_log ENGINE = MyISAM;
ALTER TABLE mysql.slow_log ADD COLUMN `id` INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT;
SET GLOBAL slow_query_log = @old_log_state;
SET GLOBAL slow_query_log = 'ON';

Cron the following command on a hourly / daily basis

/usr/local/bin/mysql -e "FLUSH LOGS; USE mysql; TRUNCATE TABLE slow_log; TRUNCATE TABLE general_log;"

Avast opens Browser on Windows Boot Up

  • Log in to the Small Office Administration Console
  • Click the “Network” menu item
  • You should be on “Group View” automatically, but if not, click that menu item underneath “Network”.
  • Click the “Edit group settings” button, it will be on the right above the computer icons.
  • At the bottom of the list is “Expert settings”
  • Find avastcfg://avast5/Common/ShowChrome in the list and set to zero.

As yet not thoroughly tested but I’ve done this at Athag and seems to hold true.

Excel VBA Search in a Range

Define a Range in Excel by selecting a series of records and entering a name in the NameBox

Public Function IsInRange(RangeName As String, FindString As String)
 Dim Rng As Range

 With Sheets("Ranges").Range(RangeName)
 Set Rng = .Find(What:=FindString, _
 After:=.Cells(1), _
 LookIn:=xlValues, _
 LookAt:=xlWhole, _
 SearchOrder:=xlByRows, _
 SearchDirection:=xlPrevious, _
 MatchCase:=False)
 If Not Rng Is Nothing Then
 'Application.Goto Rng, True
 IsInRange = True
 Else
 'MsgBox "Nothing found"
 IsInRange = False
 End If
 End With
End Function

Usage

If IsInRange("RangeSalesReturns", "FLR5") Then
 Msgbox("Found in range")
 Else
 MsgBox("Not found in range", False)
End If

databases/db48 installed / upgraded repeatedly

# portmaster -DaG
===>>> Starting check of installed ports for available updates

       ===>>> The databases/db47 port moved to databases/db48
       ===>>> Reason: Superseded by databases/db48

===>>> Launching child to reinstall db47-4.7.25.4

===>>> All >> db47-4.7.25.4 (1/1)

       ===>>> The databases/db47 port moved to databases/db48
       ===>>> Reason: Superseded by databases/db48


===>>> Currently installed version: db48-4.8.30.0_2
===>>> Port directory: /usr/ports/databases/db48

===>>> Launching 'make checksum' for databases/db48 in background
===>>> Gathering dependency list for databases/db48 from ports
===>>> Initial dependency check complete for databases/db48

===>>> Returning to update check of installed ports


===>>> All >> (1)

===>>> The following actions will be taken if you choose to proceed:
 Re-install db48-4.8.30.0_2

===>>> Proceed? y/n [y]

Solution...
# portmaster -o databases/db48 databases/db47

Malformed conditional (${PERL_LEVEL} < 501001)

Updating ports and getting this…

===>>> Currently installed version: p5-Version-Requirements-0.101020_1
===>>> Port directory: /usr/ports/devel/p5-Version-Requirements
"Makefile", line 25: Malformed conditional (${PERL_LEVEL} < 501001)
"Makefile", line 29: if-less endif
make: fatal errors encountered -- cannot continue
"Makefile", line 25: Malformed conditional (${PERL_LEVEL} < 501001)
"Makefile", line 29: if-less endif
make: fatal errors encountered -- cannot continue
===>>> Gathering dependency list for devel/p5-Version-Requirements from ports
"Makefile", line 25: Malformed conditional (${PERL_LEVEL} < 501001)
"Makefile", line 29: if-less endif
make: fatal errors encountered -- cannot continue
===>>> No dependencies for devel/p5-Version-Requirements

Appears to be related to the fact that p5-Version-Requirements has been deprecated. (http://www.freshports.org/devel/p5-Version-Requirements/)

These upgrade notes are taken from /usr/ports/UPDATING

  • 2012-01-08
    Affects: users of devel/p5-CPAN-Meta and devel/p5-Version-Requirements
    Author: sunpoet@FreeBSD.org
    Reason: 
      Author of Version::Requirements (devel/p5-Version-Requirements) merged
      its function to CPAN::Meta::Requirements (part of devel/p5-CPAN-Meta).
      As a result, devel/p5-Version-Requirements is marked DEPRECATED.
      Please run the following commands to update p5-CPAN-Meta and remove
      p5-Version-Requirements:
    
      # portmaster -o devel/p5-CPAN-Meta devel/p5-Version-Requirements
      # pkg_delete p5-Version-Requirements-\*