Skip to content

Instantly share code, notes, and snippets.

View mshade's full-sized avatar
:octocat:
Reducing Toil

Mike Shade mshade

:octocat:
Reducing Toil
View GitHub Profile
@mshade
mshade / job-from-cronjob.py
Created August 9, 2019 04:03
manually trigger a kubernetes job from a cronjob with python from a pod
from kubernetes import client, config
import datetime
with open('/run/secrets/kubernetes.io/serviceaccount/namespace', 'r') as ns:
namespace = ns.read().strip()
# Reads config from in-container token / cert
config.load_incluster_config()

Keybase proof

I hereby claim:

  • I am mshade on github.
  • I am mshade (https://keybase.io/mshade) on keybase.
  • I have a public key ASB-9yiTStJDw1fv-QSy0HEWv6z8OcF9zM9k03Dw_70ZIwo

To claim this, I am signing this object:

@mshade
mshade / monscale.sh
Created April 30, 2018 17:12
scale lower DPI monitor to play with hidpi builtin screen
#!/usr/bin/env bash
xrandr --output eDP-1 --auto --output DP-1 --auto --panning 3840x2400+3200+0 --scale 2x2 --right-of eDP-1
@mshade
mshade / solr.sls
Created June 8, 2016 23:04
file.managed always pulls file
[INFO ] Running state [/opt/solr-4.10.4.tgz] at time 23:00:37.037241
[INFO ] Executing state file.managed for /opt/solr-4.10.4.tgz
[DEBUG ] LazyLoaded roots.envs
[DEBUG ] Could not LazyLoad roots.init
[DEBUG ] Updating roots fileserver cache
[DEBUG ] Requesting URL http://archive.apache.org/dist/lucene/solr/4.10.4/solr-4.10.4.tgz using GET method
[INFO ] File /opt/solr-4.10.4.tgz is in the correct state
[INFO ] Completed state [/opt/solr-4.10.4.tgz] at time 23:01:04.240587 duration_in_ms=27203.346
@mshade
mshade / 0_reuse_code.js
Created June 2, 2016 16:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mshade
mshade / add-storage-to-vagrant-vm.txt
Last active March 3, 2017 20:55
Add space to WebStarter VM disk using LVM
1) vagrant halt, make sure machine is stopped
2) open vbox UI, add hard disk to the machine with desired size. this will be added to the existing 8GB root vol. A dynamically allocated disk is preferred
3) vagrant up, vagrant ssh, sudo su -
4) fdisk -l to make sure the new disk shows up. It should be /dev/sdb
5) pvcreate /dev/sdb
6) vgextend VolGroup /dev/sdb
7) lvextend -r /dev/VolGroup/lv_root /dev/sdb (extends logical volume to use space on the new drive, resizes the filesystem in one go)
you are done!
df -h should now show a root partition size of 8GB plus whatever you created in step 2