Skip to content

Instantly share code, notes, and snippets.

View Cougar's full-sized avatar
👨‍💻
I may be slow to respond.

Cougar

👨‍💻
I may be slow to respond.
View GitHub Profile
@Cougar
Cougar / udp-multi-socat.sh
Created March 22, 2016 13:41 — forked from mathieue/udp-multi-socat.sh
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)
@Cougar
Cougar / periodiccallback.py
Created January 31, 2016 21:29
Add run_now() method to tornado.ioloop.PeriodicCallback
import tornado.ioloop
class PeriodicCallback(tornado.ioloop.PeriodicCallback):
def run_now(self):
self.stop()
self._running = True
try:
return self.callback()
except Exception:
self.io_loop.handle_callback_exception(self.callback)
@Cougar
Cougar / syslog-splitter.pl
Created January 22, 2016 11:40
Split syslog file based on month field
#!/usr/bin/perl
my $m_old = "";
my $y = 0;
my $fd;
my $fn = "";
my %mon = (
Jan => '01',
@Cougar
Cougar / phant-vis.css
Created January 21, 2016 22:00 — forked from mplewis/phant-vis.css
Data logger visualization with Sparkfun's Phant and Highcharts. Licensed under the MIT License.
body {
margin-top: 40px;
margin-bottom: 40px;
}
.chart {
width: 100%;
height: 250px;
margin-top: 10px;
margin-bottom: 10px;
@Cougar
Cougar / gist:2c9cd3ee530d3e356265
Last active August 29, 2015 14:18
minecraft-wrapper protection.py plugin worinkg draft
import json, os, traceback
NAME = "protection"
AUTHOR = "C0ugar"
ID = "net.version6.minecraft.plugins.protection"
SUMMARY = "Protection commands"
DESCRIPTION = """Protection plugin."""
WEBSITE = ""
VERSION = (0, 1)
class Main:
@Cougar
Cougar / ffmpeg-mix.txt
Created March 30, 2015 20:21
Mix audio tracks from two video files with different fps using ffmpeg
Input files are following:
file1.mkv:
Duration: 01:42:13.13, start: 0.000000, bitrate: 3735 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
Stream #0:2(kor): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
file2.mpeg:
Duration: 01:37:52.97, start: 0.780000, bitrate: 4153 kb/s
@Cougar
Cougar / WME-black-bg.user.js
Created October 6, 2012 17:09
WME black map background toggle
// ==UserScript==
// @name Change WME background to black
// @namespace http://version6.net/
// @description Add radio button to change background color
// @include https://world.waze.com/editor/*
// @include https://world.waze.com/map-editor/*
// @version 0.0.1
// ==/UserScript==
//-----------------------------------------------------------------------------------------------------------------------------------------