Skip to content

Instantly share code, notes, and snippets.

@semeion
semeion / plot.awk
Created July 28, 2020 23:48 — forked from katef/plot.awk
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@semeion
semeion / 50-battery.rules
Created May 17, 2019 18:47
udev script for handling power management
SUBSYSTEM=="power_supply", ACTION=="change", RUN+="/etc/scripts/battery.sh"
@semeion
semeion / proc_net_tcp_decode
Created May 14, 2019 20:33 — forked from jkstill/proc_net_tcp_decode
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
@semeion
semeion / netpps.sh
Created May 5, 2019 02:30 — forked from joemiller/netpps.sh
shell: quick linux scripts for showing network bandwidth or packets-per-second
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
@semeion
semeion / curl-smtp-email.sh
Created November 1, 2015 02:18 — forked from james2doyle/curl-smtp-email.sh
Send SMTP email using cURL
curl --connect-timeout 15 -v --insecure "smtp://smtp.example.com:25" -u "username:password"
\ --mail-from "sender@example.com" --mail-rcpt "destination@example.com"
\ -T email-contents.txt --ssl
@semeion
semeion / google.sh
Last active August 29, 2015 14:20 — forked from deanet/google.sh
#!/bin/bash
## uploading to google
## rev: 22 Aug 2012 16:07
det=`date +%F`
browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
username="user@domain-apps.com"
password="password"
accountype="HOSTED" #gooApps = HOSTED , gmail=GOOGLE