Skip to content

Instantly share code, notes, and snippets.

View gpolitis's full-sized avatar
👾

George Politis gpolitis

👾
View GitHub Profile
@gpolitis
gpolitis / git-status-recursive.sh
Last active July 5, 2017 16:31
Recursive git status
#!/bin/sh -e
# inspired by this https://gist.github.com/dbu/2843660
find . -name .git -type d | while read dir ; do git -C $(dirname $dir) status -s ; done
#!/bin/sh -e
VIDEO_SZ=1280x720
VIDEO_FPS=60
VIDEO_FMT=yuv4mpegpipe
VIDEO_PIXEL_FMT=yuv420p
VIDEO_IN_FILE="$1"
VIDEO_IN_FILE_BASENAME=$(basename "$VIDEO_IN_FILE")
VIDEO_OUT_FILE=output/stamped-$VIDEO_IN_FILE_BASENAME
IMAGE_EXTENSION=png
#!/bin/sh -e
CONTAINER=$1
lxc exec $CONTAINER -- apt-get -y install openssh-server
lxc exec $CONTAINER -- visudo
lxc exec $CONTAINER -- mkdir -p /home/ubuntu/.ssh/
lxc file push ~/.ssh/id_rsa $CONTAINER/home/ubuntu/.ssh/id_rsa
lxc file push ~/.ssh/id_rsa.pub $CONTAINER/home/ubuntu/.ssh/id_rsa.pub
lxc file push ~/.ssh/id_rsa.pub $CONTAINER/home/ubuntu/.ssh/authorized_keys
#!/usr/bin/perl
use strict;
use Getopt::Long qw(:config no_auto_abbrev);
use Net::Pcap;
use NetPacket::Ethernet;
use NetPacket::IP;
use NetPacket::UDP;
use Net::RTP::Packet;
$|=1;
#!/usr/bin/perl
use Net::Pcap;
die "Usage: $0 infile outfile" unless scalar(@ARGV) > 1;
my $err;
open(my $out, '>:raw', $ARGV[1]) or die "cannot open in file: $!";
@gpolitis
gpolitis / rules-both.iptables
Created October 5, 2015 01:36 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@gpolitis
gpolitis / auto.smb
Created October 26, 2014 15:43
auto.smb file from the autofs5 debian package patched with WOL (wake-on-lan) functionality and guest or authed login
#!/bin/bash
# This file must be executable to work! chmod 755!
key="$1"
opts="-fstype=cifs,file_mode=0640,dir_mode=0750"
macaddr=`grep $key /etc/ethers | egrep -v '^#' | cut -d' ' -f1`
max_retries=60
ping_deadline=1
@gpolitis
gpolitis / export-orgmode.pl
Created April 20, 2013 12:05
modified version of the export-html.pl (found in the /scripts/add-ons/ directory), that exports tasks to org-mode format that works for me
#! /usr/bin/perl
################################################################################
## taskwarrior - a command line task list manager.
##
## Copyright 2006-2013, Paul Beckingham, Federico Hernandez.
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@gpolitis
gpolitis / SciTEUser.properties
Created December 29, 2012 17:09
SciTE config
edge.mode=1
edge.column=80
font.base=$(font.monospace)
font.small=$(font.monospace)
font.comment=$(font.monospace)
font.text=$(font.monospace)
font.text.comment=$(font.monospace)
font.embedded.base=$(font.monospace)
font.embedded.comment=$(font.monospace)
$cue = 'c:\Users\gp\example.cue'
$patt = '(?smi)TITLE\s"([^"]*)"(?:\n|\s)*PERFORMER\s*"([^"]*)"'
cat $cue -Raw |
sls -patt $patt -AllMatches |
% { $_.Matches } |
% { New-Object -Property @{ Title = $_.Groups[1].Value; Artist = $_.Groups[2].Value } } |
% { "\track {0} - {1}" -f $_.Artist, $_.Title }