Skip to content

Instantly share code, notes, and snippets.

@pcn
pcn / twittermute.txt
Created January 29, 2020 15:33 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@pcn
pcn / install_pyenv.sh
Last active April 26, 2019 20:33 — forked from ysaotome/install_pyenv.sh
pyenv install for CentOS 6.5 x86_64
#!/bin/bash
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
@pcn
pcn / complex_salt_orchestrate.sls
Created March 12, 2018 15:23 — forked from whiteinge/complex_salt_orchestrate.sls
An example of a complex, multi-host Salt Orchestrate state that performs status checks as it goes
# /srv/salt/upgrade_the_app.sls
# Example of a complex, multi-host Orchestration state that performs status checks as it goes.
# Note, this is untested and is meant to serve as an example.
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}'
{% set nodes = salt.pillar.get('nodes', []) %}
{% set all_grains = salt.saltutil.runner('cache.grains',
tgt=','.join(nodes), tgt_type='list') %}
{# Default version if not given at the CLI. #}
@pcn
pcn / BUILD
Created December 4, 2017 18:33 — forked from jayeye/BUILD
stamping with build information. Obviously, replace _slash_ in the filenames with an actual slash!
package(default_visibility = ["//visibility:public"])
genrule(
name = "genpybuildinfo",
outs = [
"buildinfo.py",
],
stamp = 1,
cmd = "./$(location tools/mkpybuildinfo.sh) > \"$@\"",
tools = [
def __get_gh_repos(teamname):
'''
looks up team ID from the organization then returns a list of repos
for which that team are collaborators
'''
params = ''
base_url = 'https://api.github.com/'
headers = { 'Accept' :'application/vnd.github.v3+json', "Content-type" : "application/json", \
'User-Agent' : 'dmangot@librato.com', 'Authorization': 'token ' + app.config['GH_API_TOKEN'] }
req = requests.get(base_url + 'orgs/librato/teams', auth=(app.config['GH_API_TOKEN'], 'x-oauth-basic')).text
@pcn
pcn / tableflip.sh
Last active December 29, 2015 19:59
tableflip.sh: for all your commandline table flipping needs
#!/bin/sh
flip() {
echo;
echo -en "( º_º) ┬─┬ \r"; sleep .2;
echo -en " ( º_º) ┬─┬ \r"; sleep .2;
echo -en " ( ºДº)┬─┬ \r"; sleep 1.2;
echo -en " (╯'Д')╯︵⊏ \r"; sleep .1;
echo -en " (╯'□')╯︵ ⊏ \r"; sleep .1;
echo " (╯°□°)╯︵ ┻━┻"; sleep .1;
}
@pcn
pcn / figwheel-emacs-cider.txt
Created October 27, 2015 04:24 — forked from auramo/figwheel-emacs-cider.txt
figwheel emacs cider stuff
## Using Emacs CIDER as the Figwheel REPL tool
project.clj should have this line:
```
:figwheel { :nrepl-port 7888 }
```
At the defproject-level.
It enables external tools to connect to the Figwheel REPL. To connect
@pcn
pcn / gist:d4a9cd1ea42e6e02f5e1
Last active January 13, 2021 15:35 — forked from tbonza2/gist:20757551443a61254aa6
Saltstack mode for emacs

Saltstack mode for emacs

Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the question on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text implementation appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

Reasoning

After looking around, I found that someone had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use Mako templates for a project not involving Saltstack. Since Edx uses Mako t

This used to work on 2014.1.13 but fails on 2015.5.0 and 2015.5.2:
state init.sls file content:
{% set TEST_SYMLINK = '/opt/test_symlink' %}
{% if 0 == salt['cmd.retcode']('test -h '~ TEST_SYMLINK ~' ') %}
{{ TEST_SYMLINK }}:
file.symlink:
- target: /opt/yp
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"