This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Copyright 2013 Google Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Replacement for htpasswd""" | |
# Original author: Eli Carter | |
import os | |
import sys | |
import random | |
from optparse import OptionParser | |
# We need a crypt module, but Windows doesn't have one by default. Try to find |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from xattr import xattr | |
from sys import argv, stderr | |
directory = './walker' | |
child_was_empty = None | |
last_depth = None | |
#from https://github.com/danthedeckie/display_colors/blob/master/display_colors.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Signal strength: | |
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep agrCtlRSSI | awk '{print "Signal strength: "$2}' ; sleep 0.5; done | |
# BSSID | |
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep BSSID; sleep 0.5; done | |
# Speed | |
ping www.google.se |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TO MP4 (with quicktime/windows media player support) | |
# Convert to 720 MP4 (roughly 7MB for 30 seconds) | |
ffmpeg -i input.mp4 -s hd720 -c:v libx264 -crf 23 -c:a aac -strict -2 -pix_fmt yuv420p output.mp4 | |
# Convert to 1080 MP4 (roughtly 60MB for 30 seconds) - high resolution, but not RAW | |
ffmpeg -i input.mp4 -s hd1080 -c:v libx264 -crf 23 -c:a aac -strict -2 -pix_fmt yuv420p output.mp4 | |
# Animated gif to mp4 | |
ffmpeg -i input.gif -strict -2 -pix_fmt yuv420p output.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Reset rem to 10-based instead of default browser 16 */ | |
html { | |
font-size: 62.5%; | |
} | |
/* | |
Photoshop does not apply line height to the first row, which CSS does. This creates all kinds of havock. | |
To calculate the correct offset for the first line we need the font-size and the lineheight, i.e: | |
@include line-height(22,30); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flask | |
import jinja2 | |
app = flask.Flask(__name__) | |
my_loader = jinja2.ChoiceLoader([ | |
app.jinja_loader, | |
jinja2.FileSystemLoader('/path/to/extra/templates'), | |
]) | |
app.jinja_loader = my_loader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /home/niklas/xen/xen-unpatched/xen/tools/ioemu-remote/hw/xen_disk.c 2013-11-28 13:22:15.000000000 +0100 | |
+++ /home/niklas/xen/xen/tools/ioemu-remote/hw/xen_disk.c 2013-11-27 11:59:23.000000000 +0100 | |
@@ -116,6 +116,31 @@ | |
/* ------------------------------------------------------------- */ | |
+static void ioreq_reset(struct ioreq *ioreq) | |
+{ | |
+ memset(&ioreq->req, 0, sizeof(ioreq->req)); | |
+ ioreq->status = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xen-create-image --hostname site.se --ip XX.XX.X.XXX --dist wheezy --dir /home/xen --memory 512Mb --size 15gb --swap 1024Mb --gateway XX.XX.XX.XX --netmask 255.255.255.0 --passwd --role=udev --accounts --vifname=yourdomain --vcpus=1 |