Schlagwort: Knowledge Base Meine Wissensdatenbank mit Aufgaben und Problemen, die ich gelöst habe.
Oracle: SELECT top N rows skipping the first X rows
Apparently, it is not possible to use Oracle’s pseudo column rownum to select rows after a given number of rows, e.g. like SELECT * FROM tab WHERE rownum > 100; or in MySQL SELECT * FROM tab LIMIT 100,50; Oracle’s explanation for this (from the DB reference: ROWNUM): The first…
Git ignores .gitignore when working with PowerShell
PowerShell: Check whether a Windows command or executable is available
In one of my recent PowerShell scripts I needed to find out if certain commands (in my case “svn”, “git”, “ant” and “mvn”) were available or not. I wrote this small function that tries to call the given command and returns whether it is callable. function commandAvailable($cmd, $options) { $error.clear();…
VBoxManage: error: VT-x features locked or unavailable in MSR. (VERR_VMX_MSR_LOCKED_OR_DISABLED)
Today I wanted to add a new 64bit virtual machine to my VirtualBox installation but when I tried to power it on I got the following error message: root@debian /home/vms/Webserver # VBoxManage startvm Webserver –type headless Waiting for VM “Webserver” to power on… VBoxManage: error: VT-x features locked or unavailable…
Connecting to an Oracle database via ODBC using only the InstantClient
PowerShell: How to read contents from text files without converting the lines into an array
Apparently, PowerShell’s get-content cmdlet automatically converts the contents of text files into an array of strings, splitting the contents at the line breaks (see Using the Get-Content Cmdlet). In many cases this is convenient: Contents of file test.txt: 1 2 3 gc text.txt | % { write-host “line: ” $_…
Single Sign On with Kerberos using Debian and Windows Server 2008 R2
Recently, I wanted to add single sign on (SSO) functionality to our intranet server, which runs a Debian Linux. Users should be automatically logged in to the website using their Windows user accounts, which are stored in an Active Directory on a Windows Server 2008 R2, without entering their credentials…
Enable Remote Desktop Connections on a remote PC
Sometimes you need to logon to a remote PC via RDP but the PC is not configured to allow remote connections. Instead of walking over to the machine and setting the needed configuration manually, you could enable RDP connections on the remote PC using regedit as follows: start regedit and…
Resize and rotate all images in a Word 2010 document
Just a little snippet to resize and rotate all images in a Word 2010 document. I needed it to create a table with multiple images per row/column from some dragged and dropped images. Option Explicit Sub ResizeAndRotateAllImages() Const ROTATION = 90 Const HEIGHT = 7 Dim n As Integer For…
Meine Wissensdatenbank mit Aufgaben und Problemen, die ich gelöst habe.
Oracle: SELECT top N rows skipping the first X rows
Apparently, it is not possible to use Oracle’s pseudo column rownum to select rows after a given number of rows, e.g. like SELECT * FROM tab WHERE rownum > 100; or in MySQL SELECT * FROM tab LIMIT 100,50; Oracle’s explanation for this (from the DB reference: ROWNUM): The first…
Git ignores .gitignore when working with PowerShell
PowerShell: Check whether a Windows command or executable is available
In one of my recent PowerShell scripts I needed to find out if certain commands (in my case “svn”, “git”, “ant” and “mvn”) were available or not. I wrote this small function that tries to call the given command and returns whether it is callable. function commandAvailable($cmd, $options) { $error.clear();…
VBoxManage: error: VT-x features locked or unavailable in MSR. (VERR_VMX_MSR_LOCKED_OR_DISABLED)
Today I wanted to add a new 64bit virtual machine to my VirtualBox installation but when I tried to power it on I got the following error message: root@debian /home/vms/Webserver # VBoxManage startvm Webserver –type headless Waiting for VM “Webserver” to power on… VBoxManage: error: VT-x features locked or unavailable…
Connecting to an Oracle database via ODBC using only the InstantClient
PowerShell: How to read contents from text files without converting the lines into an array
Apparently, PowerShell’s get-content cmdlet automatically converts the contents of text files into an array of strings, splitting the contents at the line breaks (see Using the Get-Content Cmdlet). In many cases this is convenient: Contents of file test.txt: 1 2 3 gc text.txt | % { write-host “line: ” $_…
Single Sign On with Kerberos using Debian and Windows Server 2008 R2
Recently, I wanted to add single sign on (SSO) functionality to our intranet server, which runs a Debian Linux. Users should be automatically logged in to the website using their Windows user accounts, which are stored in an Active Directory on a Windows Server 2008 R2, without entering their credentials…
Enable Remote Desktop Connections on a remote PC
Sometimes you need to logon to a remote PC via RDP but the PC is not configured to allow remote connections. Instead of walking over to the machine and setting the needed configuration manually, you could enable RDP connections on the remote PC using regedit as follows: start regedit and…
Resize and rotate all images in a Word 2010 document
Just a little snippet to resize and rotate all images in a Word 2010 document. I needed it to create a table with multiple images per row/column from some dragged and dropped images. Option Explicit Sub ResizeAndRotateAllImages() Const ROTATION = 90 Const HEIGHT = 7 Dim n As Integer For…