Skip to content

Instantly share code, notes, and snippets.

@optionalg
optionalg / kafka_cassandra_cluster.md
Created January 27, 2018 00:22 — forked from ferhtaydn/ kafka_cassandra_cluster.md
Confluent Kafka Platform and Cassandra Multi Node Deployment Guide

Step by step guide for multi node Confluent Kafka Platform and Cassandra cluster;

It is a multi node deployment of https://github.com/ferhtaydn/sack

Assume that, we have five Ubuntu 14.04 nodes. Their IPs are as follows;

  • 12.0.5.4
  • 12.0.5.5
  • 12.0.5.6
  • 12.0.1.170
@optionalg
optionalg / MALrandom.js
Created January 26, 2018 13:21 — forked from IA21/MALrandom.js
picks random anime/manga from your MAL animelist/mangalist pages
// ==UserScript==
// @name MAL random
// @version 3
// @description picks random anime/manga from your MAL animelist/mangalist pages
// @author IA21
// @match https://myanimelist.net/mangalist/*
// @match https://myanimelist.net/animelist/*
// @grant none
// ==/UserScript==
{"repositories": ["https://bitbucket.org/jjones028/p4sublime/raw/tip/packages.json", "https://bitbucket.org/klorenz/sublime_packages/raw/tip/packages.json", "https://csch1.triangulum.uberspace.de/release/packages.json", "https://packagecontrol.io/packages_2.json", "https://packagecontrol.io/repository.json", "https://raw.githubusercontent.com/20Tauri/DoxyDoxygen/master/DoxyDoxygen.json", "https://raw.githubusercontent.com/Andr3as/Sublime-SurroundWith/master/packages.json", "https://raw.githubusercontent.com/FichteFoll/sublime_packages/master/package_control.json", "https://raw.githubusercontent.com/Floobits/floobits-sublime/master/packages.json", "https://raw.githubusercontent.com/Harrison-M/indent.txt-sublime/master/packages.json", "https://raw.githubusercontent.com/Hexenon/FoxCode/master/packages.json", "https://raw.githubusercontent.com/Kaizhi/SublimeUpdater/master/packages.json", "https://raw.githubusercontent.com/Kasoki/FancyProjects/master/packages.json", "https://raw.githubusercontent.com/MattDMo/Neon-
@optionalg
optionalg / debian_upgrade.yml
Created January 17, 2018 21:57 — forked from maethor/debian_upgrade.yml
Ansible playbook to update and upgrade Debian hosts
---
- hosts: all
sudo: yes
tasks:
- name: Update packages list
apt: update_cache=yes
when: ansible_os_family == 'Debian'
- name: List packages to upgrade (1/2)
@optionalg
optionalg / puppet-comands.sh
Created January 12, 2018 05:50 — forked from makeittotop/puppet-comands.sh
useful puppet commands in no particular order
# Little environment variable magic. To provide a custom value for any facter fact as you run a puppet apply , you can include
# FACTER_factname=new_value before your new terminal command.Combining this with the --noop flag, you can do a quick test of how #your manifest would run on a different system before setting up a full testing environment.
>> FACTER_operatingsystem=Debian puppet apply --noop admin/tests/init.pp
unix> puppet agent --configprint server
unix> puppet agent --configprint environment
@optionalg
optionalg / hiera_test.sh
Created January 12, 2018 05:47 — forked from WhatsARanjit/hiera_test.sh
Multiple backends with hiera_array
master /etc/puppetlabs/puppet]# cat hiera.yaml
---
:backends:
- eyaml
- yaml
:yaml:
:datadir: /etc/puppetlabs/puppet/hieradata
:eyaml:
@optionalg
optionalg / useragentswitcher.xml
Created January 5, 2018 18:57
Massive list of user agents for User Agent Switcher by Chris Pederik http://forums.chrispederick.com/categories/user-agent-switcher
<useragentswitcher>
<folder description="Browsers - Windows">
<folder description="Legacy Browsers">
<useragent description="Arora 0.6.0 - (Vista)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Avant Browser 1.2" useragent="Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 4.0.249.0 (Win 7)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 5.0.310.0 (Server 2003)" useragent="Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9" appcodename="" appname=""
@optionalg
optionalg / README.md
Created January 5, 2018 00:38 — forked from dnozay/README.md
simple distributed web crawler using flask + scrapy + redis

design

Requests are handled by flask, a bunch of urls are inserted in the object store (redis) and arguments are put on the queue (redis again) for workers to consume. More workers would mean more items processed in parallel.

Other possible implementations:

  • multiprocessing module for consuming all cpus.
  • multiprocessing.managers.SyncManager for distributing task to other machines.
import json
import uuid
from pathlib import Path
from urllib.parse import urlparse
from datetime import datetime
import html2text
import requests
from bs4 import BeautifulSoup
@optionalg
optionalg / notebook.ipynb
Created January 2, 2018 05:46 — forked from kspeeckaert/notebook.ipynb
Efficient query pandas dataset
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.