Skip to content

Instantly share code, notes, and snippets.

@DavidWittman
DavidWittman / when-will-my-lenovo-arrive.sh
Last active March 21, 2017 22:13
Scrape the Lenovo order details page and print the estimated arrival date.
#!/usr/bin/env bash
# When will my Lenovo order arrive?
#
# I grew impatient while waiting for my Thinkpad to ship, and the arrival date
# kept changing, so I wrote this script to scrape their order details page.
#
# Might not work on all platforms, and it's parsing HTML with sed, so there be
# plenty of dragons within this script.
@chrisxaustin
chrisxaustin / tshark-syslog
Last active October 9, 2024 23:05
tshark - extract src and syslog message
# To read foo.pcap
tshark -ln -r foo.pcap -q -d udp.port==514,syslog -T fields -E separator=" " -e ip.src -e syslog.msg
# To listen on eth0
tshark -ln -i eth0 -q -d udp.port==514,syslog -T fields -E separator=" " -e ip.src -e syslog.msg
@oxplot
oxplot / ether-waker.sh
Last active March 2, 2019 23:55
Wake up PCs behind the lan when SSH connection is attempted.
# Moved to https://github.com/oxplot/gists/blob/master/ether-waker.sh
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active July 3, 2025 21:23
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@tylerneylon
tylerneylon / json.lua
Last active May 17, 2025 02:04
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.
@mschoch
mschoch / test-bleve-search.sh
Last active June 18, 2023 03:53
bleve - create index, index JSON, query index
#!/bin/sh
# create a custom mapping
cat > /tmp/mapping.json << MAPPING
{
"types": {
"_default": {
"properties": {
"location": {
"properties": {
#!/bin/sh
remove_dangling() {
echo "Removing dangling images ..."
docker rmi $(docker images -f dangling=true -q)
}
remove_stopped_containers() {
echo "Removing stopped containers ..."
docker rm $(docker ps -qa)
@trehn
trehn / damazon.py
Last active November 22, 2016 08:47 — forked from zakx/damazon.py
#!/usr/bin/python
# setup: pip install requests beautifulsoup4
from decimal import Decimal
import requests
from bs4 import BeautifulSoup
import sys
import getpass
@rfdrake
rfdrake / raid1.cfg
Last active April 21, 2024 23:08
Debian Wheezy raid1 preseed configuration
# This puts all files in one partition. You'll need to change proxy settings
# (USERNAME, PASSWORD, PROXYSERVER) and crypted passwords, as well as the
# get_domain string to your dns domain.
# This is not quite fully automatic. It will prompt you for hostname. If you
# want to automatically fill in the hostname you'll need to provide it in the
# kernel APPEND line by saying netcfg/get_hostname=hostname
# If you've never setup preseeding, the first step is going to be getting PXE
# netinstall working. You don't need a full CD, you just need netboot/debian-installer/amd64/linux
@wnoguchi
wnoguchi / README.md
Last active April 24, 2018 06:48
Preseed Recipe: Soft RAID1, LVM

Ubuntu Preseed Recipe: RAID1 + LVM

System Requirements

  • Ubuntu Server 16.04.4 LTS AMD64
  • Disk Size: 80GiB
  • Number of Disks: 2
  • LVM: YES
  • RAID: RAID1
  • Partition Table Format: MBR