Category Archives: Computers

Exchange to move marked messages to junk folder

Run the following command via Exchange Management Shell. New-TransportRule -Name ‘SCS MailGuard classified messages moved to Junk Mail’ -Comments ” -Priority ‘0’ -Enabled $true -SubjectMatchesPatterns ‘[BANNED]’,'[SPAMMY’,'[SPAM’ -SetSCL ‘9’ I believe Exchange 2007 will be a minimum requirement.

Excel VBA reminders / snipbits

Consider using Collections, not arrays Use SET when assigning Objects Set InvoiceWS = ActiveWorkbook.Sheets(“Invoice”) Function InArray(arr, val) As Boolean    For arrloop = LBound(arr) To UBound(arr)       If arr(arrloop) = val Then         InArray = True         Exit Function       End If    Next arrloop    InArray = False End Function Dim ListOfDirectors As Variant:… Read More »

Updating NIC’s MTU on FreeBSD

Use the command ifconfig bge0 mtu 1500 and NOT ifconfig bge0 192.168.0.1 mtu 1500 ias explained in http://www.cyberciti.biz/faq/freebsd-jumbo-frames-networking-configration/ if trying to chage the MTU remotely via SSH. If you specifiy a a IP address FreeBSD seems to “reset the stack” and loses the default gateway

Upgrading Spamassassin on FreeBSD outside of ports tree

Unsure of the future implications of this but as it’s been a few days and there are no signs of a upgrade I’m taking a flyer… Download and extract spamassassin from Website cd ~ fetch http://apache.mirrors.timporter.net//spamassassin/source/Mail-SpamAssassin-3.4.0.tar.gz tar -zvxf Mail-SpamAssassin-3.4.0.tar.gz cd Mail-SpamAssassin-3.4.0 Create make file perl Makefile.PL Make SpamAssassin make make install SpamAssassin no longer comes with… Read More »

perl cpan

To gain access to cpan type perl -MCPAN -e shell To update cpan type install CPAN reload cpan To install a module via cpan type cpan> install HTML::Template

Upgrading FreeBSD 9.1 to 9.2 with freebsd-update

http://www.freebsd.org/releases/9.2R/installation.html Recommend running commands 1-5 at the bottom of this page prior to updating to avoid receiving errors like “pkg: Warning: Major OS version upgrade detected. Running “pkg-static install -f pkg” recommended” thousands of times 🙂 Upgrading Using “FreeBSD Update” The freebsd-update(8) utility supports binary upgrades of i386 and amd64 systems running earlier FreeBSD releases. Systems running 8.[34]-RELEASE, 9.[01]-RELEASE, 9.2-BETA[123], or 9.2-RC[1234] can… Read More »

FreeBSD screen resolutions

To test… kldload vesa vidcontrol -i mode (will list the available modes) vidcontrol MODE_279 To make permanant Edit /boot/loader.conf and add vesa_load=”YES” Edit /etc/rc.conf add allscreens_flags MODE_279″ (for example)

Keeping Ports tree tidy

As yet untested over any period of time. portmaster –check-depends portmaster –check-port-dbdir portmaster -s portmaster -y –clean-distfiles

Upgrading perl 5.14 to 5.16 on FreeBSD 9.1 using portmaster

Update portstree! portsnap fetch update Portmaster users: portmaster -o lang/perl5.16 lang/perl5.14 Conservative: (tried this, didn’t see to make Amavis work though) portmaster -D p5- Comprehensive (but perhaps overkill): (tried this, but took ages due to the constant OPTION menus popipng up portmaster -r perl5- Comprehensive and quite (but perhaps overkill): (worked like a charme, took… Read More »

MySQL Logs – Selecting General Query and Slow Query Log Output Destinations

[mysqld] … log-output=TABLE expire_logs_days=1 general_log=1 general_log_file=/var/log/mysqld-queries.log slow_query_log=1 slow_query_log_file=/var/log/mysqld-slow-queries.log …   SET @old_log_state = @@global.general_log; SET GLOBAL general_log = ‘OFF’; ALTER TABLE mysql.general_log ENGINE = MyISAM; 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’; ALTER TABLE mysql.slow_log ENGINE = MyISAM; SET GLOBAL slow_query_log = @old_log_state;… Read More »

Helpful RunAs Commands

Control Panel Tools You can access any of the Control Panel Tools by using RunAs against the control.exe file and the associated CPL app. For this you can use the local PC administrator account or a network account with workstation admin rights. Example: Add/Remove Programs runas /user:_ADMINACCT_ “control.exe appwiz.cpl” Other Options: Accessibility Controls: control.exe access.cpl… Read More »

Add WordPress Admin user via MySQL query

// You may need to update the table names if a WordPress table prefix has been set. INSERT INTO wp_users (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (‘spectrum’, MD5(‘some-password’), ‘Spectrum Computer Solutions’, ‘wordpress@spectrumcs.net’, ‘http://www.spectrumcs.net’, NOW(), ”, ‘0’, ‘Spectrum Computer Solutions’); SET @USER_ID = LAST_INSERT_ID(); INSERT INTO wp_usermeta (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES… Read More »

WSUS Best Practices & Cleanup info

Best Practices with Windows Server Update Services 3.0 Geek of All Trades: 6 Tips for 100 Percent WSUS Compliance What to do when your WSUSContent folder grows too large Scripts WSUS Cleanup <- Using adapted version here WSUS Cleanup v2 Script PoshWSUS   WSUS: How to change the location where WSUS stores updates locally http://blogs.technet.com/b/sus/archive/2008/05/19/wsus-how-to-change-the-location-where-wsus-stores-updates-locally.aspx wsusutil.exe movecontent… Read More »

Setting maximum memory limits on SQL embedded instances

Open up SQL Server Management Studio, connect to \\.\pipe\mssql$microsoft##ssee\sql\query, right click the server and click Properties. Set the Max Server Memory to 256.   Recommendations for the usual suspects… Instance Tried and tested Max Limit microsoft##ssee 256mb WSUS 256mb SBSMonitoring 70mb SharePoint Unknown – Not been brave enough to tweak this. Seen 384mb as a suggestion.Set Abstrakt… Read More »

WSUS Cleanup v2 Script

WSUS_Cleanup_v2 Must be unzipped to C:\ (so it becomes C:\SCRIPTS). Import the scheduled take by going into Task Scheduler, clicking Import Task, navigating to C:\SCRIPTS and selecting WSUS_Cleanup_v2.xml. I recommend calling the task WSUS_Cleanup_v2 Warning : If run on a server which hasn’t been tided for a while it may take MANY HOURS (I’ve seen it take… Read More »

Webserver & SSL Hardening – IIS

IIS-Hardening-1-Disable-insecure-Ciphers-and-Hashes I believe that a reboot is required for the configuration to take effect. A reboot is required. May not be required for Windows 2003 / IIS6? Might get away with a “iisreset /restart” Useful links to check before and after applying the registry script. http://www.serversniff.net/sslcheck.php https://www.ssllabs.com/ssltest/analyze.html https://www.nartac.com/Products/IISCrypto

glib consistently being reinstalled

# portmaster -DaG ===>>> Starting check of installed ports for available updates ===>>> The devel/gio-fam-backend port moved to devel/glib20 ===>>> Reason: Obsoleted by new functionality in glib20 ===>>> Launching child to reinstall gio-fam-backend-2.34.3 ===>>> All >> gio-fam-backend-2.34.3 (1/1) ===>>> The devel/gio-fam-backend port moved to devel/glib20 ===>>> Reason: Obsoleted by new functionality in glib20 ===>>> Currently… Read More »

Munin stopped working after a ports update yesterday

The graphs in Munin weren’t appearing after I preformed a ports update yesterday. When viewing the graphs in a separate tab I received the following error message. Can’t load ‘/usr/local/lib/perl5/site_perl/5.14/mach/auto/RRDs/RRDs.so’ for module RRDs: Shared object “libpixman-1.so.9” not found, required by “librrd.so.6” at /usr/local/lib/perl5/5.14/mach/DynaLoader.pm line 190. at /usr/local/lib/perl5/site_perl/5.14/Munin/Master/GraphOld.pm line 46 Compilation failed in require at /usr/local/lib/perl5/site_perl/5.14/Munin/Master/GraphOld.pm… Read More »

FreeBSD and phpList : White Screen of Death

Despite turning on errors in php.ini I wasn’t getting any error messages when I went to http://ipaddress/lists/ or http://ipaddress/lists/admin/, I just received a white screen of death. After adding error_log() statements thoughout the code to trackdown the issues I discovered that execution was getting as far as line 198 in /lists/admin/init.php ## remember the length of a hashed string… Read More »

Disable Windows Update Forced Reboots

Registry Method Open Registry Editor and create a DWORD called NoAutoRebootWithLoggedOnUsers under HKEY_LOCAL_MACHINE, SOFTWARE, Policies, Microsoft, Windows, WindowsUpdate and finally AU.  The value of NoAutoRebootWithLoggedOnUsers must be set to 1 to enable and 0 to disable.   Group Policy Method Open Group Policy editor and navigate through Local Computer Policy, Computer Configuration, Administrative Templates, Windows… Read More »