Skip to content

Instantly share code, notes, and snippets.

@x-projs
x-projs / mkexeloadable.c
Last active August 25, 2024 04:40
Make the executable file can be loaded by dlopen() after glibc>=2.30.
/*
There is a behavior change in glibc>=2.30. dlopen() will fail if the file is
position independent executable. This code will clean up the PIE flag in the
file to bypass the dlopen() check.
MIT License (c) 2020 Yubo Xie, [email protected]
*/
#include <stdio.h>
#include <string.h>
@mikoim
mikoim / linuxbrew-on-freebsd.diff
Created May 2, 2017 13:05
This patch solves some issues when Linuxbrew runs on FreeBSD, but it can't detect system gcc or clang. So you can't install packages...
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index 0a7a8dc8b..7bea96cf8 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -286,7 +286,7 @@ module Homebrew
def symlink_ld_so
ld_so = HOMEBREW_PREFIX/"lib/ld.so"
return if ld_so.readable?
- sys_interpreter = ["/lib64/ld-linux-x86-64.so.2", "/lib/ld-linux.so.3", "/lib/ld-linux.so.2", "/lib/ld-linux-armhf.so.3"].find do |s|
+ sys_interpreter = ["/compat/linux/lib64/ld-linux-x86-64.so.2", "/compat/linux/lib/ld-linux.so.3", "/compat/linux/lib/ld-linux.so.2", "/compat/linux/lib/ld-linux-armhf.so.3"].find do |s|
@stefanschmidt
stefanschmidt / flash_plugin_without_admin_rights.sh
Last active June 4, 2016 21:51
Installing the Flash plugin in your home folder on OS X (without admin rights)
FLASH_URL="http://fpdownload.macromedia.com/get/flashplayer/current/licensing/mac/install_flash_player_12_osx.dmg"
FLASH_DMG=$(mktemp -d -t flash_dmg)/flash.dmg
FLASH_MOUNTPOINT=$(mktemp -d -t flash_mountpoint)
FLASH_PKG="$FLASH_MOUNTPOINT/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg"
curl -o $FLASH_DMG $FLASH_URL
hdiutil attach -mountpoint $FLASH_MOUNTPOINT -nobrowse $FLASH_DMG
FLASH_PKG_ARCHIVE="$FLASH_MOUNTPOINT/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg"
FLASH_PKG_EXTRACT_DIR=$(mktemp -d -t flash_pkg_extract_dir)
@zhoujj2013
zhoujj2013 / gtf2refGene.pl
Last active December 17, 2023 14:07
Convert ensembl gtf file to UCSC refGene.txt file.
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
&usage if @ARGV<1;
#open IN,"" ||die "Can't open the file:$\n";
#open OUT,"" ||die "Can't open the file:$\n";
@tompng
tompng / helloworld.rb
Last active December 23, 2015 09:59
HelloWorlds
#!ruby
def method_missing name, *args
n, a = name.to_s.chars.first, *args
return n + a.to_s if n.downcase == n || n.respond_to?(n)
String.class_eval{define_method(n){a.size - n.size}}
print n + a + (a.reverse.ord - n.ord - a.hex / n.send(n) - n.send(n)).chr
end
H H eeee l l oo
H H e l l o o
@yamaya
yamaya / xcode-clang-vers
Last active February 25, 2025 12:06
Xcode clang version record
# Xcode 4.3.3
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
# Xcode 4.3.2
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix