Skip to content

Instantly share code, notes, and snippets.

@btashton
btashton / ultrabook_notes
Created February 24, 2014 00:40
Tricks for Ultrabook under fedora.
#enable touchpad scrolling
synclient "VertTwoFingerScroll=1"
@btashton
btashton / vim_notes
Last active August 29, 2015 13:56
Various Notes for VIM
== VIM Notes ==
=== ctags ===
Generate tags file in the top directory with: ctags -R .
Lets you navigate source files by functions.
<ctrl-]> enters function
<ctrl-t> move up tree
http://blog.stwrt.ca/2012/10/31/vim-ctags
=== taglist ===
@btashton
btashton / docker0
Last active August 29, 2015 14:05
Docker udp traffic
tcpdump -i docker0
21:37:59.981107 IP ip-172-17-0-61.ec2.internal.43650 > ip-10-0-0-208.ec2.internal.distinct: UDP, length 39
21:37:59.981254 IP ip-172-17-42-1.ec2.internal.43069 > ip-172-17-0-59.ec2.internal.distinct: UDP, length 39
21:38:00.005553 IP ip-172-17-0-59.ec2.internal.58820 > ip-172-17-42-1.ec2.internal.43069: UDP, length 5
Client at ip-172-17-0-61 sent a request to ip-10-0-0-208 (eth0 address of docker host)
Host (docker0) at ip-172-17-42-1 forwarded packet to ip-172-17-0-59 (Server)
Server at ip-172-17-0-59 replied to ip-172-17-42-1.ec2 host (docker0)
@btashton
btashton / logstash.conf
Last active August 29, 2015 14:08
logstashconfig
input {
stdin {
type => "stdin-type"
}
udp {
port => 9000
codec => json
}
}
@btashton
btashton / beaver.conf
Created October 23, 2014 23:08
test beaver config
[beaver]
logstash_version: 1
udp_host: 127.0.0.1
udp_port: 9000
[/app/log/**/*.log]
type: syslog
tags: sys,main
@btashton
btashton / coreos-stable-hvm.template
Created November 7, 2014 01:40
coreos-stable template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"eu-central-1" : {
"AMI" : "ami-eec6f0f3"
},
@btashton
btashton / sama5d3_xplained_linux_boot.log
Created March 13, 2015 23:59
sama5d3_xplained_linux_boot.log
RomBOOT
AT91Bootstrap 3.6.1-00078-g5415d4e (Tue Feb 4 15:36:46 CET 2014)
NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0x32
NAND: Disable On-Die ECC
NAND: Initialize PMECC params, cap: 0x4, sector: 0x200
NAND: Image: Copy 0x80000 bytes from 0x40000 to 0x26f00000
@btashton
btashton / cq.sh
Created April 1, 2015 20:33
cq.sh
# Create a fresh database, add some data, create a continuous query, list continuous queries, drop continuous query
curl -v -G http://localhost:8086/query --data-urlencode "q=DROP DATABASE mydb"
echo
curl -v -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb"
echo
curl -v -XPOST 'http://localhost:8086/write' -d '
{
"database": "mydb",
"retentionPolicy": "default",
"points": [
@btashton
btashton / Notes.md
Last active August 29, 2015 14:18
Resize Partitions on SD card Image

I had imaged a full 8GB SD card, but I only wanted to distribute a smaller image. These are a few notes:

Image the SD card

dd if=/dev/sdb of=./backup.img

Now I wanted to use gparted to resize the partition, you can run sudo gparted ./backup.img and it will show the partitions, but it will think that the partitions are located at /dev/./backup.img1 and /dev/./backup.img2 which is not correct. The trick here is to use the loopback interface.

losetup /dev/loop0 backup.img this will make the backup.img file show up as a block device. You can then run gparted on /dev/loop0 and once again see the partition table. There still is an issue though, it will look for the partitions to be located at /dev/loop0p1 and /dev/loop0p2, these block devices do not exist. It turns out that losetup has a flag that I have not noticed anywhere before -P this causes the kernel to read the partition table of the device and create the additional block device. This lets us avoid having to manually look at the partit

@btashton
btashton / nuttx_run.sh
Created May 14, 2015 06:27
run nutts on qemu
sudo ip tap add mode tap
sudo ifconfig tap0 10.0.0.1
qemu-system-arm -M lm3s6965evb -kernel nuttx -net nic,model=stellaris -net tap,ifname=tap0,script=no,downscript=no