Skip to content

Instantly share code, notes, and snippets.

@slowriot
slowriot / gist:7663385
Last active August 24, 2016 18:55
Make your linux prompt look like a C64 console.
# blue text:
echo -en "\e[44m\e[01;34m";PS1="\[\033[01;34m\]\[\033[44m\]READY.\n";alias ls="ls --color=none";clear;echo " **** COMMODORE 64 BASIC V2 ****";echo " $(free -k|head -2|tail -1|tr -s " "|cut -d" " -f2)K RAM SYSTEM $(free -b|head -2|tail -1|tr -s " "| cut -d" " -f4) BASIC BYTES FREE"
@slowriot
slowriot / gist:7663640
Last active December 29, 2015 11:29
Make your linux prompt look like a C64 console - higher contrast version with cyan text instead of blue
# cyan text:
echo -en "\e[44m\e[01;36m";PS1="\[\033[01;36m\]\[\033[44m\]READY.\n";alias ls="ls --color=none";clear;echo " **** COMMODORE 64 BASIC V2 ****";echo " $(free -k|head -2|tail -1|tr -s " "|cut -d" " -f2)K RAM SYSTEM $(free -b|head -2|tail -1|tr -s " "| cut -d" " -f4) BASIC BYTES FREE"
/*
* The following code produces a segfault when run on linux, but works on windows.
*
* Segfault at:
* Src/OVR_DeviceImpl.h:384
* factory->AddedToManager(this);
*
*/
#include <OVR.h>
--- intrin.h Wed Feb 19 11:23:33 2014
+++ intrin.h_patched Mon Mar 31 23:03:19 2014
@@ -647,8 +647,10 @@
__MACHINEX86X_NOX64(__m64 _m_pavgw(__m64,__m64))
__MACHINEX86X_NOX64(__m64 _m_psadbw(__m64,__m64))
#endif
+#if !defined(__GNUC__) || (!defined(__3dNOW__) && !defined(__MINGW_FORCE_SYS_INTRINS))
__MACHINEX86X_NOWIN64(__m64 _m_from_float(float))
__MACHINEX86X_NOWIN64(float _m_to_float(__m64))
+#endif
@slowriot
slowriot / bashpatch4.3.25slowriot
Created September 27, 2014 22:11
Bash patch 2014-09-27 against 4.3.25(1)
diff -ur ../bash-4.3orig/parse.y ./parse.y
--- ../bash-4.3orig/parse.y 2014-09-27 17:52:38.878472141 -0400
+++ ./parse.y 2014-09-26 09:48:04.192597937 -0400
@@ -2953,6 +2953,8 @@
FREE (word_desc_to_read);
word_desc_to_read = (WORD_DESC *)NULL;
+ eol_ungetc_lookahead = 0;
+
current_token = '\n'; /* XXX */
@slowriot
slowriot / bashpatch4.3.26slowriot
Created September 27, 2014 22:47
Bash patch 2014-09-27 against 4.3.26(1)
diff -ur ../bash-4.3/variables.c ./variables.c
--- ../bash-4.3/variables.c 2014-09-27 23:46:03.000000000 +0100
+++ ./variables.c 2014-09-27 23:40:17.000000000 +0100
@@ -279,7 +279,7 @@
static void propagate_temp_var __P((PTR_T));
static void dispose_temporary_env __P((sh_free_func_t *));
-static inline char *mk_env_string __P((const char *, const char *));
+static inline char *mk_env_string __P((const char *, const char *, int));
static char **make_env_array_from_var_list __P((SHELL_VAR **));
LHOTB8:
.align 2
.p2align 4,,-1
.globl __ZN4SHA115buffer_to_blockERKSsPm
.def __ZN4SHA115buffer_to_blockERKSsPm; .scl 2; .type 32; .endef
__ZN4SHA115buffer_to_blockERKSsPm:
LFB1210:
.cfi_startproc
pushl %ebp #
.cfi_def_cfa_offset 8
LHOTB12:
.align 2
.p2align 4,,-1
.globl __ZN4SHA115buffer_to_blockERKSsPm
.def __ZN4SHA115buffer_to_blockERKSsPm; .scl 2; .type 32; .endef
__ZN4SHA115buffer_to_blockERKSsPm:
LFB1210:
.cfi_startproc
pushl %esi #
.cfi_def_cfa_offset 8
@slowriot
slowriot / cmake.patch
Created December 7, 2014 20:33
portaudio mingw64 cmake patch
--- origsrc/portaudio/CMakeLists.txt 2014-03-31 23:02:39.312957300 -0500
+++ src/portaudio/CMakeLists.txt 2014-03-31 23:17:59.313782600 -0500
@@ -335,9 +335,15 @@ SET_TARGET_PROPERTIES(portaudio PROPERTI
SET_TARGET_PROPERTIES(portaudio_static PROPERTIES OUTPUT_NAME portaudio_static_${TARGET_POSTFIX})
ENDIF(WIN32)
+OPTION(PA_BUILD_CXX "Include C++ bindings" OFF)
OPTION(PA_BUILD_TESTS "Include test projects" OFF)
OPTION(PA_BUILD_EXAMPLES "Include example projects" OFF)
@slowriot
slowriot / exec_helloworld.py
Created January 13, 2015 04:00
Python hello world example for the exec system
#!/usr/bin/env python
# Simple hello world exec script showing basic usage
import sys
import os
username = os.environ.get('MCEXEC_PLAYERNAME')
if username == None:
# yellow is a good colour to use to warn players about problems