Split() function for Microsoft MSSQL
Microsoft MSSQL doesn’t have a split() function (like in Ruby, Perl), so here’s one I wrote.
Microsoft MSSQL doesn’t have a split() function (like in Ruby, Perl), so here’s one I wrote.
I’m porting some code from MySQL to Microsoft MSSQL, and unfortunately MSSQL doesn’t have a SUBSTRING_INDEX function. Here’s a version I quickly implemented, called my_substring_index.
Creating an SSIS Catalogue on Microsoft SQL 2012 seems to have an interface bug - you need to both “enable CLR” and provide an “encryption password”, but the options are mutually exclusive ie when I tried to type in a password, the interface locks the password fields.
When setting up TunnelBlick, if you have multiple configurations in your ~/Desktop/foo.tblk folder, you’ll get an error in the console log like:
I’ve written this post for the non-technical people I do “tech support” for.
Some notes on Emacs’ Paredit mode.
Years ago I wrote a post on how to [Backup multiple MySQL databases into separate files]1.
The WordPress Clear Line Theme has paginators at the bottom of pages, that have links to Previous Page and Next Page. Changing them to say something like Newer Posts and Older Posts is easy – you need to edit the following four files:
The default settings in the WordPress Clearline Theme (and most WordPress themes) will display a box of settings containing things like “Site Admin”, “Login”, “Entries RSS”, etc. This is called the Meta Widget.
The WordPress Clearline theme displays categories not tags for posts, and doesn’t have a way of modifying it’s behaviour through the settings area. This is easily fixed with a one line code change:
My venerable [Palm Treo 550][1] is showing it’s age ([as is the company][2]), so I’ve been looking for a new phone platform to migrate to for a few years. And since I’m now working for Google, Android is the obvious choice ([dog-fooding][3] and all that).
A nice little script snippet I like to remember for automating quick stuff across multiple hosts. -t forces tty (so sudo will work); -q quiet – disable banners; -c script (“command”) to su. Presumes sudo doesn’t prompt for a password; otherwise, see [Expect][1] and [Exploring Expect][2] :-)
A nice [post][1] from Jake on the SLUG list where he asks about a small clustering setup:
From a discussion ([Ruby – The Non-awesome parts][1]) on the [RORO][2] email list – the differences between Time, Date, DateTime and TZInfo:
iTunes’ syncing of movies and podcasts is a big lame – there’s not enough fine grained control.
If ssh logins are taking a long time (but are ultimately successful), it may be because Kerberos (gssapi) is being attempted as an authentication method, and the destination is incorrectly configured (often seems to be CentOS or RHEL):
When I’m working with git, I like being able to see a list of files that have changed (new, modified, deleted, etc) in the commit message. So when I do a git log, rather than getting this:
I stumbled across a limitation feature behaviour of Solaris over the weekend – by default it only allows you to run a maximum of 100 cron jobs at once. I suppose this to protect against “shooting oneself in the head”, but aaaarghhh. Reminds me why I love Monday mornings.
I’m busy learning [LISP][1]/[Scheme][2] at the moment (in order to later move on to [Clojure][3]).
A nice git option I stumbled upon today – [amend][1].
A very interesting [post][2] from André Pang about some issues he came across with lamdas and closures in Python. Well, interesting to me because I’m playing with Lisp and Python at the moment.
I’m bored, so I’m going to learn Lisp.
A SlashDot linked [article on Mirah][1] – Java with Ruby syntax (different from JRuby).
Scenario: the current Solaris Sparc system is booting off a single UFS disk (eg when cloned from an image).
Sometimes when connecting into a Solaris box via multiple jumps eg Citrix to putty to jumphost to target host, the terminal can get confused about screen size and scramble the output.
. in Firefox 3.6 however only new tabs are opened at the far right of the tabbar while new tabs that are opened from existing tabs
A useful [script ][1]from BigAdmin for increasing the size of a tmpfs /tmp without rebooting.
The latest edition of the venerable [UNIX and Linux System Administration Handbook]1 has a good section discussing the “RAID5 Write Hole”:
A work colleagues used an interesting technique to rapidly build some Solaris systems. We usually use Jumpstart but due to the large number of identical systems to be built, he had to use a faster method.
An example of Solaris IP Multipathing, for future reference:
Note to brain: line numbering in a file can be done using nl – easier than using sed.
Some quick Squid notes, from O’Reilly’s “[Squid The Definitive Guide][1]”
[sshpass][1] – a tool for non-interactively performing password authentication with SSH’s so called “interactive keyboard password authentication” – useful for automation scripts where you are unable to use ssh keys.
Or, after RTFM’ing, an easier way: [SunDocs Recovering ALOM passwords][1]:
When creating a new Solaris zone, one of the steps involves connecting to the zone’s console for the initial configuration:
The only time I use Windows is as a virtual machine “appliance” ie it’s running some application that I have to run, that only runs on Windows.
When running the ps command on Solaris, the output is truncated at 80 columns – really annoying when the command line to start up a process (typically a daemon) is really long.
Solaris has a feature called [RBAC][1], that allows you to provide role-based security (I believe this is similar to [SELinux][2]).
A concise [article][1] on Linux.com (that I keep referring back to) about vim folding.
Problem: You work in an organisation with locked down desktops that have stupidly short screensaver timeouts.
How to connect to a Cisco device (or other serial devices) using OSX and a USB to Serial converter (eg ATEN).
Using cygwin under Windows, I’ve setup my shell as zsh by editing the launch script:
When doing a git clone from a repo hosted on a Mac OSX machine (installed using macports), I get this error on the client (Linux, cygwin, whatever):
A nice little tool I came across – [DeltaCopy][1] –
A couple of good links [[1][1]][[2][2]] came up on the [Axxs collective][3] email list about monitoring disk activity under Linux using block_dump.
A link off the [RORO][1] list about [Why “require ‘rubygems’” Is Wrong][2].
I’ve started playing with Ruby 1.9 – the latest and greatest version of Ruby. On Ubuntu Jaunty, 1.8 is considered mainline and 1.9 experimental – here are the shell aliases if using 1.9:
An interesting Ruby example of an easy way to setup classes that are really just for passing around data using Struct – essentially a neat wrapper around a hash of values:
A nice Ruby example (for my reference) showing how to parse commandline options; the results are put in a hash called options (created on line 3).
A good summary (for my reference) of the assertions that can be used with Test::Unit ([from Pragmatic Programmers’ Programming Ruby][1]).
A nice ruby example (for my reference) of using here documents to load data/logic. From [Pragmattic Programmers’ Best of Ruby Quiz][1]:
Ruby’s rcov had a workaround for a breakage in the rexml library, but the workaround [broke][1].
A couple of scripts I (very) quickly wrote for managing git branches, so I don’t have to keep reading[ git cheat][1].
Up until a few weeks ago I was using subversion for all my personal stuff.
Netapp volumes by default are created with snapshots turned on; if the volume is being used for backups (for example), the snapshots just use up space.
A bug that has been dragging on for [years][1] – Firefox under Ubuntu (and other distros) doesn’t respect the locale setting,
More notes on Oracle RMAN backups, see also [Oracle – how to purge old RMAN backups][1]. Thanks Raoul for your email.
I use [keychain][1] for securely [caching my ssh key credentials when running scripts from cron][2].
I’m back to Rails development after a few months doing other things.
@INC – like $PATH for do, require, use
Firewalling on Solaris 10:
Some notes for me as I attempt to get a better understanding of Perl’s variable scoping rules. A work in progress.
Some notes on Perl’s use, require, import and *do. *Quick notes for me; not meant to be authoritative.
A quick note on how to rotate jpeg images, not because it’s earth-shatteringly smart but so I don’t keep having to think every time I want to do it:
Just a small script I wrote to play around with various ways of passing parameters in Ruby:
When using the Rails helper select_tag, the selected value (ie highlighted value) is a parameter to options_for_select, not select_tag.
When Linux HA (High Availability) is setup, each machine will have a physical address, and one machine should also have the virtual address.
Some notes on branch management with Subversion (more for my own learning purposes than anything):
A [nice article][1] I came across while trying to remotely solve a gnome-session issue.
Some notes on shutting down and starting up Oracle, taken from an email.
I still use JPilot for syncing with my Palm Treo – an old app but I like it, especially because of JPilot-Keyring.
Oracle runs on Linux, therefore I must be an Oracle expert (so goes management thinking).
A tool I’d forgotten about – [autossh][1]. Also an article [here][2]. Thanks Dean.
A good [article][1] on disk MTBF (Mean Time Between Failures), that clarified my understanding (thanks Jarek).
Quick notes; [see Solaris: Logging to a separate loghost, the easy way][1].
As an ex-DBA, one of the things that annoys me about Rails is that migrations don’t have a way of setting up referential integrity (I’m still using Rails 1.2.3, so this may have changed).
[ssh][1] is normally used nowadays instead of telnet for remotely accessing Linux servers (and other devices), as telnet is an insecure plain text protocol (and passwords can be easily captured using tools like [dsniff][2]).
Good post on [Debian Administration][1] about [Creating global keyboard shortcuts in GNOME][2].
[Mary Gardiner][1] [answered][2] one of Voytek Eymont’s questions on the [SLUG list][3] by referring to the [ssh socks proxying][4] post on Ubuntu Blog.
There’s an article [here][1] that explains how to connect to a mysql database from OpenOffice.org Base using odbc,
I use ssh to tunnel all the time, especially to get around brain-dead firewalls.
I enjoy listening to podcasts during my commute, and most podcasts can be easily downloaded using my favourite podcasting tool (currently customised bashpodder, but I’m writing my own).
Copied verbatim from [Jeff Waugh’s post][1] on [SLUG][2]:
(todo – test/verify/summarize these links:)
A good thread recently on SLUG about how to remaster an Ubuntu Live CD:
If running a recent kernel, just plugin and check option module is being loaded
A quick cheatsheet for setting up a forwarding, caching-only DNS Server on Ubuntu.
Here’s a variety of tricks I’ve picked up for Gnu screen and .screenrc from the [Screen Users Email List][1]
To convert an Ubuntu installed with English to Spanish, install the following packages:
The instructions given by NoMachine for setting up on Linux are a bit thin; here’s my own version:
NetworkManager: “When I’m good, I’m really really good. But when I’m bad.“. Some tricks I’ve found for troubleshooting NetworkManager:
Whilst traveling through Mexico and Guatemala, I’ve had various problems with slow and/or faulty dns resolution.
My first task in Guatemala was to get Jesus’s wireless going.
A couple of notes on working with the ipw2200 wireless card on a Compaq nc4200 running Ubuntu (7.04 and 7.10), including how to get the blue LED to work:
KDan (via [Slashdot][1]) has a great post on [how to recognise a good programmer][2]; I think many of his points also apply to system administrators.
A [good post on debian-administration][1] on multi-user screen. The key points:
See Also:
Often a subversion server is on an internal server that can’t be reached by a DMZ server, and ssh+svn isn’t setup. Here’s a quick recipe for ssh tunnelling from the subversion server to the DMZ server and using svn.
As far as /etc/iftab goes, this is not used in Ubuntu 7.10
anymore..this functionality is moved to hotplug,. and maybe causing
your prob.
Summary
To setup ssh and keychain to allow ssh related jobs to run from cron:
(draft)
[Expect Language][1], [Expect Book][2].
Summary
Examples:
dev.msql.com [logging documentation][1]
On Debian based systems, MySQL logging (and logrotation) is setup automatically so I’ve never had to worry about it. Unfortunately, I’m not using Debian at the moment.
dev.mysql.com [replication documentation][1]. Replication on MySQL is similar to Log Shipping on MS SQL; the default is statement level replication, but newer versions also offer row-based replication.
Some guidelines for understanding MySQL security:
Examples of working with multiple mysql versions on the same machine:
There are three fields (separated by colons) that can be manipulated using the bang history command:
After doing a fresh install of Ubuntu 7.04 and installing all pending updates via Update Manager, I get an error that starts like this:
Reconfigure X.org on Ubuntu
libdvdcss2 and w32codecs for Ubuntu
MSSQL Resources
Here are schema diagrams for the Microsoft SQL 2005 AdventureWorks sample database:
Some notes on the startup sequence for Mac OSX 10.4 (Tiger), and troubleshooting the startup process. These will be corrected/expanded as I learn more about the process.
The title says it all. [ESR][1] has [given up on Fedora and moved to Ubuntu][2]. Thanks to [BarraPunto][3].
misc cheat sheets
howto reverse ssh tunnel
sed notes 2
session management Ubuntu Dapper
log shipping hints
In this exerise, you are required to move two of the system databases (master and model) to c:data. Here are some web pages that may help:
When I upgraded to Ubuntu Dapper, Flash sound stopped working in Firefox – oh no, no more YouTube!
Here’s a couple of links on how to move the MS SQL Server system databases:
Here are some useful tools for troubleshooting/recovering windows systems:
rsync notes
Quick and dirty on installing OpenLDAP as an addressbook server.
[This guide][1] was started by Chua Wen Kiat (Kuala Lumpur, Malaysia). It is now being maintained by the Linux Center of University of Latvia, and everyone else who is willing to contribute.
ubuntulite.org
installing VMWare on Ubuntu
atheros wireless
multiserver jobs exercise
Site to generate an ubuntu sources.list for your preferred set of repositories. Just tick all repositories you want; the default set is selected automatically.
guest and public
Backup multiple MySQL databases into separate files
Connect to MySQL across network using MS Access
MySQL notes 2
Reset lost MySQL root password
MySQL notes
sql 2000 administration exercise
automatix – nice Ubuntu tool