This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in order to override the graypy version number, you need to use a filter which takes in the record... then override the version attribute: | |
def filter(self, record): | |
added_fields = dict(record.args) | |
record.version = APP_VERSION # dynamically generated at module level | |
record.company_name = added_fields.get('company_name', None) | |
# add whatever data fields here we want to search by | |
# record.does_not_exist = "DOES NOT EXIST TEST" | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iwlwifi disable 802.11n to allow 100% uptime with wifi:: | |
sudo echo "options iwlwifi 11n_disable=1" > /etc/modprobe.d/iwlwifi-disable11n.conf | |
to fix the trackpad (need to use kernel 4 to allow buttons to act as expected) will still need to change the scrolling functionality: | |
add the following to: /etc/X11/xorg.conf.d/20-trackpad.conf | |
Section "InputClass" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
found this at Leo's blog: http://techblog.leosoto.com/django-secretkey-generation/ | |
$ python -c 'import random; import string; print "".join([random.SystemRandom().choice(string.digits + string.letters + string.punctuation) for i in range(100)])' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Troubleshooting Steps for SELinux (presented by Carl Miller at OLF 2015: http://carltm.com | |
This is only a portion of the presentation, all credit goes to Carl, thanks Carl! | |
$ sudo wc -l < /var/log/audit/audit.log | |
$ sudo setenforce permissive | |
run the command(s) that failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
import math | |
import tempfile | |
import os | |
# write | |
def writePickle(outputFile): | |
''' | |
Takes in a filename to use and saves the pickle to that | |
specific location. Stores pickle in a file on the system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/.ssh/id_dsa.pub | ssh user@hostname "cat - >> ~/.ssh/authorized_keys" | |
alternative: | |
ssh user@hostname "echo `cat ~/.ssh/id_dsa.pub` >> ~/.ssh/authorized_keys" | |
here is another alternative I use on new servers (that don't already have an ~/.ssh directory: | |
cat ~/.ssh/id_dsa.pub | ssh user@hostname "mkdir ~/.ssh/; cat - >> ~/.ssh/authorized_keys" | |
*OR* | |
ssh user@hostname "mkdir ~/.ssh/; echo `cat ~/.ssh/id_dsa.pub` >> ~/.ssh/authorized_keys" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ | |
# Install stuff # | |
################# | |
# Install development tools and some misc. necessary packages | |
yum -y groupinstall "Development tools" | |
yum -y install zlib-devel # gen'l reqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Snippets for args and kwargs usage, both calling and handling *args and **kwargs | |
Created on July 15, 2014 | |
@author Chris Coe | |
''' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on Mar 20, 2014, uses PyCrypto/Python 3.3 | |
@author: Chris Coe | |
''' | |
import binascii | |
from Crypto.Cipher import AES | |
class AESCipher: | |
''' |