Skip to content

Instantly share code, notes, and snippets.

View PoisonousJohn's full-sized avatar

Ivan Fateev PoisonousJohn

View GitHub Profile
@PoisonousJohn
PoisonousJohn / ttl.sh
Created June 4, 2016 11:39
Avoid Beeline tethering blocking
#!/bin/sh
sudo sysctl net.ipv4.ip_default_ttl=65
{
"error": {
"code": 500,
"message": "Internal Server Error",
"exception": [
{
"message": "An exception occurred while executing 'SELECT c0_.id AS id_0, (CASE WHEN c1_.translation IS NOT NULL THEN c1_.translation ELSE c2_.translation END) AS sclr_1, c0_.depth AS depth_2, c3_.id AS id_3, c4_.id AS id_4, (CASE WHEN c1_.locale IS NOT NULL THEN c1_.locale ELSE c2_.locale END) AS sclr_5, c0_.default_locale AS default_locale_6 FROM ca_categories c0_ LEFT JOIN ca_category_translations c1_ ON c0_.id = c1_.idCategories AND (c1_.locale = 'en') LEFT JOIN ca_category_translations c2_ ON c0_.id = c2_.idCategories AND (c2_.locale = c0_.default_locale) LEFT JOIN ca_categories c3_ ON c0_.idCategoriesParent = c3_.id LEFT JOIN ca_categories c4_ ON c0_.id = c4_.idCategoriesParent WHERE c0_.id IN (?) GROUP BY c0_.id ORDER BY c0_.depth ASC' with params [2]:\n\nSQLSTATE[42803]: Grouping error: 7 ERROR: column \"c1_.translation\" must appear in the GROUP BY clause or be used
@PoisonousJohn
PoisonousJohn / rc.local
Last active March 6, 2016 23:43
Run AceStream engine on startup of OSMC
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
@PoisonousJohn
PoisonousJohn / convertToSmb.sh
Last active February 11, 2016 13:20
convert windows-like network path to smb linux path
#!/bin/sh
printf "%s" $1 | sed -n -E 's,^(\\)+,smb://,gp' | sed -n 's,\\,/,gp'
@PoisonousJohn
PoisonousJohn / AssetGPULoader.cs
Created January 14, 2016 10:42 — forked from flarb/AssetGPULoader.cs
Unity3d GPU Pre-loader
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
public class AssetGPULoader : MonoBehaviour {
public Camera activeCamera;
RenderTexture _rt;
#!/bin/bash -x
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
# Extension Copyright (c) 2013 Weptun Gmbh
# http://www.weptun.de
# Extension Copyright (c) 2013 FoundryLogic LLC
# http://foundrylogic.com
#
# Extended by Ronan O Ciosoig January 2012
#include <iostream>
#include <unordered_map>
#include <string>
#include <assert.h>
using namespace std;
class ServiceInterface {
public:
virtual ~ServiceInterface() {}
export NDK=/tmp/android-ndk-r8b
# Create the standalone toolchain
$NDK/build/tools/make-standalone-toolchain.sh \
--platform=android-9 \
--install-dir=/tmp/my-android-toolchain
export PATH=/tmp/my-android-toolchain/bin:$PATH
export SYSROOT=/tmp/my-android-toolchain/sysroot
export CC="arm-linux-androideabi-gcc --sysroot $SYSROOT"
@PoisonousJohn
PoisonousJohn / main.cpp
Created January 15, 2014 17:20
snippet for time profiling
#include <iostream>
#include <chrono>
int main()
{
auto t1 = std::chrono::high_resolution_clock::now(); //Used in testing execution duration.
auto t2 = std::chrono::high_resolution_clock::now();
std::cout << "test function took "
<< std::chrono::duration_cast<std::chrono::nanoseconds>(t2 - t1).count()
#!/usr/bin/env ruby
#
# hiero2sparrow.rb
# Sparrow
#
# Created by Daniel Sperl on 11.02.2010
# Copyright 2010 Incognitek. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify