Skip to content

Instantly share code, notes, and snippets.

View drj11's full-sized avatar

David Jones drj11

View GitHub Profile

Average CPU job: 4900 seconds

$ awk -F: '{print $35, $37}' 1percent | awk '{a+=$2};END{print a/NR}'
4852.23

Average number of cores, per CPU second

awk -F: '{print $35, $37}' 1percent | awk '{p+=$1*$2;a+=$2}; END {print p/a}'
@drj11
drj11 / pcxnbrief.md
Last active June 10, 2016 10:52
PCXN brief

We would like you to have a look at the website http://pcxn.org/ and provide a brief critique of no more than 200 words.

To guide you, we've written out a suggestion to get you started (below). Please try this and spend about 10 minutes having a poke about. Write up your thoughts, paying particular attention to what you would do to improve things.

Please e-mail your written critique (200 words max) to [email protected]; Any questions or clarifications to the same e-mail address.

Suggested starting point.

@drj11
drj11 / pathway
Created June 10, 2016 09:34
Metabolic Pathway Starter List
Pentose and glucuronate interconversions (KEGG)
Fructose and mannose metabolism (KEGG)
Lysine degradation (KEGG)
Starch and sucrose metabolism (KEGG)
Pantothenate and CoA biosynthesis (KEGG)
Nitrogen metabolism (KEGG)
Phase I, non P450 (Wikipathways)
Ganglio Sphingolipid Metabolism (Wikipathways)
Urea cycle and metabolism of amino groups (Wikipathways)
Biogenic Amine Synthesis (Wikipathways)
for current_attempt in range(MAX_DNS_ATTEMPTS):
print("Checking for DNS record, attempt: {}/{}".format(current_attempt+1, MAX_DNS_ATTEMPTS))
try:
dns_answer = dns.resolver.query(host, 'TXT')
if not dns_answer:
continue
for dns_rrset in dns_answer.rrset:
@drj11
drj11 / git-pop.md
Last active May 23, 2016 15:33
10 most git
$ grep ^git ~/.bash_history | sort | uniq -c | sort -rn | head
     37 git diff
     22 git status
     20 git push origin HEAD
     16 git commit -a -v
      8 git rebase
      6 git fetch
      5 git commit -v
 5 git checkout develop
@drj11
drj11 / ASCII.md
Last active October 23, 2022 03:35
How to memorise ASCII

How to memorise ASCII

You don't need to memorise ASCII as there is a handy chart available by typing man ascii in a Terminal. However, you may find it useful to remember some fun facts about ASCII.

Blocks of 32 are useful. 32 is 2⁵ (2 raised to the power 5) and a block of 32 is enough to represent all 26 common english letters plus some extra stuff.

ASCII is a coding for the first 128 numbers. 0 to 127.

How to use strace to solve a mystery (with bash)

So I'm dabbling with iceberg, The University of Sheffield's HPC, and I finally get round to putting my .profile on there. And I remember that I don't like the way less clears the screen when I've finished reading a man page.

I need to set my LESS environment variable to -X. So I add that to my .profile. I do exec bash -l to emulate logging back in.

@drj11
drj11 / README.md
Created April 25, 2016 16:02
Why I like `sh thing`
@drj11
drj11 / id_rsa.pub
Created April 24, 2016 08:46
My public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8QHn4M2w2ZEIpYdx+dZDwhvWdrzotiHxG75EIRsDVdt/WdKKvMifFdj7j4i1nR1fzjEDusDIWw3y7JSagueE/vIGnEfV4mvxLQiM73X8c+7EgwF4LpD98BKR1HMvdgvqbSBQwxLnZJfVGjsxxkTl+UWzQVWIU4xFepfYcofinELdBCg3B8I5c96md0cL2XpUNINO9kLKxsDrlLGVw9w5q77HdDjthqkJhiPFebVa4mda4kwX0auCnp4XZe0WOOMYrvVLmL4RpyV80k3sBznl48b/tnCiDOjQV9q7+49l47+EVqXGnDfjMn0dmnGwGpeeqyTPksqwIa13IlPEbFzCT drj@ash
@drj11
drj11 / response.md
Last active April 19, 2016 20:56
Land Registry Consultation Response

consultation document https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/510987/BIS-16-165-consultation-on-moving-land-registry-operations-to-the-private-sector.pdf

the consultation makes references to "Autumn Statement" and "the Chancellor" (executive summary, para 2, page 5) without further explanation or reference to these documents and roles. That detracts from the clarity of the consultation document.

executive summary, para 3, page 5, asserts that the Land Registry underpins a valuable property market, without qualifying that by explaining that not all land (or even owned land) is in the registry.