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…
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…
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’…
here’s how to replace text in a file with perl: perl -pi -e ‘s~OLDTEXT~NEWTEXT~g’ /path/to/filename
I needed to rename a bunch of apache virtual hosts to *:80 and *:443. Here’s an example that renames to httpd.confr and changes :80 and :443 to *:80 and *:443: # sed -ir ‘s/VirtualHost [0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}:80/VirtualHost *:80/’ # sed…
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…
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,…
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…
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’…
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…
This info courtesy of inotekgroup and Paulo Morgado: The problem You want to use a different username and password to connect to a SQL Server but the Windows Authentcation Username/Password are greyed out / disabled! When connecting to a SQL…