Author Archives: Stephen Scotter

Spectrum FreeBSD Servers SVN Setup

If SVN not installed (on the older servers) install by doing… portsnap fetch update cd /usr/ports/devel/subversion && make install clean If svnlite is already installed do… ln -s /usr/bin/svnlite /usr/bin/svn Once installed checkout our repos mkdir /scs cd /scs/ svn checkout https://svn.spectrumcs.net:9443/svn/freebsd-scripts/ svn checkout https://svn.spectrumcs.net:9443/svn/freebsd-preferences/

Traffic Capture Software

I usually use Wireshark but strumbkled accros this recently… Microsoft Network Monitor https://www.microsoft.com/en-gb/download/details.aspx?id=4865 https://en.wikipedia.org/wiki/Microsoft_Network_Monitor After I installed Microsoft Network Monitor I read the Wikipedia page I discovered Microsoft Network Monitor was been superseded by Microsoft Message Analyzer  (https://www.microsoft.com/en-us/download/details.aspx?id=44226). Microsoft Network Monitor seems to work on Windows 7 64bit, but I’ll give Microsoft Message Analyzer a try when I get a… Read More »

How to check WordPress versions on your server are up to date

Original script at https://www.howtoforge.com/how-to-find-outdated-wordpress-versions-on-your-server-to-reduce-the-risk-of-being-hacked This script has been improved to automatically detect latest WordPress version by sending a HTTP HEAD request to http://wordpress.org/latest and parsing the Content-Disposition: attachment; filename=wordpress-A.B.C.tar.gz result as suggested at https://wordpress.org/support/topic/programmatically-check-latest-wp-release <?php /** * find outdated wordpress versions * (c) 2014 howtoforge.com (M. Cramer) <m.cramer@pixcept.de> * Appended by Steve Scotter www.stephen-scotter.net */ if(!isset($argv[1])) die(“Please start this program with… Read More »

Moving from DIG to HOST

Query a particular DNS Server for a hostname dig @ ns1.namecity.com helpdesk.spectrumcs.net host helpdesk.spectrumcs.net ns1.namecity.com Query for MX records dig mx helpdesk.spectrumcs.net host -t MX helpdesk.spectrumcs.net Query for MX records dig NS spectrumcs.net host -t NS spectrumcs.net Reverse DNS dig -x 109.169.47.183 host 109.169.47.183 Possibly useful flags -a            Make a verbose query of type… Read More »

Office 2013 – Subscription expired but not using 365?

Office 2013 – Subscription expired but not using 365? This appears to happen if you’ve inserted say a Office 2013 H&B product key into a fresh PC which came with Office 2013 installed. Not sure exactly whats going on, but I suspect the pre-installed Office is Office 365, not Office 2013. The solution is as follows…… Read More »

Updating SBS 2011 Exchange 2010 to SP3

Common problems…  A previous software update installation was not completed. The system must be restarted to finish the installation. If the incomplete installation was a security update, then the system may be at risk until it is restarted. https://technet.microsoft.com/en-us/library/cc164360(v=exchg.80).aspx First thing to check is if the server needs a restart due to Windows Updates or… Read More »

Create large dummy file

Fsutil.exe is a built in filesystem tool that is useful to do file system related operations from command line. We can create a file of required size using this tool. syntax to create a file: fsutil file createnew filename length (length is in bytes) For example, to create a file called test.txt  and of 1GB in size:… Read More »

Error 800B0001 and using a WSUS?

Short version Download and install http://www.microsoft.com/en-us/download/details.aspx?id=29999 (avoid rebooting if required, doesn’t seem to effect the effectiveness of the hotfix) sc stop WsusService iisreset /stop iisreset /start sc start WsusService Longer version BACKGROUND: Every machine I install the lastest Windows Update Agent on results in a 800B0001 error when getting updates “FROM YOUR SYSTEM ADMINISTRATOR” but have no problems when… Read More »

MS SQL – Preferred data types

Decimal Numbers… DECIMAL(18,0) will allow 0 digits after the decimal point. Use something like DECIMAL(18,4) instead that should do just fine! That gives you a total of 18 digits, 4 of which after the decimal point (and 14 before the decimal point). Question Sum’ing data of type REAL resulted in a total with about 10… Read More »

Transfering MySQL database between hosts

The single command approach mysqldump -h oldhost -u oldusername -poldpassword olddbname | mysql -h newhost -u newusername -pnewpassword newdbname make sure you can … mysql -h newhost -u newusername -pnewpassword newdbname … before attempting the transfer. Common issues are :- Firewall preventing access to MySQL server across the network User configured to only be able… Read More »

SCS SVN setup procedure

Download and install (Typical) SlikSVN (https://sliksvn.com/download/) Open a CMD prompt CD C:\ MKDIR SCS CD SCS svn checkout https://rainbow.spectrumcs.net:9443/svn/windows-server-tools

FreeBSD, Fatal error: Call to undefined function geoip_country_name_by_name()

Getting Fatal error: Call to undefined function geoip_country_name_by_name() ? Install /usr/ports/net/pecl-geoip # cd /usr/ports/net/pecl-geoip && make install clean # “/usr/local/www/awstats/cgi-bin/awstats.pl” -update -config=account.ptiexpress.com -configdir=”/usr/local/etc/awstats/” Error: Plugin load for plugin ‘geoipfree’ failed with return code: Error: Can’t locate Geo/IPfree.pm in @INC (you may need to install the Geo::IPfree module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.18 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.18/mach /usr/local/lib/perl5/5.18 /usr/local/lib/perl5/site_perl/5.18 /usr/local/lib/perl5/site_perl/5.18/mach… Read More »

Windows Firewall Diagnostics

While looking into what wermgr.exe was () and why it was trying to communicate with 65.55.53.190 I found this page with some useful information about how to generate a XML file with the reasons why a connection is blocked… http://superuser.com/questions/451862/windows-firewall-blocks-outbound-connection-that-is-allowed-by-a-rule After asking for help in the Windows Filtering Platform (WFP) forum on MSDN I learned that you can… Read More »

Reset File NTFS Permissions to default

As yet unconfirmed… secedit /configure /db secedit.sdb /cfg %SystemRoot%\defltwk.inf /overwrite /verbose https://www.raymond.cc/blog/apply-hardening-on-windows-7-windows-server-2008-using-command-line/

Symlink, ln

Common synlink’s you do. ln -s /usr/bin/svnlite /usr/bin/svn ln -s /usr/local/share/munin/plugins/scs_directory_size_v3_ /usr/local/etc/munin/plugins/scs_directory_size_v3___var___db___mysql ln -s [SOURCE FILE / DIR] [CREATE SYM LINK HERE]

FreeBSD changing shells quickly

Change shell to sh # chsh -s /bin/sh <username> Change shell to nologin # chsh -s /usr/sbin/nologin <username> Change shell to scponly # chsh -s /usr/local/bin/scponly <username> Quickly checking which users have non nologin shells # grep –invert-match ‘nologin’ /etc/passwd

GhettoVBC, ESXi 5.5 & Crontab

# vi /etc/rc.local.d/local.sh Make the contents something similar to the following… #!/bin/sh # local configuration options # Note: modify at your own risk! If you do/use anything in this # script that is not part of a stable API (relying on files to be in # specific places, specific tools, specific output, etc) there is… Read More »

Munin-node initial setup

For a list of plugins that will probably work run /usr/local/sbin/munin-node-configure –suggest If this is a fresh install run /usr/local/sbin/munin-node-configure –shell | sh -x to install the plugins automatically