Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
text = "Samaritan Report Threat Assessment and Mitigation Date Current Date Time Current Time Subject Anomalous Behavior Detection and Countermeasures Summary Anomalous patterns detected in the activities of individuals within Sector 12 Probability of disruptive behavior reaching critical levels 82.5% Immediate intervention recommended to maintain societal stability Key Identified Entities 1 Individual A High likelihood of initiating a protest Risk Level High Recommended Action Surveillance escalation preemptive detention 2 Individual B Potential hacker targeting critical infrastructure Risk Level Severe Recommended Action Network isolation neutralization 3 Group X Organization planning unauthorized public assembly Risk Level Moderate Recommended Action Infiltration and dispersion Detailed Analysis Behavioral Patterns Increased communications among identified entities suggest coordination Keyword analysis reveals topics related to dissent and mobilization Network Traffic Unusual spikes in
call plug#begin('~/.config/nvim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
call plug#end()
"<fzf quickmarks>
function! s:open_url_quickmark(line)
silent execute '!firefox ' . shellescape(split(a:line)[-1], 1)
endfunction
import socket
port_number = 4242
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_socket.bind(('0.0.0.0', port_number))
print "UDPServer Waiting for client on port", port_number
while True: print server_socket.recvfrom(1024)
require 'mittsu'
class Game
def bar
left_bar_geometry = Mittsu::BoxGeometry.new(0.2, 0.05, 1.0)
left_bar = Mittsu::Mesh.new(left_bar_geometry, Mittsu::MeshPhongMaterial.new(color: 0x888888))
@camera.add left_bar
left_bar.position.y -= 0.4
left_bar.position.z -= 1
from google.cloud import bigquery
import sys
bigquery_client = bigquery.Client(
project = "my-project")
query = bigquery_client.run_sync_query("select * from airflow.quotes_" + sys.argv[1])
query.run()
dataset = bigquery_client.dataset("airflow")
table = dataset.table("quotes")
table.reload()
result = table.insert_data(query.rows)
@yazgoo
yazgoo / dag.py
Last active January 17, 2017 10:45
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2017, 1, 1),
'email': ['mymail@mail.net'],
'email_on_failure': False,
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2017, 1, 1),
'email': ['innov-analytics@teads.tv'],
'email_on_failure': False,
@yazgoo
yazgoo / gist:f3ecb391e4839127349b
Created November 18, 2014 13:41
fuse_kafka memcheck #0
==26249==
==26249== HEAP SUMMARY:
==26249== in use at exit: 32 bytes in 2 blocks
==26249== total heap usage: 5 allocs, 3 frees, 52 bytes allocated
==26249==
==26249== LEAK SUMMARY:
==26249== definitely lost: 0 bytes in 0 blocks
==26249== indirectly lost: 0 bytes in 0 blocks
==26249== possibly lost: 0 bytes in 0 blocks
==26249== still reachable: 32 bytes in 2 blocks
@yazgoo
yazgoo / owf14.md
Last active August 29, 2015 14:08
OWF - day2

An introduction to ansible

The problem: software orchestration.
Like fabric, puppet, chef.
It is Built on YAML, is agentless (uses SSH), idempotent.
Configuration is called 'playbook'.
A group of actions is called a role.
You can define host groups, hosts, variables.
To test local provisionning, use vagrant.

@yazgoo
yazgoo / tree.rb
Created May 22, 2014 09:29
arrange process snapshot in a tree
#!/usr/bin/ruby
groups = {}
STDIN.each_line do |line|
items = line.split
pid = items[ARGV[0].to_i]
ppid = items[ARGV[1].to_i]
groups[ppid] = [] if groups[ppid].nil?
groups[ppid] << [pid, line]
end
def print_tree groups, cmd, ppid, tab = ""