Skip to content

Instantly share code, notes, and snippets.

View RushOnline's full-sized avatar

Eugene RushOnline

  • Intech
  • Great Novgorod, Russia
View GitHub Profile
@RushOnline
RushOnline / DEBUG_CFLAGS
Created May 9, 2015 20:16
Good gcc debug flags
-g3 -ggdb -gdwarf-4 -O0 -fno-inline -DDEBUG -Wall -Werror
@RushOnline
RushOnline / openssl-debug-compile
Last active August 29, 2015 14:21
How to configure and compile OpenSSL in DEBUG mode
./config -d shared no-asm 386 no-sse2 zlib-dynamic -g3 -ggdb -gdwarf-4 -fno-inline -O0 -DDEBUG_SAFESTACK
pm list packages -f
@RushOnline
RushOnline / keyboard.js
Created September 2, 2015 21:37
Debug gnome shell us/ru switcher
_modifiersSwitcher: function() {
let sourceIndexes = Object.keys(this._inputSources);
let i = 0;
while (i < sourceIndexes.length) {
let source = this._inputSources[sourceIndexes[i]];
print("index: ", source.index, ", id: ", source.id);
/*
let seen = [];
let obj = this._inputSources;
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.6 (GNU/Linux)
mQGiBEK/0MURBACv5Rm/jRnrbyocW5t43hrjFxlw/DPLTWiA16apk3P2HQQ8F6cs
EY/gmNmUf4U8KB6ncxdye/ostSBFJmVYh0YEYUxBSYM6ZFui3teVRxxXqN921jU2
GbbWGqqlxbDqvBxDEG95pA9oSiFYalVfjxVv0hrcrAHQDW5DL2b8l48kGwCgnxs1
iO7Z/5KRalKSJqKx70TVIUkD/2YkkHjcwp4Nt1pPlKxLaFp41cnCEGMEZVsNIQuJ
1SgHyMHKBzMWkD7QHqAeW3Sa9CDAJKoVPHZK99puF8etyUpC/HfmOIF6jwGpfG5A
S7YbqHX6vitRlQt1b1aq5K83J8Y0+8WmjZmCQY6+y2KHOPP+zHWKe5TJDeqDnN0j
sZsKA/441IF4JJTPEhvRFsPJO5WKg1zGFbxRPKvgi7+YY6pJ0VFbOMcJVMkvSZ2w
@RushOnline
RushOnline / qtyaml.h
Created February 20, 2016 09:03 — forked from brcha/qtyaml.h
Qt Yaml support using yaml-cpp library
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ***** END LICENSE BLOCK ***** */
/*
# article http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/
# clone of https://github.com/borromeotlhs/node-opencv/blob/77e72273608387957340abe1f6a1a4608173fed1/Dockerfile
# This file describes how to build node-opencv into a runnable linux container with all dependencies installed
# To build:
# 1) Install docker (http://docker.io)
# 2) Build: wget https://raw.github.com/dotcloud/docker/v0.1.6/contrib/docker-build/docker-build && python docker-build $USER/node-opencv < Dockerfile
# 3) Test: docker run $USER/node-opencv node -e "console.log(require('opencv').version)"
#
# VERSION 0.3
# DOCKER-VERSION 8.1.2
; in the name of ALLAH
; /etc/systemd/system/stunnel.service or /usr/lib/systemd/system/stunnel.service
; change "{{ config.conf }}" by your config path.
[Unit]
Description=SSL tunnel for network daemons
After=syslog.target
[Service]
ExecStart=/usr/sbin/stunnel {{ config.conf }}
Setup RaspberryPi:
mkdir -p /etc/ppp/scripts
cat > /etc/ppp/scripts/ppplogin <<EOF
#!/bin/sh
# ppplogin - script to fire up pppd on login
# Disable other users to write to the tty.
mesg n
@RushOnline
RushOnline / list.h
Created December 5, 2016 17:28 — forked from evanslai/list.h
Linux kernel linked list, modified for userspace
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stdio.h>
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.