Skip to content

Instantly share code, notes, and snippets.

View johngh's full-sized avatar
🏝️
Looking forward to enjoying time on Aotea

John Harrison johngh

🏝️
Looking forward to enjoying time on Aotea
View GitHub Profile
@johngh
johngh / find_long_running_processes.txt
Last active August 29, 2015 14:01
Find any processes over 8 hours old
On your boxes, does this:
ps -e -o user,pid,ppid,etime,stime,args
work to show the time that the process has been running for (ELAPSED), and when it was started (STIME)?
If so, they will be in the format:
root 10331 1 31-09:25:11 Apr_08 su -c su oracle -c /u03/app/batch/scripts/import_locatn.sh …
@johngh
johngh / host_locations.sql
Created July 25, 2014 19:08
SQL query to build single row results from data in multiple rows
--
-- Create table for testing
--
BEGIN TRANSACTION;
CREATE TABLE host_locations(
name VARCHAR(30),
qualifier VARCHAR(30),
value VARCHAR(30)
@johngh
johngh / gist:4ac7b348cdc4e4af2b3f2faf8647a100
Created December 31, 2018 19:30
Python print SyntaxError doesn't give reason if the line contains a '('
$ python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
# Print a string
>>> print("string")
string
# Try to print a string but forget the parentheses