Skip to content

Instantly share code, notes, and snippets.

Avatar

nevesnunes

View GitHub Profile
@nevesnunes
nevesnunes / openssl_client.c
Last active February 7, 2022 13:51 — forked from MartinMReed/openssl_client.c
OpenSSL Client, Reference Example
View openssl_client.c
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#define HOST "encrypted.google.com"
/**
* Example SSL client that connects to the HOST defined above,
* and prints out the raw response to stdout.
*/
@nevesnunes
nevesnunes / set-tmux-title.sh
Created July 6, 2020 12:55 — forked from florianbeer/set-tmux-title
Set tmux pane title to short hostname on ssh connections
View set-tmux-title.sh
ssh() {
# grep -w: match command names such as "tmux-2.1" or "tmux: server"
if ps -p $$ -o ppid= \
| xargs -i ps -p {} -o comm= \
| grep -qw tmux; then
# Note: Options without parameter were hardcoded,
# in order to distinguish an option's parameter from the destination.
#
# s/[[:space:]]*\(\( | spaces before options
# \(-[46AaCfGgKkMNnqsTtVvXxYy]\)\| | option without parameter
@nevesnunes
nevesnunes / pdftitle.py
Last active January 9, 2023 13:59 — forked from hanjianwei/pdftitle.py
Extract title from pdf file.
View pdftitle.py
#!/usr/bin/env python2.7
"""
Extract title from PDF file.
Dependencies:
pip install --user unidecode pyPDF PDFMiner
Usage:
find . -name "*.pdf" | xargs -I{} pdftitle -d tmp --rename {}