Skip to content

Instantly share code, notes, and snippets.

View wjessop's full-sized avatar
🤖

Will Jessop wjessop

🤖
View GitHub Profile
Ubuntu:
root@willtesting:/var/log# openssl ciphers -v | grep TLS
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384
ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384
DHE-DSS-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=DSS Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES256-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(256) Mac=SHA256
package main
import "fmt"
func main() {
fmt.Println("Hello world!")
}

Simple fried mushroom spaghetti

A fast and easy dish, great for lunch, takes about 10-15 minutes, basically as long as it takes you to boil the water and cook the spaghetti, the rest of the prep can be done while the pasta is cooking.

Ingredients

  • 100g fancy mushrooms. I buy these from Sainsburys (makes two servings)
  • 4 or 5 regular button mushrooms
  • 1 clove garlic
  • Salt
(master) tomato:railties will$ ruby -Itest:lib:/home/travis/build/rails/rails/railties/../activesupport/lib:/home/travis/build/rails/rails/railties/../actionpack/lib:/home/travis/build/rails/rails/railties/../activemodel/lib test/application/initializers/i18n_test.rb
Run options: --seed 25630
# Running:
.F.......FF......
Finished in 68.520628s, 0.2481 runs/s, 0.3794 assertions/s.
1) Failure:
Ruby compiled with:
'optflags=-O0' 'debugflags=-g3 -ggdb' 'CFLAGS=-O0 -g3 -ggdb'
Confirmed with:
ruby -e 'puts RbConfig::CONFIG["CFLAGS"]'
GDB output shows it reading symbold from Rub, but setting a breakpoint GDB can't find the symbol requested and ultimately never breaks:
(master) tomato:activesupport will$ bundle exec rake test
/Users/will/.rbenv/versions/2.2.0/bin/ruby -w -I"lib:test" -I"/Users/will/.rbenv/versions/2.2.0/lib/ruby/2.2.0" "/Users/will/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rake/rake_test_loader.rb" "test/**/*_test.rb"
I, [2015-11-23T17:40:58.881735 #79250] INFO -- : localhost:11211 failed (count: 0) Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 11211
Skipping memcached tests. Start memcached and try again.
Run options: --seed 45561
# Running:
...........................................................................................................................................................SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS....................................................................................................................................................................................
@wjessop
wjessop / Shift_buddies.txt
Last active October 16, 2015 15:24
Words where there is another word when all chars are shifted by n
Ordered by most shift buddies:
BU has 14 shift buddies: EX, HA, OH, PI, UN, YR, AT, EX, HA, OH, PI, UN, YR, AT
PO has 14 shift buddies: UT, VU, BA, ED, FE, JI, ON, UT, VU, BA, ED, FE, JI, ON
OD has 12 shift buddies: SH, TI, YN, ZO, FU, LA, SH, TI, YN, ZO, FU, LA
TI has 12 shift buddies: YN, ZO, FU, LA, OD, SH, YN, ZO, FU, LA, OD, SH
AL has 12 shift buddies: DO, IT, JU, PA, TE, XI, DO, IT, JU, PA, TE, XI
EM has 12 shift buddies: GO, MU, OW, SA, WE, AI, GO, MU, OW, SA, WE, AI
NO has 12 shift buddies: ST, TU, ZA, AB, DE, HI, ST, TU, ZA, AB, DE, HI
ROB has 10 shift buddies: URE, DAN, HER, KHU, LIV, URE, DAN, HER, KHU, LIV
@wjessop
wjessop / decrypt.rb
Last active October 16, 2015 15:35
Decrypt some things!
# 1. Determine possible keywords by examining all dict words of the correct length and checking to see if when un-shifted they match the key
# (note: it turns out there is only *one* word in /usr/share/dict/words) that matches the key when it is shifted
# 2. Decrypt the ciper text with all candidate keys
# 3. Count how many dict words appear in each candidate decrypt and sort by the count, display them in order
# Outputs:
# 278 dict words: PRETENDTHATYOUVEOPENEDTHISBOOKALTHOUGHYOUPROBABLYHAVEOPENEDTHISBOOKJUSTTOFINDAHUGEONIONRIGHTINTHEMIDDLECREASEOFTHEBOOKTHEMANUFACTUREROFTHEBOOKHASINCLUDEDTHEONIONATMYREQUESTSOYOURELIKEWOWTHISBOOKCOMESWITHANONIONEVENIFYOUDONTPARTICULARLYLIKEONIONSIMSUREYOUCANAPPRECIATETHELOGISTICSOFSHIPPINGANYSORTOFPRODUCEDISCREETLYINSIDEOFANALLEGEDPROGRAMMINGMANUAL
CIPHER_TEXT = "EFMZRNQMWOBEBUIXDDMTRDGAXGJUBKNEIVWATHLHJDZUOAOENVIBROCXCSLZUIFUDCSPHSGMDTQTQAUNVSWTVOAKXUPZVNGATAQJQLRVGSIYROSMWSJUBKGATAITHFNVIIZKEOSMWSJUBKUTHWVIYUQXSHPKBNVHCOBSLRRJJSAZFOLHJFMRVKRPDKBNVSOHDYKUZEFPXHPGAOABDBMB
require 'rgl/implicit'
require 'rgl/traversal'
vertices = ["one", "two", "three"]
g = RGL::ImplicitGraph.new do |g|
g.vertex_iterator { |b| vertices.map{|v| b.call(v) } }
g.adjacent_iterator { |x, b| b.call( vertices[(vertices.index(x) - 1).abs] ) }
g.directed = true
end
// Print the formatted error and exit.
func Fatalf(format string, a ...interface{}) {
fmt.Fprintf(os.Stderr, format, a...)
os.Exit(1)
}