Skip to content

Instantly share code, notes, and snippets.

View hetelek's full-sized avatar

Stergios Hetelekides hetelek

View GitHub Profile
@hetelek
hetelek / wireshark.sh
Created August 20, 2022 06:45
Wireshark over SSH MacOS
ssh -i ~/.ssh/key ec2-user@IP_ADDR "sudo tcpdump -i any -U -s0 -w - 'not port 22'" | /Applications/Wireshark.app/Contents/MacOS/Wireshark -k -i -
@hetelek
hetelek / server.c
Created June 26, 2022 20:04
Simple HTTP server in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <pthread.h>
@hetelek
hetelek / VGG Visualizations (TV).ipynb
Last active November 17, 2017 23:04
VGG-16 Visualization Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hetelek
hetelek / noisy_cartpole.py
Created April 12, 2017 21:51
Attempt to solve Cart Pole by adding random noise to the best weights.
import tensorflow as tf
import gym
stddev = 1.0
render = True
monitor = True
best_weights = tf.Variable(tf.truncated_normal(shape=[4, 1]))
current_weights = tf.Variable(best_weights.initialized_value())
@hetelek
hetelek / NeuralNet.swift
Last active November 3, 2015 18:54
Basic neural network with genetics
//
// NeuralNet.swift
// BestColor
//
// Created by Stevie Hetelekides on 9/15/15.
// Copyright (c) 2015 Expetelek. All rights reserved.
//
import Foundation
@hetelek
hetelek / SimpleRespring.xm
Created December 29, 2013 23:54
A tweak (for iOS 7) that allows you to respring your device by swiping the homescreen card up in the app switcher.
#import <substrate.h>
%hook SBAppSliderController
- (BOOL)sliderScroller:(id)scrollingViewController isIndexRemovable:(unsigned int)index
{
return YES;
}
- (void)sliderScroller:(id)scrollingViewController itemWantsToBeRemoved:(unsigned int)index
@hetelek
hetelek / Polynomial.java
Created November 25, 2013 18:27
A class which will calculate the real roots of a polynomial, when given the coefficients.
import java.util.*;
public class Polynomial
{
private static final double ROOT_LEEWAY = 0.000000001;
private double[] coefficients;
private double remainder;
public Polynomial(double[] coefficients, double remainder)
{
this.coefficients = coefficients;
@hetelek
hetelek / BookFlip.java
Created September 11, 2013 21:13
An application which simulates a simple flip of a page in a book. Ported from C# - https://github.com/hetelek/BookFlip
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
// Ported from C# - https://github.com/hetelek/BookFlip
@hetelek
hetelek / CountedItem.java
Last active December 17, 2015 09:28
Classes that will only add an item once into an array at most, and will count how many times each item has attempted to be added.
public class CountedItem<E>
{
E item;
int count = 1;
public CountedItem(E item)
{
this.item = item;
}
@hetelek
hetelek / Equa.java
Last active February 24, 2022 20:28
Classes that tokenize, parse and solve math equations. Solving is currently very simple, and cannot factor, complete the square, etc...
import java.util.Arrays;
import java.util.Stack;
import java.util.LinkedList;
enum TokenType
{
OPERATOR, RIGHT_PARENTHESE, LEFT_PARENTHESE, NUMBER, EQUALS, UNKNOWN
}
class Token