Skip to content

Instantly share code, notes, and snippets.

View ksophocleous's full-sized avatar
🏠
Working from home

Konstantinos Sofokleous ksophocleous

🏠
Working from home
View GitHub Profile
@ksophocleous
ksophocleous / zlib-alfa.patch
Last active September 25, 2017 22:36
zlib-diffs
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fe939d..26e3b7e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,12 +7,35 @@ set(VERSION "1.2.11")
option(ASM686 "Enable building i686 assembly implementation")
option(AMD64 "Enable building amd64 assembly implementation")
+option(BUILD_EXAMPLES "Enable building example binaries" ON)
+
@ksophocleous
ksophocleous / dll2lib.sh
Created September 28, 2016 09:12
create DEF file from exports (dumpbin /nologo /exports)
#!/usr/bin/env bash
dumpbin /nologo /exports ${LIBNAME}.dll > exports.txt
echo "EXPORTS" > exports.def
tail -n +17 exports.txt | awk '{ $1=""; $2=""; $3=""; print $0 }' | sed -r 's/\s*(.*?)\s*$/\1/' | sed '/^$/d' >> exports.def
lib /def:exports.def ${LIBNAME}.lib
rm -f exports.txt exports.def
@ksophocleous
ksophocleous / keybase.md
Created October 29, 2015 17:32
needed to be verified on keybase

Keybase proof

I hereby claim:

  • I am ksophocleous on github.
  • I am ksophocleous (https://keybase.io/ksophocleous) on keybase.
  • I have a public key whose fingerprint is B186 D47A 55A7 38FB 63F4 7BE6 7FDA 3B20 3423 E4C5

To claim this, I am signing this object:

@ksophocleous
ksophocleous / bash.sh
Created July 22, 2015 09:26
update ca certificates on msys2
#!/bin/bash
DEST=/etc/pki/ca-trust/extracted
# OpenSSL PEM bundle that includes trust flags
# (BEGIN TRUSTED CERTIFICATE)
/usr/bin/p11-kit extract --format=openssl-bundle --filter=certificates --overwrite $DEST/openssl/ca-bundle.trust.crt
/usr/bin/p11-kit extract --format=pem-bundle --filter=ca-anchors --overwrite --purpose server-auth $DEST/pem/tls-ca-bundle.pem
/usr/bin/p11-kit extract --format=pem-bundle --filter=ca-anchors --overwrite --purpose email $DEST/pem/email-ca-bundle.pem
/usr/bin/p11-kit extract --format=pem-bundle --filter=ca-anchors --overwrite --purpose code-signing $DEST/pem/objsign-ca-bundle.pem
@ksophocleous
ksophocleous / gtk-sharp-patch.diff
Created March 23, 2015 23:43
diff patch to make gtk-sharp compile
diff -Naur gtk-sharp-2.12.10/glib/glue/list.c gtk-sharp-2.12.10-mine/glib/glue/list.c
--- gtk-sharp-2.12.10/glib/glue/list.c 2009-01-07 16:54:06.000000000 +0000
+++ gtk-sharp-2.12.10-mine/glib/glue/list.c 2015-03-23 23:33:56.470499598 +0000
@@ -20,7 +20,7 @@
*/
-#include <glib/glist.h>
+#include <glib.h>
@ksophocleous
ksophocleous / bootstrap_builder.sh
Last active August 29, 2015 14:10
setup android gstreamer and c# bindings builder
#!/bin/sh
set -e
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y \
cmake build-essential libtool pkg-config automake git autotools-dev automake autoconf libtool g++ autopoint make \
@ksophocleous
ksophocleous / gst-14-installer.sh
Last active August 29, 2015 14:08
gstreamer and plugins 1.4.4
#!/bin/bash
set -e
cd $HOME
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
apt-get update
@ksophocleous
ksophocleous / Vagrantfile
Last active August 29, 2015 14:07
my usual Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "kostas"
config.vm.box_url = "https://kostas.io/kostas.box"
config.ssh.username = "kostas"
@ksophocleous
ksophocleous / keybase.md
Created September 23, 2014 10:37
public keybase proof

Keybase proof

I hereby claim:

  • I am ksophocleous on github.
  • I am ksophocleous (https://keybase.io/ksophocleous) on keybase.
  • I have a public key whose fingerprint is FD3E 0ECE F582 F6FB 60EF 2C24 9B0D 6DDE FC49 7B15

To claim this, I am signing this object:

@ksophocleous
ksophocleous / unix_timestamp.cpp
Created September 8, 2014 12:20
cross platform unix timestamp in c++
#include <iostream>
#include <chrono>
int main(int argc, char *argv[])
{
auto tp = std::chrono::system_clock::now();
auto dur = tp.time_since_epoch();
auto seconds = std::chrono::duration_cast<std::chrono::seconds>(dur).count();