Skip to content

Instantly share code, notes, and snippets.

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:
#
@darealshinji
darealshinji / Makefile
Created July 9, 2017 06:33
simple MD5 checksum tool
SRCS = md5.c md5cmp.c md5hl.c
OBJS = $(SRCS:%.c=%.o)
LD := g++
CC := gcc
STRIP := strip
all: md5
/*
* Copyright (C) 2016 Sven Brauch <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@darealshinji
darealshinji / kbhit.c
Created July 7, 2017 00:09 — forked from vsajip/kbhit.c
Keyboard hit testing
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
int kbhit(void)
{
struct termios oldt, newt;
int ch;
int oldf;
@darealshinji
darealshinji / mxe-relocate.sh
Created July 3, 2017 01:48
Shell script helping to relocate an MXE prefix; see https://github.com/mxe/mxe/issues/1700
#!/usr/bin/env bash
help="Relocate an MXE prefix\n\
\n\
Usage: $0 old_path new_path prefix\n\
\n\
old and new paths must be absolute\n\
new path must not be longer than the old one\n\n"
if [ "x$3" = "x" ] || [ "x$2" = "x" ] || [ "x$1" = "x" ]; then