Skip to content

Instantly share code, notes, and snippets.

View ptigas's full-sized avatar
🐙

Panagiotis Tigas ptigas

🐙
View GitHub Profile
@ptigas
ptigas / antiDDOS.sh
Last active March 31, 2016 21:06
mitigate linode DDOS
#!/bin/bash
function join { local IFS="$1"; shift; echo "$*"; }
IFS=$'\n'
LIMIT=20
STATS=$(netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | grep -v Address | grep -v servers)
BLACKLISTED=""
BLACKLISTED_IPS=()
EMAIL="ptigas@gmail.com"
@ptigas
ptigas / workshop_car.ino
Created February 16, 2017 11:07
workshop car
// connect the distance sensor
#define trigPin 13
#define echoPin 12
// connect motor controller pins to Arduino digital pins
// motor one
int enA = 3;
int in1 = 4;
int in2 = 5;
@ptigas
ptigas / boostformat.patch
Last active March 7, 2017 11:52
patch boost/format
diff --git a/gazebo/rendering/Camera.cc b/gazebo/rendering/Camera.cc
index 09a2430..b806a87 100644
--- a/gazebo/rendering/Camera.cc
+++ b/gazebo/rendering/Camera.cc
@@ -22,7 +22,7 @@
#endif
#include <sstream>
-
+#include <boost/format.hpp>
@ptigas
ptigas / Dockerfile
Last active May 20, 2020 11:51
CUDA + Theano + UR + Gym gazebo
FROM ubuntu:14.04
LABEL maintainer "NVIDIA CORPORATION <cudatools@nvidia.com>"
LABEL com.nvidia.volumes.needed="nvidia_driver"
RUN NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \
NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80 && \
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub && \
apt-key adv --export --no-emit-version -a $NVIDIA_GPGKEY_FPR | tail -n +2 > cudasign.pub && \
echo "$NVIDIA_GPGKEY_SUM cudasign.pub" | sha256sum -c --strict - && rm cudasign.pub && \
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 /" > /etc/apt/sources.list.d/cuda.list
ENV CUDA_VERSION 8.0.61
### Keybase proof
I hereby claim:
* I am ptigas on github.
* I am ptigas (https://keybase.io/ptigas) on keybase.
* I have a public key ASBSUqKW2tdUJMV4sdaMMv0h1lMQ_ER2pY1K895deCmMoAo
To claim this, I am signing this object:
const puppeteer = require('puppeteer');
const fs = require('fs');
var program = require('commander');
program.option('--urls [urls]', 'Urls file')
.option('--chromium [chromium_path]', 'Path of chromium', null)
.option('--output [output]', 'Output path')
.option('--trials [N]', 'Trials', 5)
.parse(process.argv);
@ptigas
ptigas / analyse_performance.py
Created January 17, 2019 14:20
analyse_performance.py
import json
import sys
import pandas as pd
import glob
def analyse(files):
'''
- latency (responseStart - requestStart)
- time to interactive (domInteractive - navigationStart)
- load time (loadEventStart - navigationStart)
@ptigas
ptigas / shutdown_on_inactivity.sh
Last active August 27, 2019 08:23
shutdown on inactivity
#!/bin/sh
a=`cut -d ' ' -f 3 /proc/loadavg` set a = load avg.
if [ $(echo "$a > 0.25" | bc) -ne 0 ]; then #If load avg. is less than .25
sudo shutdown
fi
@ptigas
ptigas / bt.sh
Created January 15, 2020 11:14
bt wake script
string=$(curl -Is http://ptigas.com | head -1)
if [[ $string == *"OK"* ]]; then
echo "IPv4 is up"
else
echo "IPv4 is down"
curl 'https://www.btopenzone.com:8443/tbbLogon' -d "username=<username>&password=<password>"
fi
@ptigas
ptigas / ssh_multi.sh
Created January 15, 2020 11:17
start tmux multipane
#!/bin/bash
# ssh-multi.sh - a script to ssh multiple servers over multiple tmux panes
# usage: type tmux then from inside tmux type ssh-multi.sh HOST1 HOST2 ... HOSTN
# Muayyad Alsadi, D.Kovalov
# https://gist.github.com/muayyad-alsadi/bd25845776bb6b4185ba/
# https://gist.github.com/dmytro/3984680
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# Tested with Ubuntu 16.04 and tmux 2.1
function error() {