Skip to content

Instantly share code, notes, and snippets.

@opless
opless / gist:5460312
Created April 25, 2013 14:52
How to dump a SSL cert and determine if it's valid. Useful if someone is doing a MITM attack on you.
#!/bin/sh
echo "HEAD / HTTP/1.0\n Host: $1:443\n\n EOT\n" | openssl s_client -prexit -connect $1:443
@opless
opless / gitignore
Created February 9, 2014 00:37
Unity 3d .gitignore
*.userprefs
.DS_Store
obj/
Project/Library/
Project/Temp/
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files

The houses of parliament netblock is publicly listed:

https://apps.db.ripe.net/search/lookup.html?source=ripe&key=194.60.0.0%20-%20194.60.63.255&type=inetnum

Despite their unwillingness to reveal the UK parliament web proxies in an FOI request, wikipedia allows you to query for /24 blocks. 63 wikipedia queries later, and here's the list of every IP address that has made a wikipedia edit from the UK parliament netblock.

  • 194.60.62.36 [7 found](h ttps://en.wikipedia.org/wiki/Special:Contributions/194.60.62.36)
  • 194.60.62.35 10 found
  • 194.60.62.34 15 found
  • 194.60.62.33 34 found
# rename origin remote
git remote rename origin github
# add the gitlab remote (for the love of everything that’s holy, use ssh)
git remote add bitbucket <remote link for bitbucket>
# push existing code to new remote
git push -u bitbucket —all
# let’s magic
@opless
opless / gist:dce9b6a6343fcbd30db8
Created April 9, 2015 06:48
ImageEffectBase.cs
using UnityEngine;
[RequireComponent (typeof(Camera))]
[AddComponentMenu("")]
public class ImageEffectBase : MonoBehaviour
{
/// Provides a shader property that is set in the inspector
/// and a material instantiated from the shader
public Shader shader;
private Material m_Material;
#!/bin/bash
#NB. only tested on UE 4.9 series.
#change these as appropriate.
export PROJECT_DIR=/path/to/your/project
export ACTION=
export PLATFORM_NAME=macosx
export CONFIGURATION=DebugGame
#probably could use a bit of tidying up
// Planet Shadertoy. Created by Reinder Nijhoff 2015
// @reindernijhoff
//
// https://www.shadertoy.com/view/4tjGRh
//
//#define HIGH_QUALITY
//#define MED_QUALITY
//#define LOW_QUALITY
#define VERY_LOW_QUALITY
@opless
opless / keybase.md
Created December 31, 2016 20:04
keybase.md

Keybase proof

I hereby claim:

  • I am opless on github.
  • I am opless (https://keybase.io/opless) on keybase.
  • I have a public key ASASBUhnQojSP4VCofvPfN2p4xVo5Wt-gLBUUJqMrBSJAwo

To claim this, I am signing this object:

#!/usr/bin/perl -w
use IO::Socket ;
use IO::Handle ;
my $host = $ARGV[0] || "localhost";
my $port = $ARGV[1] || 8000;
STDERR->autoflush(1);
STDOUT->autoflush(1);
my $data = "";
@opless
opless / virt-backup.pl
Created March 30, 2017 00:04 — forked from trick77/virt-backup.pl
virt-backup.pl: fixed paths so live images will work again in Ubuntu 14.04
#!/usr/bin/perl -w
#
# 1. Install required dependencies:
# sudo apt-get install -y libxml-simple-perl pv libsys-virt-perl
# 2. Run it like this (assuming the LVM disk size is 20G):
# /virt-backup.pl --vm mykvm --state --snapsize=20G --backupdir /tmp --debug --compress
#
# AUTHOR
# Daniel Berteaud <daniel@firewall-services.com>
#