Skip to content

Instantly share code, notes, and snippets.

@adrianhardy
adrianhardy / lcd_i2c.py
Created July 31, 2021 22:49
Use ARGV to Send messages to a 2004 LCD
#!/usr/bin/python
#--------------------------------------
# ___ ___ _ ____
# / _ \/ _ \(_) __/__ __ __
# / , _/ ___/ /\ \/ _ \/ // /
# /_/|_/_/ /_/___/ .__/\_, /
# /_/ /___/
#
# lcd_i2c.py
# LCD test script using I2C backpack.
@adrianhardy
adrianhardy / readme.md
Last active January 14, 2017 13:06
Trim down TimeMachine backups

Add multiple vendor paths to TimeMachine's ignore list

1. Check for 'SkipPaths' value, these are the paths that TM ignores

defaults read /Library/Preferences/com.apple.TimeMachine.plist

2. (Optional) clear out 'SkipPaths'

defaults delete /Library/Preferences/com.apple.TimeMachine.plist SkipPaths

3. Start adding directories in bulk

find ~/projects -name "node_modules" -maxdepth 5 | sudo xargs tmutil addexclusion -p

@adrianhardy
adrianhardy / brunch-config.js
Last active October 27, 2016 09:11
Laravel / Brunch Setup
module.exports = {
conventions: {
assets: /(^resources\/assets\/static\/)/,
vendor: /(^bower_components|node_modules)\//
},
paths: {
public: 'public/build',
watched: ['resources/assets/js']
},
files: {
# layout.html.twig
<!doctype html>
<html>
<head></head>
<body>
{% block body %}{% endblock %}
{% block footer_javascript %}{% endblock %}
</body>
</html>
@adrianhardy
adrianhardy / selinux-tips.md
Last active July 8, 2016 21:16
Things I just learned about SELinux

Install SELinux setroubleshootd

Run yum install setroubleshoot-server-3.0.47-11.el6.x86_64 which will bring in a bunch of packages. /usr/sbin/setroubleshootd starts a daemon so when you tail -f /var/log/messages you'll see translated selinux errors, such as:

Jul  8 21:03:45 localhost setroubleshoot: SELinux is preventing 
/usr/sbin/nginx from getattr access on the file /srv/wordpress/index.php. For 
complete SELinux messages. run sealert -l 1aa6ca64-b20c-4081-bf70-039aedf7cce6