I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| #!/bin/sh | |
| # Usage: | |
| # Once you started git rebase --interactive master, and you are presented | |
| # with the list of commit SHAs and commit messages, from Vim: | |
| # - visually select all SHAs via "V}k" | |
| # - launch git-rr: !git-rr | |
| # - ... | |
| # - profit! you now have the same info as before, just with the list of | |
| # filenames which changed with each commit, and can now move around |
| PayPal blocks copy/paste actions in their "change password" form, | |
| citing some irrelevant security issues as the reason. That's a | |
| load of crap, and they know it -- disabling copy/paste makes it a | |
| lot harder to use a decent password generator and a lot easier to | |
| screw up your pwd when retyping, especially if it's a long one | |
| (as it should be!). | |
| So, here's the quick'n'dirty way to use an externally generated | |
| password in your PayPal account: |
| sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common | |
| sudo apt-get build-dep vim-gnome | |
| sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev | |
| sudo rm -rf /usr/local/share/vim | |
| sudo rm /usr/bin/vim | |
The Y Combinator is a classic lambda calculus construct that many people find baffling. Here's my attempt to explain it as clearly as possible (no promises!). Familiarity with Haskell syntax is assumed.
The problem we're trying to solve is how to write an anonymous function (a "lambda") that is recursive. Normally, if you want to write a recursive function, it looks like this:
fac n = if n == 0 then 1
else n * fac (n-1)| #ifndef _WIN32 | |
| typedef struct _GUID { | |
| uint32_t Data1; | |
| uint16_t Data2; | |
| uint16_t Data3; | |
| uint8_t Data4[8]; | |
| } GUID; | |
| #endif | |
| GUID StringToGuid(const std::string& str) |
This tutorial aims to install a package on a Ubuntu machine that is not able to connect into the internet, using apt-offline tool. This should be applicable to other Debian distros but it was not validated.
I got my hands on a new YubiKey 5 over the weekend. For those unaware, this is a pretty well-known security key which provides options for hardware authentication using a variety of different protocols (e.g. FIDO2, OpenPGP etc.). I was keen to try this out for authenticating with GitHub and also handling SSH credentials when accessing servers I'm running on my local network.
The problem however, is that I'm a pretty heavy WSL (Ubuntu) user and needed something which plays well in that environment. I didn't think about it too much when I initially ordered the YubiKey, but worked out over the weekend that getting a USB device (particularly a security key) to play nicely with WSL, isn't exactly straight forward. So, I did a write-up of the steps I ended up taking for others (or myself) to refer back to.