Skip to content

Instantly share code, notes, and snippets.

View gpolitis's full-sized avatar
👾

George Politis gpolitis

👾
View GitHub Profile
@gpolitis
gpolitis / debug.md
Last active September 2, 2020 09:08
  1. quit Chrome (Cmd+Q)
  2. start it like this from the cmd line script ~/Desktop/debug.log /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-logging=stderr --vmodule=*/webrtc/*=3
  3. screen-share something, for example your most embarassing tab

P.S. if you use zsh you need to put quotes around the chrome parameters

@gpolitis
gpolitis / 99-incoming-tcp-connection-gw-override.sh
Last active July 13, 2023 17:07 — forked from Shourai/Allowing SSH on a server with an active OpenVPN client.md
Allowing SSH on a server with an active OpenVPN client
#!/bin/sh
# based on https://gist.github.com/Shourai/1088f78b5e3696190a8ce6a6045c477b
if [ $# -lt 2 ]; then
echo "Usage: $0 interface up|down" 1>&2
exit 1;
fi
DEV=$1
@gpolitis
gpolitis / Jitsi.xml
Last active January 26, 2017 21:36
Jitsi Coding Convention for IntelliJ IDEA
<code_scheme name="Jitsi">
<option name="USE_SINGLE_CLASS_IMPORTS" value="false" />
<option name="RIGHT_MARGIN" value="80" />
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="JAVA">
<option name="BRACE_STYLE" value="2" />
<option name="CLASS_BRACE_STYLE" value="2" />
@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