Skip to content

Instantly share code, notes, and snippets.

View TurBoss's full-sized avatar

TurBoss TurBoss

  • Spain
View GitHub Profile
How to create a 4MB FreeDOS boot disk for eg, doing a motherboard bios upgrade.
Originally from http://www.linuxinsight.com/how-to-flash-motherboard-bios-from-linux-no-dos-windows-no-floppy-drive.html
The following is a brief outline of how I created a 4MB CD boot image to update the bios on a motherboard I have been considering buying.
I do not have this motherboard, but I have tested the bootable CD up to the point of actually flashing the bios.
FWIW, my computer runs PATA / IDE HDs and optical drives. Not SATA.
Adjust accordingly to your distro, hardware, etc.
I'm human, and make typos on occasion. So double check your input.
@7shi
7shi / a.c
Created March 6, 2011 02:16
hello world in UNIX V6 (PDP-11)
main(){write(1,"hello\n",6);}
@rca
rca / ajax_setup.js
Created January 29, 2012 00:27
Setup Django CSRF token in JQuery AJAX requests
/**
* setup JQuery's AJAX methods to setup CSRF token in the request before sending it off.
* http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request
*/
function getCookie(name)
{
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
@jlitewski
jlitewski / FindLibnotify.cmake
Created March 13, 2012 00:17
Find the Libnotify libraries (cmake 2.8 module)
# Find the Libnotify libraries
# This module will find the libnotify library, and do some
# sanity checking (making sure things compile, version checking,
# dependancy checking, etc). Libnotify requires the GTK Library (GTK2 or GTK3) and glib Library (GLIB2)
# This requires cmake => 2.8 to work correctly
# @Author: Jacob "HACKhalo2" Litewski
# @Version: 1.0
@legege
legege / mjpeg-directives.html
Created April 3, 2013 14:02
This is an AngularJS directive for MJPEG streams. This directive uses an iframe to stop the browser from loading the MJPEG stream. This is useful for Chrome: https://code.google.com/p/chromium/issues/detail?id=73395
<mjpeg url="videoUrl"></mjpeg>
@mehcode
mehcode / install-pygtk.sh
Created August 7, 2013 09:49
Install pygtk inside of a virtualenv
# Ensure we're in a virtualenv.
if [ "$VIRTUAL_ENV" == "" ]
then
echo "ERROR: not in a virtual environment."
exit -1
fi
# Setup variables.
CACHE="/tmp/install-pygtk-$$"
@tonyseek
tonyseek / README.rst
Last active November 5, 2022 15:20
Build Python binding of C++ library with cffi (PyPy/Py3K compatible)

Run with Python:

pip-2.7 install cffi
PYTHON=python2.7 sh go.sh

Run with PyPy:

pip-pypy install cffi
PYTHON=pypy sh go.sh
@strezh
strezh / GStreamer-1.0 some strings.sh
Last active October 2, 2023 09:00
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
@nocnokneo
nocnokneo / CMakeLists.txt
Last active July 10, 2024 09:03
VTK Rendered to an FBO in a Qt Quick 2 Scene Graph
cmake_minimum_required(VERSION 2.8.11)
project(VtkFboInQtQuick)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
@ctokheim
ctokheim / cython_tricks.md
Last active March 4, 2024 23:27
cython tricks

Cython

Cython has two major benefits:

  1. Making python code faster, particularly things that can't be done in scipy/numpy
  2. Wrapping/interfacing with C/C++ code

Cython gains most of it's benefit from statically typing arguments. However, statically typing is not required, in fact, regular python code is valid cython (but don't expect much of a speed up). By incrementally adding more type information, the code can speed up by several factors. This gist just provides a very basic usage of cython.