Scapy is a Python module and interactive
program for low-level network programming that attempts to make it
easier without abstracting away the technical details. This project
is fairly prominent in cybersecurity space and used for things like
exploit development, data exfiltration, network recon, intrusion
detection and analysing captured traffic. Scapy integrates with data
visualisation and report generation tooling for presenting the
results of your research to bug bounty program or during the meeting
with customer or management. The foundational idea for Scapy is
proposing a Python-based domain specific language for easy and quick
wire format management.
Whether I’m teaching new Pythonistas or long-time Python
programmers, I frequently find that Python programmers
underutilize multiple assignment.
Multiple assignment (also known as tuple unpacking or iterable
unpacking) allows you to assign multiple variables at the same time
in one line of code. This feature often seems simple after you’ve
learned about it, but it can be tricky to recall multiple
assignment when you need it most.
Emacs shortcuts (known as ‘key bindings’) can seem ridiculous to
beginners. Some Emacs users even argue you should change them as
soon as you start using Emacs.
They are wrong. In this post, I’ll describe the logic behind the
Emacs key bindings. Not only will you be closer to passing the guru
test, but you might even find you like some of the defaults!
In preparing some data for another upcoming blog post, I needed to
convert a list of fully qualified GitHub repository names into a
JSON array of single-property objects (to reflect the style of JSON
output from GitHub's gh CLI). I achieved this with a short jq
filter. Here's how, recorded here, with my working thoughts, mostly
for my outboard memory.
This blog post documents my understanding of how the conventions for
Unix command line syntax have evolved over time. It’s not properly
sourced, and may well be quite wrong. I’ve not been using Unix until
1989, so I wasn’t there for the early years. Maybe someone has
written a proper essay on this, with citations. I’m too lazy to dig
them up.
These are some technical tips for publishing a blog. These have
nothing to do with good content, just how to share that content. The
recommendations are roughly in order of importance and have
rationale for why they are that important.
A truffle hunter who lives alone in the Oregon wilderness must
return to his past in Portland in search of his beloved foraging pig
after she is kidnapped.
In the evening we watched
Pig. The movie was OK and I
give it a 6 out of 10.
Rust is infamous for having a steep learning curve. The borrow
checker is the first boss you must defeat, but with a good mental
model of how memory works, how objects move, and the rules that the
borrow checker enforces, it becomes second nature rather
quickly. These rules may sound complicated, but really, they are
about understanding the fundamentals of how a computer works.
Let's see how a modern compiler and type system helps prevent many
bugs and thus helps increase the security for everyone and reduces
the costs of software production and maintenance.
There are basically two types of client applications on the internet:
Clients that use the request-response model. One request will
generally result in one response. Some examples would be web
browsers and many API clients.
Clients that receive a continuous stream of data from a server and
may or may not send data back at any time. Examples of this type
would include chatbots, automated trading applications and
multiplayer video games.
In this article, I will describe a fairly general way to use Haskell
for constructing a specific kind of clients of the second type:
clients that listen to a single network socket and send replies to
that same socket, possibly while maintaining state. This article
assumes basic proficiency with Haskell and networking.
On a post-apocalyptic Earth, a robot, built to protect the life of
his creator's beloved dog learns about life, love, friendship and
what it means to be human.
In the evening we watched
Finch. I liked the movie and
give it a 7 out of 10.
After work I went to a nearby Burger King to join Esme, Adam, Alice,
and Esme's coworker. The latter had brought her Maine Coon with her to
show him to us.
The cat was fine with being held as we took turns holding and petting
it. After dinner at Burger King we walked to Starbucks to have a
coffee.
I spend time investigating a non-existing bug today because I
misunderstood a USB term. So I made myself a cheat sheet. Maybe it
will save time to someone.
This PEP proposes a feature to transparently defer the execution of
imported modules until the moment when an imported object is
used. Since Python programs commonly import many more modules than a
single invocation of the program is likely to use in practice, lazy
imports can greatly reduce the overall number of modules loaded,
improving startup time and memory usage. Lazy imports also mostly
eliminate the risk of import cycles.
This blog will focus on simple bash commands for parsing data and
Linux system maintenance that i acquired from work and LPIC exam. I
apologize that there are no detailed citation for all the commands,
but they are probably from dear Google and Stackoverflow.
Source: Bash-Oneliner, an
article by Bonnie I-Man Ng.
I've been using kitty for quite a long time now. Before it was
iTerm and it was slow as my grand-mom's computer. Opening a new tab
literally takes forever, I am always starting to type before it is
loaded.
My life was desperate and wasteful before I found kitty.
In this article, I’ll look at the success stories of Haskell in
areas like finance, blockchain, education, the automotive industry,
and developer tooling. I’ll explain why large companies decide to
use Haskell and what seems to me to be the future of the language.
This is a series of brief articles aimed at teaching Emacs to
computer professionals who are unfamiliar with it. I do not dwell on
the basics of the user interface, which can be learned from the
built-in tutorial. Instead, each article in this series will distill
one very specific command line (CLI) tool or technique that
Linux/UNIX users often use, and describe an equivalent function or
technique in Emacs. The tool or technique discussed will be specific
enough that the whole article can explain the concept in around 1000
words, and will provide examples, or specific actions to be
taken. The goal is to have a list of recipes that Linux users can
search and find quickly, and read through in just a few minutes, to
learn the most useful ways of using Emacs to solve day-to-day
problems.
Following my article
yesterday
demonstrating with synthetic tests that Activity Monitor’s CPU % and
Energy measurements are misleading, today I show how you can get
accurate estimates of power and energy use, and how the E cores in
M1 chips can be far more efficient than the P cores. Today’s
compression task required less than a third of the energy when run
on the E cores, than on the P cores.
It's no secret that Kubernetes Secrets are just base64-encoded
strings stored in etcd alongside the rest of the cluster's
state. Ever since the introduction of Secrets in
2015, armchair
security experts have been scoffing at this decision and seeking
alternatives. I think those people are missing the point.
This post briefly tours resources that helped introduce me to type
theory, because I’m frequently asked by others for resources on this
subject (even though I never had a formal education in type
theory). Specifically, these resources will focus more on how to
implement a type checker or type inference algorithm.