Skip to content

Instantly share code, notes, and snippets.

View dwilkins's full-sized avatar

David H. Wilkins dwilkins

View GitHub Profile
@dwilkins
dwilkins / resizeit.sh
Last active December 20, 2015 23:18
Resize images and use the tileup gem to slice them up for a slippy map
imagename=$1
imagebasename=${imagename%.*}
size=512
for size in 512 1024 2048 4096 8192 16384
do
echo "Resizing to ${size}x${size}"
convert -size ${size}x${size} xc:transparent canvas.png
time composite -resize ${size}x${size} $1 -gravity center canvas.png -size ${size}x${size} "${imagebasename}-${size}.png"
@dwilkins
dwilkins / database.yml
Created August 13, 2013 22:26
When deploying to Openshift this is what the database.yml should look like
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
@dwilkins
dwilkins / tobrowser.sh
Created August 14, 2013 02:26
gstreamer to browser (uses vlc plugin though)
Ok. Here is the sending side.
This is specialized for our strange needs, it may not right right for
others.
I don't have access to receiving side. Maintained by somebody else, and
part of a complicated web app.
But you can invoke VLC directly to catch this video. Just point it at the
URL.
Be warned that most routers do not properly handle multicast data.
#!/bin/bash
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"
xmlns:geo="http://www.google.com/geo/schemas/sitemap/1.0"
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0"
xmlns:pagemap="http://www.google.com/schemas/sitemap-pagemap/1.0"
@dwilkins
dwilkins / 20-intel.conf
Last active December 22, 2015 11:18
X11 Config file for Fedora 19 (et. al.) that keeps the graphics card from going into thermal meltdown
# file: /etc/X11/xorg.conf.d/20-intel.conf
# source: https://wiki.archlinux.org/index.php/Intel_Graphics#Choose_acceleration_method
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "uxa"
EndSection
@dwilkins
dwilkins / meminfo.txt
Last active December 22, 2015 11:19
Excerpt from /proc/meminfo
# command was "cat /proc/meminfo"
MemTotal: 16315816 kB
MemFree: 7011904 kB
Buffers: 1122588 kB
Cached: 2679048 kB
SwapCached: 0 kB
Active: 5757240 kB
Inactive: 2607544 kB
@dwilkins
dwilkins / cpuinfo.txt
Last active December 22, 2015 11:19
Excerpt from /proc/cpuinfo
# /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz
stepping : 7
microcode : 0x29
cache size : 4096 KB
siblings : 4
@dwilkins
dwilkins / ARDroneDmesg.txt
Created January 2, 2014 02:53
ARDrone dmesg output
# uname -a
Linux uclibc 2.6.32.9-g980dab2 #1 PREEMPT Mon Sep 16 11:50:23 CEST 2013 armv7l GNU/Linux
#
# dmesg
o_vfs_ioctl+0x550/0x598)
[<c00cda84>] (do_vfs_ioctl+0x550/0x598) from [<c00cdb00>] (sys_ioctl+0x34/0x54)
[<c00cdb00>] (sys_ioctl+0x34/0x54) from [<c0033f00>] (ret_fast_syscall+0x0/0x2c)
---[ end trace 7d8925b6601e5556 ]---
Enabling CTS wakeup for UART3
Enabling CTS wakeup for UART2
@dwilkins
dwilkins / ARDronePantechMessages.txt
Created January 2, 2014 02:55
AR.Drone /var/log/messages output with Pantech attached (really is Jan)
# cat /var/log/messages
Jan 1 00:00:04 uclibc syslog.info syslogd started: BusyBox v1.14.0
Jan 1 00:00:04 uclibc user.notice kernel: klogd started: BusyBox v1.14.0 ()
Jan 1 00:00:04 uclibc user.notice kernel: Linux version 2.6.32.9-g980dab2 (stephane@stephane-pc) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) ) #1 PREEMPT Mon Sep 16 11:50:23 CEST 2013
Jan 1 00:00:04 uclibc user.warn kernel: CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
Jan 1 00:00:04 uclibc user.warn kernel: CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Jan 1 00:00:04 uclibc user.warn kernel: Machine: mykonos2 board
Jan 1 00:00:04 uclibc user.warn kernel: Memory policy: ECC disabled, Data cache writeback
Jan 1 00:00:04 uclibc user.debug kernel: On node 0 totalpages: 32768
Jan 1 00:00:04 uclibc user.debug kernel: free_area_init_node: node 0, pgdat c04d1ba8, node_mem_map c05a7000
@dwilkins
dwilkins / Almostthere.txt
Last active January 1, 2016 23:09
Cool AR.Drone messages...
usbserial_generic 1-1:1.7: usb_probe_interface
usbserial_generic 1-1:1.7: usb_probe_interface - got id
/home/stephane/.ardrone/linux/ardrone2_ARDrone2_Version_20130102/Linux/kernel/omap/drivers/usb/core/inode.c: creating file '003'
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 1-0:1.0: port 1 enable change, status 00000503
cdc_ether: version magic '2.6.32.9 preempt mod_unload ARMv7 ' should be '2.6.32.9-g980dab2 preempt mod_unload ARMv7 '
cdc_ether: version magic '2.6.32.9 preempt mod_unload ARMv7 ' should be '2.6.32.9-g980dab2 preempt mod_unload ARMv7 '
### Almost got it ###
cdc_ether: version magic '2.6.32.9g980dab2 preempt mod_unload ARMv7 ' should be '2.6.32.9-g980dab2 preempt mod_unload ARMv7 '