Skip to content

Instantly share code, notes, and snippets.

@killerbees19
killerbees19 / .bash_aliases
Last active May 3, 2024 04:08
Supermicro Fan Control
alias fan-auto='systemctl start supermicro-fan-auto.timer'
alias fan-full='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan full'
alias fan-pue2='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan pue2'
alias fan-optimal='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan optimal'
alias fan-heavyio='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan heavyio'
alias fan-standard='systemctl stop supermicro-fan-auto.timer && sleep 5 && sm fan standard'
#!/bin/bash
# This is a modified version of the Supermicro PID Logic Fan Script from https://forums.freenas.org/index.php?resources/fan-scripts-for-supermicro-boards-using-pid-logic.24/
# and is designed to run on Supermicro X9 boards using an Nuvoton WPCM450 BMC.
#
# IPMI raw commands are gathered from https://www.supermicro.com/support/faqs/faq.cfm?faq=15634
# and https://www.reddit.com/r/homelab/comments/8fhomj/getting_those_supermicro_x9_motherboard_fans/
#
# Attention: When i modified this script, i had already configured full fan mode via ipmi web interface.
# Therefore this script may not enable full fan mode. Please enable it manually, otherwise the ipmi
@gelisam
gelisam / UnderstandingPipes.md
Last active May 16, 2019 13:48
Understanding the Pipes library

In response to this reddit post about failing to understand the Pipes library after a couple of hours. I wanted to show how an experienced haskeller does it, but I'm afraid it also took me quite a few hours, which is why the following list of steps goes on and on.

After all those hours, my opinion is that Pipes is not at all an easy library. I don't know if Conduit is any easier, but otherwise I side with your friend in advising to use something else (perhaps ordinary lazy IO?) instead of Pipes.

Anyway, here is the full brain dump of my steps as I tried to get your three snippets to fit together.

  • Since you say that you have a hard time combining the snippets, I assume that they must have complicated types. So my first goal is to figure out the type of your first snippet.
  • hoogle for parseUrl, withManager, etc. No results.
  • Google for haskell runEffect, find that it's a method from Pipes.Core,
@bitemyapp
bitemyapp / gist:ac316a6eb666695ff7d2
Last active November 4, 2020 04:11
How I talk about Haskell when I want people to care about learning Haskell

Fire up ghci. Make the text real big. Always show the types for everything as you go!

Takes ~1 hour generally.

Note: if you object to "uncertainty" (evocative of data/value flow possibilities), consider wording like "simultaneously possible values". It's a reference to how the compiler won't know whether Maybe a is a Just a or a Nothing statically. Don't blather at me about dependent types; I know.

Alternate verbiage for uncertainty: product - simultaneous altogetherness, sum - simultaneous singlehood. Also consider what the category theoretic diagrams look like. Can be instructive.

Suggestions taken under advisement.

@senko
senko / maybe.py
Last active May 2, 2024 18:35
A Pythonic implementation of the Maybe monad
# maybe.py - a Pythonic implementation of the Maybe monad
# Copyright (C) 2014. Senko Rasic <senko.rasic@goodcode.io>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@pascalpoitras
pascalpoitras / config.md
Last active May 11, 2024 04:13
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@yuga
yuga / gist:6612105
Last active December 23, 2015 09:09
Add support for cabal sandbox to syntastic. Write this in your .vimrc.
function! s:get_cabal_sandbox()
if filereadable('cabal.sandbox.config')
let l:output = system('cat cabal.sandbox.config | grep local-repo')
let l:dir = matchstr(substitute(l:output, '\n', ' ', 'g'), 'local-repo: \zs\S\+\ze\/packages')
return '-s ' . l:dir
else
return ''
endif
endfunction
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@jrydberg
jrydberg / supervisor.py
Created November 14, 2012 17:28
simple gevent supervisor
class UnhandledExceptionError(Exception):
"""The exception could not be handled by the supervisor."""
class SupervisorKilledError(Exception):
"""The supervisor was killed."""
class SupervisorAbortedError(Exception):
"""The supervisor gave up after maximum number of failures."""
@mattratleph
mattratleph / vimdiff.md
Last active May 9, 2024 03:11 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)