Skip to content

Instantly share code, notes, and snippets.

View fredlahde's full-sized avatar
😁
Hey there!

Fred Lahde fredlahde

😁
Hey there!
View GitHub Profile
@fredlahde
fredlahde / main.rs
Created February 1, 2025 22:59
Basic rust ssh2 ssh -L port forward
#[cfg(test)]
mod test {
#[test]
fn foo() {
// start a local tcp echo server:
// ncat -l 127.0.0.1 2000 -k -c 'xargs -n1 echo'
use ssh2::Session;
use std::io::prelude::*;
use std::net::TcpStream;
@fredlahde
fredlahde / git-review.sh
Last active February 5, 2021 15:27
Git review
git-review() {
local search="$1"
local commits=$(git --no-pager log --all --oneline --grep=$search | cut -d ' ' -f1 | paste -sd ' ')
if [ -z "$commits" ]
then
echo "No commits found for $search"
else
git show --pretty=short --show-signature $(echo $commits) | vim -
fi
}