Skip to content

Instantly share code, notes, and snippets.

@mdeous
mdeous / tpm.md
Created September 3, 2018 23:19
Upgrade Dell laptop TPM from 1.2 to 2.0

Dell TPM Upgrade

  • Download the "Dell TPM 2.0 Firmware Update Utility" from the Dell support website
  • Create a FreeDOS USB stick:
    • Format USB stick to FAT32
    • Mount USB stick (required by unetbootin)
    • Download unetbootin
    • Run unetbootin (as root), select FreeDOS, select the right volume, and install
  • Copy the downloaded firmware update file to the USB stick
  • Boot the laptop from the USB stick
@mdeous
mdeous / pgmigrate.sh
Created February 2, 2014 13:31
Automated schema migration for PostgreSQL
#!/bin/bash
#
# Script: pgmigrate.sh
# Author: Mathieu D. (MatToufoutu)
# Description: Automated schema migration for PostgreSQL
# Usage: ./pgmigrate.sh DATABASE MIGRATIONS_FOLDER
#
# Details:
# Just store the .sql migrations scripts in a folder, file
# names must be incremental numbers (1.sql, 2.sql, ...).
@mdeous
mdeous / gist:1223737
Created September 17, 2011 07:53
My .vimrc
""""""""""""""""""""""""""""""
" VIM CONFIGURATION FILE "
""""""""""""""""""""""""""""""
" pathogen plugin
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
" basic settings
#!/bin/bash
# -*- coding: utf-8 -*-
###########################################################################
# #
# envbot - an IRC bot in bash #
# Copyright (C) 2007-2008 Arvid Norlander #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
@mdeous
mdeous / multipass.zsh
Last active July 28, 2021 17:12
multipass.zsh - A wrapper for people using multiple pass (password-store) stores
#
# multipass.zsh
#
# A wrapper to pass (password-store) for managing multiple
# store paths with a single command while still benefiting
# from Zsh's completion features.
#
# Usage: add the following lines to your .zshrc:
# source /path/to/multipass.zsh
# PASSWORD_STORES[pass1]=/path/to/pass1-store
@mdeous
mdeous / gist:1555294
Created January 3, 2012 15:14
colored logging formatter
class ColorFormatter(logging.Formatter):
_colors_map = {
'DEBUG': '\033[22;32m',
'INFO': '\033[01;34m',
'WARNING': '\033[22;35m',
'ERROR': '\033[22;31m',
'CRITICAL': '\033[01;31m'
}
def format(self, record):

Keybase proof

I hereby claim:

  • I am mdeous on github.
  • I am mdeous (https://keybase.io/mdeous) on keybase.
  • I have a public key ASCspzYRS44ZU3KbvFvA9sgD9thyNs0YGzmfDEH5ZmwFLgo

To claim this, I am signing this object:

hackmd=# \d
List of relations
Schema | Name | Type | Owner
--------+----------------+----------+--------
public | Authors | table | hackmd
public | Authors_id_seq | sequence | hackmd
public | Notes | table | hackmd
public | Revisions | table | hackmd
public | SequelizeMeta | table | hackmd
public | Sessions | table | hackmd
@mdeous
mdeous / color.py
Created January 5, 2014 15:45
Python Shell Output Color
COLOR_CODES = {
'green': '\033[32m',
'bgreen': '\033[1;32m',
'bgrey': '\033[1;30m',
'reset': '\033[0m'
}
def color(text, color_name):
return COLOR_CODES[color_name]+text+COLOR_CODES['reset']
@mdeous
mdeous / repermute.py
Created February 13, 2012 16:04
generate all possible permutations of a regex
# -*- coding: utf-8 -*-
#
# Used like this:
#
# from repermute import ipermute
#
# for s in ipermute('[A-Z]\d'):
# print s
#
# Almost all regular expression constructs are supported except for '*'