Skip to content

Instantly share code, notes, and snippets.

View dpedu's full-sized avatar

Dave Pedu dpedu

View GitHub Profile
@hh
hh / gist:999754
Created May 31, 2011 02:00
Zentyal debian-installer seed file to allow an NZ biased 'No Questions Asked' install
We couldn’t find that file to show.
@e000
e000 / donotuse.py
Created June 13, 2011 23:30
How to NEVER use lambdas.
##########################################################
# How to NEVER use Lambdas. An inneficient and yet educa-#
# tonal guide to the proper misuse of the lambda constru-#
# ct in Python 2.x. [DO NOT USE ANY OF THIS EVER] #
# by: e000 (13/6/11) #
##########################################################
## Part 1. Basic LAMBDA Introduction ##
# Well, it's worth diving straight into what lambdas are.
# Lambdas are pretty much anonymous "one line" functions
@smoser
smoser / README.md
Last active October 12, 2020 17:14
ubuntu-auto-install: install a ubuntu image with kvm

Ubuntu Auto Install

This allows user to do automated installation of ubuntu. Provided here a a few different files/scripts for making this easier.

I've used this to verify that d-i kernel and initramfs from -proposed work as shown in bug 1511497.

The provided 'preseed' below can be used as a fully automated installation of ubuntu. Boot with qemu like:

note python web server is useful for this (python -m SimpleHTTPServer 9999)

@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active November 14, 2024 17:18
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@chrismeyersfsu
chrismeyersfsu / gist:3270358
Created August 6, 2012 04:22
Arduino Poor man's oscilloscope
#define ANALOG_IN 0
void setup() {
Serial.begin(9600);
//Serial.begin(115200);
}
void loop() {
int val = analogRead(ANALOG_IN);
Serial.write( 0xff );
#element{
background-image: url('/images/sprite.png');
background-repeat: no-repeat;
background-position: -3px 0;
}
@media (min--moz-device-pixel-ratio: 1.25),
(-webkit-min-device-pixel-ratio: 1.25),
(min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx) {
@hitsumabushi
hitsumabushi / default
Last active September 21, 2020 09:12
Preseed Files : working with Wheezy & Ubuntu 14.04
# D-I config version 2.0
default debian/7.4/amd64/boot-screens/vesamenu.c32
prompt 1
timeout 300
menu title - Boop Menu -
label Debian-7.4
menu label ^0 Debian 7.4
#include debian/7.4/amd64/boot-screens/menu.cfg
kernel debian/7.4/amd64/linux
@whiteinge
whiteinge / eventlisten.sh
Last active August 30, 2017 18:37
A POSIX sh implementation of Salt's eventlisten.py script. Uses salt-api's event HTTP stream.
#!/bin/sh
URL="http://localhost:8000"
COOKIES="cookies.txt"
fnmatch () { case "$2" in $1) return 0 ;; *) return 1 ;; esac ; }
listen() {
# Watch Salt's events HTTP stream.
@adamsdesk
adamsdesk / gist:2c1faa68a6b28a261a85
Created July 9, 2014 16:18
How to Create a Custom USB Debian Installer
This custom installer assumes to use the Debian Wheezy 32-bit/AMD 64-bit.
Example of preseed file http://www.debian.org/releases/stable/example-preseed.txt.
- Plug the USB flash drive into a Linux based system.
- # sudo blkid
* Note the device name for the USB flash drive to be used in the next step.
- Use gParted or fdisk or cfdisk to create the following on the USB flash drive.
- Create as: Primary Partition
- Free space preceding (MIB): 1
- Free space following (MIB): 0