Category Scripts

bash diff alternative

How to setup a bash diff alternative nano -w /usr/bin/diff2 Copy and paste the below in to /usr/bin/diff2 #!/bin/bash # # name: diff2.sh # usage: . file1 file2 # To make available to whole system copy to /usr/local/bin # and…

grep ifconfig list ips

Linux ifconfig Example Type the following command: ifconfig | grep ‘inet addr:’| grep -v ‘127.0.0.1’ | cut -d: -f2 | awk ‘{ print $1}’ FreeBSD/OpenBSD ifconfig Example Type the following command: ifconfig | grep -E ‘inet.[0-9]’ | grep -v ‘127.0.0.1’…

oracle password expiration help

I’m using Oracle 11g and was really confused on how the password expiration date was set (default values). To retrieve the default password expiration values set for all new users run this query: select LIMIT, RESOURCE_NAME from dba_profiles where RESOURCE_NAME…

redmine all users projects query

Ever needed to get all projects associated with every user in redmine?  Here’s a query that will help Multiple Joins sql query; To get user, all projects associated with user and role on that project.  Exmaple: Table Column Names users id,…

Howto: C# Generate dump file on crash

how to generate a dump file on application crash in c# using System; using System.Collections.Generic; using System.Windows.Forms; using System.Runtime.InteropServices; using System.IO; namespace DBGHelp_Sample { static class Program { /// /// The main entry point for the application. /// [STAThread] static…

SpiraTeam query all users and roles

I needed a script for an audit of SpiraTeam to query all users and roles. And here it is: /****** Script for SelectTopRows command from SpiraTeam ******/ SELECT TOP 1000000 [FULL_NAME] ,[PROJECT_ROLE_NAME] ,[PROJECT_NAME] ,[ACTIVE_YN] FROM [SpiraTeam].[dbo].[VW_PROJECT_USER] where ACTIVE_YN like ‘Y’…

mssql truncate all log files

Learn in MSSQL how to truncate all log files! This transact-sql statement uses the core truncation method recommended by Microsoft.mssql truncate all log files mssql truncate all log files on a MSSQL 2000, 2005 server DECLARE @db varchar(255) declare @sql…