Skip to content

Instantly share code, notes, and snippets.

@dnk8n
dnk8n / dictreader.py
Last active April 6, 2022 14:50
Use openpyxl to return a dictreader
from pathlib import Path
from typing import Any, Callable, Dict, Iterator, List, Optional, Union
from openpyxl import load_workbook
def xlsx_dictreader(
filename: Union[str, Path],
sheet_index: int = 0,
header_row_index: int = 1,
@dtaylor84
dtaylor84 / gpg-agent-forward.sh
Last active May 15, 2017 07:10
Cygwin GPG Agent Forwarding Script (for use with Gpg4Win 3, requires openssh and ssh-pageant)
#!/bin/bash -e
remote="$1@$2"
echo -ne '\e]0;wait... '"$remote"'\a'
eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME")
localdir="$(cygpath -u "$APPDATA")/gnupg"
extrasock="$localdir/S.gpg-agent.extra" # file containing "PORT\nNONCE"
rdir='$HOME/.gnupg' # remote prefix
rinsock="$rdir/S.gpg-agent" # listen on this socket on server
@justincjahn
justincjahn / 10-cisco-elasticsearch.conf
Last active March 10, 2024 17:36
Logstash: Processing Cisco Logs
#
# INPUT - Logstash listens on port 8514 for these logs.
#
input {
udp {
port => "8514"
type => "syslog-cisco"
}
@eddmann
eddmann / SecureSessionHandler.php
Created April 9, 2014 12:18
Secure session handler implementation.
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2024 06:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname