Skip to content

Instantly share code, notes, and snippets.

View Ultrabenosaurus's full-sized avatar

Dan Bennett Ultrabenosaurus

  • UK
View GitHub Profile
@shamil
shamil / mount_qcow2.md
Last active May 3, 2024 06:35
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@AnalogJ
AnalogJ / download_opds.py
Created August 29, 2017 01:54
download all books in OPDS catalog.
import urllib2
import os
import urllib, urlparse
import xml.etree.cElementTree as et
e = et.ElementTree(file=urllib2.urlopen('https://standardebooks.org/opds/all')).getroot()
print(e)
print("parsing")
for atype in e.iter('{http://www.w3.org/2005/Atom}link'):
@jrivero
jrivero / cachedHTMLForURL.php
Created September 24, 2012 11:12
Retrieve Google Cached HTML
<?php
// http://hactheplanet.com/blog/11
function cachedHTMLForURL($url)
{
// Request the cache from Google.
$googleRequestURL = "http://webcache.googleusercontent.com/search?q=" . urlencode("cache:" . $url);
$googleResponse = file_get_contents($googleRequestURL);
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@chrisjlee
chrisjlee / querySelector.polyfill.js
Created February 12, 2014 17:39
IE document.querySelector() polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
@xeoncross
xeoncross / top-cms-projects
Created November 5, 2012 03:04 — forked from abpin/top-cms-projects
List of top 1200 CMS systems
1. Joomla!
2. Drupal
3. Mambo
4. TYPO3 Enterprise CMS
5. WebGUI
6. WordPress
7. Plone
8. Xoops
9. PHP Nuke
10. eZ Publish
@fitorec
fitorec / android.logo.html
Created September 19, 2012 09:13
logo android en puro HTML & CSS
<!DOCTYPE html>
<html lang="es-MX">
<head>
<title>logo android</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css" media="all">
#perspective-container { position: absolute; top: 0px; width: 264px; height: 336px; background-color: rgba(0,0,0,.05); -moz-transform-style: preserve-3d; -moz-perspective: 800px;}
#android { position: absolute; top: 0px; width: 264px; height: 336px;}
#android .body { position: absolute; top: 110px; left: 48px; width: 168px; height: 152px; border-radius: 0px 0px 30px 30px; background-color: #ED8415;}
#android .head { position: absolute; top: 30px; left: 48px; width: 168px; height: 68px; border-top-left-radius: 50% 100%; border-top-right-radius: 50% 100%; background-color: #ED8415; }
@Ultrabenosaurus
Ultrabenosaurus / mp4-to-gif.sh
Last active October 4, 2021 13:42
Simple bash script to convert MP4 videos to GIF
#!/bin/bash
#############################################
#
# mp4-to-gif
#
# Convert MP4 videos to GIF images
# Requires ffmpeg and imagemagick
#
# -g and --gifsicle options create a second optimised GIF for your consideration
@xeoncross
xeoncross / gdrivecms.php
Created September 20, 2012 14:37 — forked from timwis/gdrivecms.php
GDriveCMS allows you to use Google Docs' familiar interface for adding content to a mobile-optimized web page. Simply create a Google Document with whatever content you want, publish it to the web (in the File menu), and render it through this script.
<?php
/* GDriveCRM
Created by Tim Wisniewski (timwis.com)
GDriveCMS allows you to use Google Docs' familiar interface for adding content to a mobile-optimized web page.
Simply create a Google Document with whatever content you want, publish it to the web (in the File menu),
and render it through this script.
1. Create a document in Google Drive (Google Docs)
2. Go to File > Publish to the web
3. Click Start Publishing & check Automatically republish
4. Grab the document link (URL) in that dialog
@remy
remy / weekend-commits.js
Last active January 14, 2020 08:09
Run this in the console of your github.com/<user> page (i.e. http://github.com/remy) and see how many weekends you were in front of a computer and committing code instead of taking a break.
$.getJSON('https://github.com/users/' + location.pathname.replace(/\//g, '') + '/contributions_calendar_data', weekendWork);
function weekendWork(contribs) {
var inwe = false, streak = 0, highest = 0, total = 0, possible = 0;
contribs.forEach(function (c) {
var d = new Date(c[0]).getDay();
if (d === 6) {
inwe = true;
} else if (d === 0 && inwe) {
possible++;
if (c[1] !== 0) {