Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View meschbach's full-sized avatar

Mark Eschbach meschbach

View GitHub Profile
@meschbach
meschbach / clean-kernels.sh
Created June 3, 2022 16:35
Ubuntu Kernel Cleanup
#/bin/bash
# Removes kernels + headers remaining on a ubuntu machine.
current_version=$(uname -a |awk '{print substr($3, 1, length($3)-length("-generic"));}')
echo "Current Kernel: $current_version"
installed=$(dpkg-query -l | grep '^ii' | awk '{print $2}')
headers=$(grep linux-headers- <<<"$installed" |head -n -3 |grep -v "$current_version")
modules=$(grep linux-modules <<<"$installed" |grep -v "extra" |head -n -2 |grep -v "$current_version")
@meschbach
meschbach / enum-matching.swift
Last active August 16, 2016 16:38
Swift Enumeration Matching
enum SomeEnum {
case .ExampleValue
case .CountedCase( someCount : Int )
}
func doSomething( state : SomeEnum ){
switch state {
case ExampleValue:
print("Example")
case CountedCase( 0 ):
@meschbach
meschbach / README
Created March 1, 2015 17:40
Simpel Ruby STOMP Client
This Gist is really part of an article Mark Eschbach wrote at http://meschbach.com/kb/simple-ruby-stomp-client.html.