Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
@darealshinji
darealshinji / bms.c
Last active March 12, 2018 18:40
Linux launcher for Black Mesa
// gcc -m32 -Wall -Wextra -O3 bms.c -o bms_linux_new -ldl -s -Wl,-rpath,'$ORIGIN/bin'
// setting the RPATH to '$ORIGIN/bin' makes it possible to start the game without "bms.sh"
#include <dlfcn.h>
#include <errno.h>
#include <inttypes.h>
#include <libgen.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
/*
Copyright (c) 2014, Christoph "Youka" Spanknebel
Copyright (c) 2017 djcj <djcj@gmx.de>
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
program project1;
{$mode objfpc}
{$h+}
uses
strutils,
sysutils,
crc;
@darealshinji
darealshinji / launch.c
Created August 24, 2017 11:29
Decide on runtime whether to start a 32 bit or 64 bit program; compile with "-m32 -static"
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
//#include <selinux/selinux.h>
extern int is_selinux_enabled(void)
{
/* always return 0; this way we don't trigger any SELINUX calls */
return 0;
}
/* this function gives failures when installing basic rpms in the root;
* so we fake it out as well */
--- a/lib/system.c
+++ b/lib/system.c
@@ -404,16 +404,19 @@
r += ret;
#endif
-#ifdef DEFAULT_TRUST_STORE_FILE
- ret =
- gnutls_x509_trust_list_add_trust_file(list,
- DEFAULT_TRUST_STORE_FILE,
#!/bin/bash
# tested on Debian 7 and Ubuntu 14.04
set -e
set -x
export LANG=C
APP="VLC"
LOWERAPP="vlc"
JOBS=4
#!/bin/bash
# The purpose of this script is to provide lightweight desktop integration
# into the host system without special help from the host system.
# If you want to use it, then place this in usr/bin/$APPNAME.wrapper
# and set it as the Exec= line of the .desktop file in the AppImage.
#
# For example, to install the appropriate icons for Scribus,
# put them into the AppDir at the following locations:
#