ps to find command line

January 10, 2019

I wanted to use ps on linux to find the full command line that a process was started with. This can be done using the options -eaf

ps -eaf | grep drumcoder                     
root     28382 28322  0 08:18 pts/0    00:00:00 /home/drumcoder/.venv/drumcoder/bin/python /home/drumcoder ...

Tags: ps gunicorn

Debugging gitignore

November 8, 2018

If you have a file being ignored by git and you try to add it, you'll get a message something like this:

The following paths are ignored by one of your .gitignore files:
Use -f if you really want to add them.

To find out ...

Finding string in BASH array

November 5, 2018

I had a need to go through an array variable in bash and see if certain strings were present in the specified order. The existing code looked for values at specific array indexes, but this was deemed too fragile. The fix was to make sure that the strings were present ...

Testing Internal Methods in C#

October 16, 2018

When you have a C# project that contains methods marked internal, they can be tested from a separate Tests project.

In the project to be tested, open up Properties/AssemblyInfo.cs and add

[assembly: InternalsVisibleTo("ViewerTests")]

where ViewerTests is the name of the project that contains the tests.

This ViewerTests ...

Active SQL Statements on Oracle

October 2, 2018

This query can be used to show the active SQL statements, and their elapsed time, on an Oracle database.

SELECT nvl(ses.username,'ORACLE PROC')||' ('||ses.sid||')' USERNAME,
  ltrim(to_char(floor(SES.LAST_CALL_ET/3600), '09')) || ':'
   || ltrim(to_char(floor(mod(SES.LAST_CALL_ET, 3600 ...