Skip to content

Instantly share code, notes, and snippets.

View tomwwright's full-sized avatar
🎯
Focusing

Tom Wright tomwwright

🎯
Focusing
View GitHub Profile
@tomwwright
tomwwright / gist:f88e2ddb344cf99f299935e1312da880
Last active November 22, 2022 14:06
Dell XPS 15 9560: Ubuntu 17.10 + Nvidia 384.90 + Nvidia Prime (No Bumblebee) https://medium.com/@tomwwright/better-battery-life-on-ubuntu-17-10-4588b7f72def
# perform a fresh install of Ubuntu 17.10
# upgrade the kernel to v4.13.10
mkdir ~/kernel-v4.13.10
cd ~/kernel-v4.13.10
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
sudo dpkg -i *.deb
@tomwwright
tomwwright / gist:96a273ce60aa5648f063b139d595c9e9
Last active February 1, 2018 22:55
Dell XPS 15 9560: Magic Mouse configuration
# configure scroll speed for Magic Mouse
echo 'options hid_magicmouse scroll-speed=55 scroll-acceleration=0 emulate_3button=0' | sudo tee /etc/modprobe.d/hid_magicmouse.conf
@tomwwright
tomwwright / install.sh
Last active November 8, 2017 06:04
Ubuntu 17.10: Setup for software development
# install Java 8 JDK
sudo apt-get install openjdk-8-jdk
# install pip
sudo apt-get install python-pip
# install AWS CLI
pip install awscli --user
# add the following to ~/.bashrc: export PATH="~/.local/bin:$PATH"
@tomwwright
tomwwright / ansibled:intro:example-inventory.ini
Last active January 8, 2018 11:05
ansibled : intro : example inventory
# example-inventory.ini
[db]
db.dev.ansibled
[api]
api.dev.ansibled
[webapp]
app.dev.ansibled
@tomwwright
tomwwright / ansibled:into:group_vars:project.ansibled.yml
Last active January 8, 2018 10:56
ansibled : intro : group_vars
# group_vars/project.ansibled.yml
project: ansibled
@tomwwright
tomwwright / ansible:intro:example-inventory.ini
Created January 8, 2018 11:07
ansible : intro : group_vars extended
# example-inventory.ini
[db]
db.dev.ansibled
db.dev.moreansible
db.staging.ansibled
[api]
api.dev.ansibled
@tomwwright
tomwwright / ansible:intro:example-playbook.yml
Created January 13, 2018 07:25
ansible : intro : example playbook
- hosts: db
tasks:
- name: generate a connection details file from template
template:
src: files/db/{{ db_name }}-connection.json.j2
dest: temp/db/{{ db_name }}-connection.json
- name: create an S3 bucket
s3_bucket:
name: "{{ db_connection_bucket }}"
@tomwwright
tomwwright / ansible:intro:example-playbook-2.yml
Created January 13, 2018 09:21
ansible : intro : example playbook 2
# imagining we have some hosts defined in an `elasticsearch` group
- hosts: elasticsearch
tasks:
# `when` allows us to define a condition that has to be true for this task to run
# in this case, it is including another list of tasks to execute using `include_tasks`
- name: do some sort of required setup
include_tasks: tasks/setup.yml
@tomwwright
tomwwright / ansibled:vpc:hosts.inventory
Last active February 8, 2018 11:11
ansibled : vpc : hosts.inventory
# hosts.inventory
[vpc]
vpc.ansibled
[project.ansibled:children]
vpc
@tomwwright
tomwwright / ansibled:vpc:group_vars:all.yml
Last active September 3, 2019 09:21
ansibled : vpc : group_vars : all
# group_vars/all.yml
# ---
# global definitions, not too much to go here...
# specify to run Ansible for hosts locally by default, not over SSH
ansible_connection: local