Skip to content

Instantly share code, notes, and snippets.

View krisk0's full-sized avatar

Dagoth Ur krisk0

  • Valenvaryon, Nirn
View GitHub Profile
@krisk0
krisk0 / maloader-20151001.ebuild
Last active March 2, 2016 10:15
maloader ebuild that installs 32- and 64-bit interpreter
# Copyright 1999-2012 Gentoo Foundation
# Copyright 2016 Крыськов Денис
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
KEYWORDS="amd64 ~x86"
DESCRIPTION="mach-o loader for linux"
@krisk0
krisk0 / ct-ng-20160310.ebuild
Last active March 10, 2016 14:52
ebuild for crosstools-ng dated 26 March 2016
# Copyright 1999-2015 Gentoo Foundation
# Copyright 2016 Денис Крыськов
# Distributed under the terms of the GNU General Public License v2
# Official Gentoo ebuild hacked by Денис Крыськов aka krisk0, reason: want to
# build aarch64 cross-compiler, thus take fresh version of crosstool-ng
EAPI=5
inherit bash-completion-r1
@krisk0
krisk0 / gist:5213d414a12b4a3ddcabd152e0cb2e59
Last active April 7, 2016 09:19
send Ethernet frames the fast way (via mmap)
/*
* Send 3 malformed ethernet ARP frames the fast way (described in
* linux/Documentation/packet_mmap.txt)
*
* compile with -std=c99 -lnet
*
* The program is known to work under 64-bit Linux and 64-bit Android
* Requires libnet library (>=net-libs/libnet-1.1.6, >=bionic-core/libnet-1.1.6)
*/
@krisk0
krisk0 / gist:5dc24dfda3c5ff280d604d0099401293
Last active April 8, 2016 16:04
Cloudflare zlib ebuild
# Copyright 1999-2014 Gentoo Foundation
# Copyright 2016 Денис Крыськов
# Distributed under the terms of the GNU General Public License v2
# Reason for creating this ebuild: want a fast CRC32 calculation (for modern
# Intel 64-bit CPU) which is found in Linux kernel and Cloudflare fork of zlib
EAPI=4
AUTOTOOLS_AUTO_DEPEND=no
@krisk0
krisk0 / gist:af25a07d4804a850376c523c04d77d53
Created April 15, 2016 09:28
mktemp implemented in .sh, understands 2 parameters tmpdir and suffix
#!/bin/sh
tmpdir=/tmp
unset suffix
while [ -n "$1" ]; do
case $1 in
--tmpdir=*)
tmpdir=${1#*=}
;;
@krisk0
krisk0 / virtualbox.ebuild.patch
Created June 24, 2016 16:51
patch for VirtualBox ebuild
--- /usr/portage/app-emulation/virtualbox/virtualbox-5.0.16.ebuild 2016-06-24 19:47:07.000000000 +0300
+++ ./virtualbox-5.0.16.ebuild 2016-06-24 15:10:57.000000000 +0300
@@ -1,6 +1,8 @@
# Copyright 1999-2016 Gentoo Foundation
+# Copyright 2016 Денис Крыськов
# Distributed under the terms of the GNU General Public License v2
-# $Id$
+
+# Hacked by Денис Крыськов to never check for system directory permissions
@krisk0
krisk0 / subversion-1.8.16.ebuild.patch
Created August 8, 2016 08:03
Fix subversion-1.8.16.ebuild
--- /usr/portage/dev-vcs/subversion/subversion-1.8.16.ebuild 2016-07-15 14:35:54.000000000 +0300
+++ ./subversion-1.8.16.ebuild 2016-08-08 10:55:47.000000000 +0300
@@ -137,6 +137,8 @@
src_prepare() {
epatch "${PATCHES[@]}"
+ # framework hack causes problems under Linux
+ >build/ac-macros/macosx.m4
fperms +x build/transform_libtool_scripts.sh
@krisk0
krisk0 / compile_libcxx.sh
Created August 8, 2016 10:48
compile libcxxabi and libcxx from scratch with clang
#!/bin/bash -e
# Download and unpack libcxx-3.8.0.src.tar.xz llvm-3.8.0.src.tar.xz
# https://github.com/llvm-mirror/libcxxabi/archive/master.tar.gz
# Files should be in $DOWNLOAD_DIR/llvm
# $DOWNLOAD_DIR/libcxx
# $DOWNLOAD_DIR/libcxxabi
DOWNLOAD_DIR=/tmp/libcxx.download/
BUILD_DIR=/tmp/libcxx.build/
@krisk0
krisk0 / crossdev-20160602.patch
Created August 17, 2016 09:51
Fix nocxx/cxx problem for crossdev
--- crossdev.a 2016-06-02 18:31:58.000000000 +0300
+++ crossdev.b 2016-08-17 12:47:12.849882387 +0300
@@ -1163,10 +1163,18 @@
einfo "Log: ${logfile}"
ebegin "Emerging cross-${2:-${pn}}"
+
+ # remove nocxx flag
+ USE=`echo $USE|sed s:-nocxx::g`
+ USE=`echo $USE|sed 's: nocxx::g'`
@krisk0
krisk0 / download-cyanogen-mod-source-quickly_20160818
Created August 19, 2016 09:00
Download cyanogen mod quickly without using repo. Needs script checkout_by_sha <TGT_DIR> <URL> <SHA>
checkout_by_sha ./abi/cpp/ https://github.com/CyanogenMod/android_abi_cpp 36b381298a4efb7c293d394d8b1acbda68230989
checkout_by_sha ./art/ https://github.com/CyanogenMod/android_art 7592c94124e7fd7ea8bd8592c4a8e1001d6f6e4d
checkout_by_sha ./cts/ https://android.googlesource.com/platform/cts 3eab954ba1a608ad2917cd3d2cfae77627955145
checkout_by_sha ./ndk/ https://android.googlesource.com/platform/ndk e6403c6a048bdec5a7fc7c6c0cc149fc5f098f80
checkout_by_sha ./pdk/ https://android.googlesource.com/platform/pdk 708589163e790eb3a7fec09f4832a0f78999bdf3
checkout_by_sha ./sdk/ https://android.googlesource.com/platform/sdk c78d07c6e964f23dc12ba739aff49ff1bf74b323
checkout_by_sha ./docs/source.android.com/ https://android.googlesource.com/platform/docs/source.android.com 918070543c8989f1088953e525a22176eb00caa0
checkout_by_sha ./external/v8/ https://android.googlesource.com/platform/external/v8 57a14c9a8621270b0e6c697dce28a9c453ebe55f
checkout_by_sha ./external/aac/ https://android.googlesource.com/platform/external/aac