Title: Notes on a Fortran Conversion, part 2 Date: 06/10/2020 Category: Programming
I found this a fascinating example of the following programmer’s mantra:
“It can’t possibly not work!” “I found it why it doesn’t work” “How did that ever work?”
subroutine set_fast(flag)
real(kind=8) :: xmeas, xmv
common /pv/ xmeas(42), xmv(12)
real(kind=8), intent(in) :: time
character(len=20), intent(in) :: flag
logical :: init = .false.
integer :: i
character(len=10) :: tmp, mode = ""
select case(flag)
case ("--xmv") ! program
if (.not. init) then
call get_command_argument(2, tmp)
read(tmp, *) i
call get_command_argument(3, tmp)
read(tmp, *) mode
end if
select case (mode)
case ("MAX")
xmv(i) = 100.
! omitted for brevity
end select
end select
init = .true.
end subroutine
I wanted to add another case, as you do:
Title: Immersive Labs (Lightening write ups) Date: 06/10/2020 Category: labs
Okay, so last time I covered the overall impressions of immersive labs.
Once again, no spoilers:
Netcat: Do the things and copy-paste tokens. For extra interest, I found the script that generates tokens.
Server Identification: I’m not quite sure what you’re supposed to get from this one? Again, not without spoilers.
DLL Injection: as referenced last time, I had trouble with this as I didn’t realise restarting a machine didn’t kill the session. The principle is easy enough, and you have metasploit, but the correct path takes some digging. I also kept forgetting you can just spin up a http server from your attacker machine, for when you want to transfer files over.
(Sort of) write-ups from immersive labs
It’s been nearly a year since I first started playing around with Immersive labs, a sort of leetcode-ish platform for would-be penetration testers, which also happens to be free to students (given the cost otherwise, thank god). I’ve pretty much done the free ones. Yay for me.
What distinguishes immersive labs from other setups (hackthebox, pwn college, some MOOCs I played around with), and makes it rather similar to, say, leetcode, is that the environment are tools are set up for you, and everything is through the browser. You’ll know instantly if that’s for you or not.
Lean Six-Sigma for Hackers
Part 1
Picture the scene: you are a 25-year old Very Cool Hacker Person (TM) or 1st class BSC/MSC/PhD in Compsci holder, and you’ve just been accepted into a cybersecurity company with an exciting name, a markov chain will probably give you “CrowdCrew” or “CyberTrace” or some such. You’re happy - you’ve actually been selected to do one of the few modern jobs that is both technically interesting and, as far as I’m concerned, ethical! (Yes, some companies might try selling TLS 1.1 as a critical vulnerability, with email over port 26 as the solution. If that’s the worst your industry does, you’re in a good industry). You’re punk rockstars, changing the world, you don’t need process, that’s for suits and Java programmers! You’ll work evenings and weekends and tell yourself you enjoy it, and sometimes you might, because again, this is actually technically interesting work. You pick up some side tasks for the business, and they’re cool too.
I can’t help but think the real stars of the show are the let
and let mut
keywords: with, perhaps, a fairly valid complaint that an “immutable variable” is a fucking stupid and self-contradictory term. Variables vary, if they don’t they’re constants, and I’ve seen people turned off Rust because of this. But that’s really a problem for computer science as a whole. Like calling a variable-length list of same-typed items a Vector.
Trying to run the jedi language server with neovim 0.5, returns:
--E5108: Error executing lua /usr/local/share/nvim/runtime/lua/vim/lsp.lua:97: filename: expected string, got nil
...
/usr/local/share/nvim/runtime/lua/vim/lsp.lua:644: in function 'start_client'
...
pack/paqs/start/nvim-lspconfig/lua/lspconfig/configs.lua:220: in function 'try_add'
the same issue occurs with python-language-server and pylsp (jedi-vim fails silently), but not with rust-analyzer, which is the only other LSP I’ve tried so far.
Additional details: Error only occurs when actually loading a python file (start_client). I’m using the Paq package manager (as in the error message), but the code that triggers the error is from nvim-lspconfig. The apparently empty string is:
Title: Physics Toolbox 1: Logarithms and Fermi estimation Date: 14/09/2020 Category: Physics
===
One of the interesting perceptions “hard sciences” tend to feature from outside is that they’re extraordinarily precise.
That’s certainly true, sometimes - but the thing is, that’s only when it has to be. Physics has a dirty secret: often, you don’t have to be, and sometimes it’s actively detrimental.
The best example of this is what are known as “Fermi problems” or Fermi estimations. You may have heard them in interviews. Essentially, you’re given a question you’d never have thought of before - how many piano tuners in great britain? say - and you’ve got to estimate it somehow. Really, even getting within a factor of two is unlikely, but that means you don’t need to sweat the details.
Title: Physics Toolbox 2: Taking the inverse Date: 14/09/2020 Category: Physics
One of the underappreciated challenges of science is finding useful metrics - things that we measure by. It is, after all, why we have the Imperial system - yes, pints and coppers and barrels and fluid ounces don’t make any sense together. But they did all represent a way to solve a real problem, at one point.
However, we can go further than that. With simple things, like a lump of stuff, the choices tend to be (relatively) simple - usually a matter of choosing whether to measure by weight or by volume. Usually, both will be relevant at different times. With derived units, like “speed” or “fuel economy”, however, the choice isn’t quite so obvious.
Title: Physics Toolbox 3: Dimenstional Analysis Date: 14/09/2020 Category: Physics
===
“You can’t add chalk and cheese! You’ve got to… multiply chalk and cheese?!” - quote from my chemistry supervisor
Say you want to know how much
This ties into my earlier post about Fermi estimation: you can do a lot with just multiplication.