Skip to content

Instantly share code, notes, and snippets.

View mohclips's full-sized avatar

mohclips mohclips

View GitHub Profile
@mohclips
mohclips / LinkedIn-less-feed-spam.js
Created November 25, 2017 21:37
A tamper monkey script to reduce the amount of spam in the LinkedIn feed
// ==UserScript==
// @name linkedin feed
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.linkedin.com/feed/
// @require http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @grant none
// ==/UserScript==
@mohclips
mohclips / install.sh
Created November 24, 2017 21:15
Simple Selenium Demo with Python
#
# install Xvfb
#
apt-get install -y xvfb
#
# install Google Chrome Browser
#
apt-get install -y gconf-service \
libasound2 \
import requests
import os
import json
import argparse
import sys
import os_client_config
class Opts(object):
#
# demo to
# 1. utilse python keystone auth/client
# 2. send a multipart MIME html email with embedded image
# This is outlook 2007 compatible :)
#
from keystoneauth1 import loading as ks_loading
from keystoneauth1.identity import v3
from keystoneauth1 import session
import gevent
from gevent import monkey, pool
monkey.patch_all()
import random
import time
MAX_SLEEP_TIME=4
@mohclips
mohclips / tag_test.yml
Created February 11, 2017 14:41
tag test in Ansible for Kenny B
#!/usr/bin/env ansible-playbook
# vim: noai:ts=2:sw=2:et
---
# run: ansible-playbook ./tags_test.yml --tags=one,two,block1
- name: "tags test"
hosts: localhost
gather_facts: no
@mohclips
mohclips / keybase.md
Created February 11, 2017 13:05
Keybase proof

Keybase proof

I hereby claim:

  • I am mohclips on github.
  • I am mohclips (https://keybase.io/mohclips) on keybase.
  • I have a public key whose fingerprint is D00A 41B9 F060 37A9 862A 7C68 5120 3063 1A31 3F5B

To claim this, I am signing this object:

@mohclips
mohclips / lineinfile.yml
Created February 9, 2017 22:53
fun lineinfile to update the beats configs with the elastic search hosts
- name: "Update configs"
lineinfile:
dest: "/etc/{{ item }}/{{ item }}.yml"
regexp: '^ hosts:'
line: ' hosts: [{% set comma = joiner(",") %}{% for es in elastic_search_hosts %}{{ comma() }}"{{ es }}"{% endfor %} ]'
with_items:
- filebeat
- packetbeat
- metricbeat
@mohclips
mohclips / jinja-csv.yml.j2
Created February 9, 2017 18:34
csv list output in jinja/ansible
hosts: [
{% set comma = joiner(",") %}
{% for es in elastic_search_hosts %}
{{ comma() }}"{{ es }}"
{% endfor %}
]
@mohclips
mohclips / Vagrantfile
Created February 6, 2017 21:56
Vagrantfile to launch multiple instances with specified provisioning scripts
# -*- mode: ruby -*-
# vi: set ft=ruby :
# vim: noai:ts=2:sw=2:et
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
UBUNTU_BOX='ubuntu/trusty64'
CENTOS_BOX='centos/7'