Skip to content

Instantly share code, notes, and snippets.

View digitalfiz's full-sized avatar
🤠
I may be slow to respond.

Marc Seiler digitalfiz

🤠
I may be slow to respond.
View GitHub Profile
@digitalfiz
digitalfiz / gist:67f4d5a089074b92e0e245354f697c18
Created April 21, 2022 03:01 — forked from carlosmcevilly/gist:2221249
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
@digitalfiz
digitalfiz / configstore.py
Last active August 15, 2020 04:12
marcostat
import os
import time
import json
class ConfigStore():
config = {}
config_file = ''
defaults = {
'temp_desired': 75.0,
@digitalfiz
digitalfiz / generate.sh
Created September 21, 2018 21:27
Generate self signed cert
openssl genrsa -aes256 -out private.key 2048
openssl rsa -in private.key -out private.key
openssl req -new -days 1095 -key private.key -out cert.csr
openssl x509 -in cert.csr -out cert.cert -req -signkey private.key -days 1095
~/Projects/personal/railstest(master ✗) rails c
/home/theuser/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.0/lib/active_record/connection_adapters/connection_specification.rb:210:in `spec': undefined method `config' for #<Hash:0x00556a4a57fd28> (NoMethodError)
from /home/theuser/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:950:in `establish_connection'
from /home/theuser/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.0/lib/active_record/connection_handling.rb:60:in `establish_connection'
from /home/theuser/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.0/lib/active_record/railtie.rb:136:in `block (2 levels) in <class:Railtie>'
from /home/theuser/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
from /home/theuser/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
from /home/theuser/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/
@digitalfiz
digitalfiz / for_loop.sh
Created July 26, 2016 17:58
Getting memory usage of a docker container in linux
for line in `docker ps | awk ‘{print $1}’ | grep -v CONTAINER`; do docker ps | grep $line | awk ‘{printf $NF” “}’ && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB ; done
@digitalfiz
digitalfiz / vscode.sh
Created July 20, 2016 17:28
/usr/local/bin/vscode
#!/bin/bash
#
# Put this in a file called /usr/local/bin/vscode and then chmod +x it.
set -e
/Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron "$@" &
@digitalfiz
digitalfiz / GameServers.js
Created June 20, 2016 21:02
Aced out GameServers.com Config editor
// ==UserScript==
// @name Aced out GameServers.com Config editor
// @namespace http://tampermonkey.net/
// @version 0.1
// @description This script adds the ace editor to the config editor on gameservers.com
// @author digitalfiz <https://twitter.com/digitalfiz>
// @match https://my.gameservers.com/home/subscription_info.php?view=server_configuration&*
// @grant none
// ==/UserScript==
@digitalfiz
digitalfiz / list_container_memory.sh
Last active February 26, 2016 16:18
mountable stats
for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do docker ps | grep $line | awk '{printf $NF" "}' && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB ; done
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@digitalfiz
digitalfiz / iterm.theme.json
Created September 2, 2015 19:27
iterm2 material theme
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Red Component" : 0.5098039215686274,
"Color Space" : "Calibrated",
"Blue Component" : 1,
"Alpha Component" : 1,