Skip to content

Instantly share code, notes, and snippets.

@bensenq
bensenq / readme.md
Created April 26, 2025 12:54 — forked from jasonkarns/readme.md
Git send-email using Gmail
  1. Configure git.
# ~/.config/git/config
[sendemail]
  confirm = auto
  smtpServer = smtp.gmail.com
  smtpServerPort = 587
  smtpEncryption = tls
  smtpUser = <gmail email address>
@bensenq
bensenq / read-utmp-file.c
Last active May 17, 2016 13:57 — forked from eerpini/read-utmp-file.c
sample code to read the unix session log utmp
#include <utmpx.h>
#include <paths.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv){
struct utmpx data;
FILE *log_file = fopen(_PATH_UTMP, "r");
memset(&data, 0, sizeof(struct utmpx));